Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
0cbde57b79 | |||
03aec55fbe | |||
64551c033b | |||
265c5d7d99 | |||
7492760d4f | |||
31a9aeaece | |||
c04b9e2ac5 |
@ -29,7 +29,7 @@ internal sealed class Configuration : IPluginConfiguration
|
||||
public bool UncapFrameRate { get; set; }
|
||||
public VirtualKey QuickTurnInKey { get; set; } = VirtualKey.SHIFT;
|
||||
|
||||
public WindowConfig TurnInWindowConfig { get; } = new();
|
||||
public MinimizableWindowConfig TurnInWindowConfig { get; } = new();
|
||||
public WindowConfig ConfigWindowConfig { get; } = new();
|
||||
|
||||
internal sealed class PurchaseOption
|
||||
@ -84,4 +84,9 @@ internal sealed class Configuration : IPluginConfiguration
|
||||
Warning,
|
||||
DisableTurnIn,
|
||||
}
|
||||
|
||||
internal sealed class MinimizableWindowConfig : WindowConfig
|
||||
{
|
||||
public bool IsMinimized { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<Target Name="PackagePlugin" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
|
||||
<Target Name="PackagePluginDebug" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
|
||||
<DalamudPackager
|
||||
ProjectDir="$(ProjectDir)"
|
||||
OutputPath="$(OutputPath)"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<Project Sdk="Dalamud.NET.Sdk/9.0.2">
|
||||
<Project Sdk="Dalamud.NET.Sdk/11.0.0">
|
||||
<PropertyGroup>
|
||||
<Version>5.4</Version>
|
||||
<Version>6.3</Version>
|
||||
<OutputPath>dist</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -218,11 +218,11 @@ public sealed partial class DeliverooPlugin : IDalamudPlugin
|
||||
{
|
||||
if (CharacterConfiguration.CachedPlayerName != _clientState.LocalPlayer!.Name.ToString() ||
|
||||
CharacterConfiguration.CachedWorldName !=
|
||||
_clientState.LocalPlayer.HomeWorld.GameData!.Name.ToString())
|
||||
_clientState.LocalPlayer.HomeWorld.Value.Name.ToString())
|
||||
{
|
||||
CharacterConfiguration.CachedPlayerName = _clientState.LocalPlayer!.Name.ToString();
|
||||
CharacterConfiguration.CachedWorldName =
|
||||
_clientState.LocalPlayer.HomeWorld.GameData!.Name.ToString();
|
||||
_clientState.LocalPlayer.HomeWorld.Value.Name.ToString();
|
||||
|
||||
CharacterConfiguration.Save(_pluginInterface);
|
||||
}
|
||||
@ -242,7 +242,7 @@ public sealed partial class DeliverooPlugin : IDalamudPlugin
|
||||
}
|
||||
}
|
||||
|
||||
private void Logout()
|
||||
private void Logout(int type, int code)
|
||||
{
|
||||
CharacterConfiguration = null;
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.RegularExpressions;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Plugin.Services;
|
||||
using LLib;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.CustomSheets;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Lumina.Excel.Sheets;
|
||||
using Lumina.Text.ReadOnly;
|
||||
|
||||
namespace Deliveroo.GameData;
|
||||
|
||||
@ -24,10 +23,10 @@ internal sealed class GameStrings
|
||||
ExchangeItems = dataManager.GetRegex<Addon>(3290, addon => addon.Text, pluginLog)
|
||||
?? throw new ConstraintException($"Unable to resolve {nameof(ExchangeItems)}");
|
||||
TradeHighQualityItem =
|
||||
dataManager.GetString<Addon>(102434, addon => addon.Text, pluginLog)?.ReplaceLineEndings("")
|
||||
dataManager.GetString<Addon>(102434, addon => addon.Text, pluginLog)
|
||||
?? throw new ConstraintException($"Unable to resolve {nameof(TradeHighQualityItem)}");
|
||||
|
||||
var rankUpFc = dataManager.GetExcelSheet<LogMessage>()!.GetRow(3123)!;
|
||||
var rankUpFc = dataManager.GetExcelSheet<LogMessage>().GetRow(3123);
|
||||
RankUpFc = rankUpFc.GetRegex(logMessage => logMessage.Text, pluginLog)
|
||||
?? throw new ConstraintException($"Unable to resolve {nameof(RankUpFc)}");
|
||||
RankUpFcType = (XivChatType)rankUpFc.LogKind;
|
||||
@ -43,7 +42,16 @@ internal sealed class GameStrings
|
||||
|
||||
[Sheet("custom/000/ComDefGrandCompanyOfficer_00073")]
|
||||
[SuppressMessage("Performance", "CA1812")]
|
||||
private sealed class ComDefGrandCompanyOfficer : QuestDialogueText
|
||||
private readonly struct ComDefGrandCompanyOfficer(ExcelPage page, uint offset, uint row)
|
||||
: IQuestDialogueText, IExcelRow<ComDefGrandCompanyOfficer>
|
||||
{
|
||||
public uint RowId => row;
|
||||
|
||||
public ReadOnlySeString Key => page.ReadString(offset, offset);
|
||||
public ReadOnlySeString Value => page.ReadString(offset + 4, offset);
|
||||
|
||||
static ComDefGrandCompanyOfficer IExcelRow<ComDefGrandCompanyOfficer>.Create(ExcelPage page, uint offset,
|
||||
uint row) =>
|
||||
new(page, offset, row);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Lumina.Excel.Sheets;
|
||||
using GrandCompany = FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany;
|
||||
|
||||
namespace Deliveroo.GameData;
|
||||
@ -10,31 +10,32 @@ internal sealed class GcRewardsCache
|
||||
{
|
||||
public GcRewardsCache(IDataManager dataManager)
|
||||
{
|
||||
var categories = dataManager.GetExcelSheet<GCScripShopCategory>()!
|
||||
var categories = dataManager.GetExcelSheet<GCScripShopCategory>()
|
||||
.Where(x => x.RowId > 0)
|
||||
.ToDictionary(x => x.RowId,
|
||||
x =>
|
||||
(GrandCompany: (GrandCompany)x.GrandCompany.Row,
|
||||
(GrandCompany: (GrandCompany)x.GrandCompany.RowId,
|
||||
Tier: (RewardTier)x.Tier,
|
||||
SubCategory: (RewardSubCategory)x.SubCategory));
|
||||
|
||||
Rewards = dataManager.GetExcelSheet<GCScripShopItem>()!
|
||||
.Where(x => x.RowId > 0 && x.Item.Row > 0)
|
||||
Rewards = dataManager.GetSubrowExcelSheet<GCScripShopItem>()
|
||||
.SelectMany(x => x)
|
||||
.Where(x => x.RowId > 0 && x.Item.RowId > 0)
|
||||
.GroupBy(item =>
|
||||
{
|
||||
var category = categories[item.RowId];
|
||||
return new
|
||||
{
|
||||
ItemId = item.Item.Row,
|
||||
Name = item.Item.Value!.Name.ToString(),
|
||||
IconId = item.Item.Row == ItemIds.Venture ? 25917 : item.Item.Value!.Icon,
|
||||
ItemId = item.Item.RowId,
|
||||
Name = item.Item.Value.Name.ToString(),
|
||||
IconId = item.Item.RowId == ItemIds.Venture ? 25917 : item.Item.Value.Icon,
|
||||
category.Tier,
|
||||
category.SubCategory,
|
||||
RequiredRank = item.RequiredGrandCompanyRank.Row,
|
||||
item.Item!.Value.StackSize,
|
||||
RequiredRank = item.RequiredGrandCompanyRank.RowId,
|
||||
item.Item.Value.StackSize,
|
||||
SealCost = item.CostGCSeals,
|
||||
InventoryLimit = item.Item.Value!.IsUnique ? 1
|
||||
: item.Item.Row == ItemIds.Venture ? item.Item.Value!.StackSize
|
||||
InventoryLimit = item.Item.Value.IsUnique ? 1
|
||||
: item.Item.RowId == ItemIds.Venture ? item.Item.Value.StackSize
|
||||
: int.MaxValue,
|
||||
};
|
||||
})
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Deliveroo.GameData;
|
||||
|
||||
@ -10,7 +10,7 @@ internal sealed class ItemCache
|
||||
|
||||
public ItemCache(IDataManager dataManager)
|
||||
{
|
||||
foreach (var item in dataManager.GetExcelSheet<Item>()!)
|
||||
foreach (var item in dataManager.GetExcelSheet<Item>())
|
||||
{
|
||||
string name = item.Name.ToString();
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
@ -19,7 +19,7 @@ internal sealed class ItemCache
|
||||
if (_itemNamesToIds.TryGetValue(name, out HashSet<uint>? itemIds))
|
||||
itemIds.Add(item.RowId);
|
||||
else
|
||||
_itemNamesToIds.Add(name, new HashSet<uint>{item.RowId});
|
||||
_itemNamesToIds.Add(name, [item.RowId]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,10 @@ using FFXIVClientStructs.FFXIV.Client.Game.Control;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using FFXIVClientStructs.FFXIV.Common.Math;
|
||||
using FFXIVClientStructs.FFXIV.Component.Excel;
|
||||
using Lumina.Excel;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using Lumina.Excel.Sheets;
|
||||
using Lumina.Text.ReadOnly;
|
||||
using GrandCompany = FFXIVClientStructs.FFXIV.Client.UI.Agent.GrandCompany;
|
||||
|
||||
namespace Deliveroo;
|
||||
@ -41,7 +43,7 @@ internal sealed class GameFunctions : IDisposable
|
||||
_pluginLog = pluginLog;
|
||||
|
||||
|
||||
_gcRankInfo = dataManager.GetExcelSheet<GrandCompanyRank>()!.Where(x => x.RowId > 0)
|
||||
_gcRankInfo = dataManager.GetExcelSheet<GrandCompanyRank>().Where(x => x.RowId > 0)
|
||||
.ToDictionary(x => x.RowId, x => new GcRankInfo
|
||||
{
|
||||
NameTwinAddersMale = ExtractRankName<GCRankGridaniaMaleText>(dataManager, x.RowId, r => r.Singular),
|
||||
@ -53,7 +55,7 @@ internal sealed class GameFunctions : IDisposable
|
||||
ExtractRankName<GCRankUldahFemaleText>(dataManager, x.RowId, r => r.Singular),
|
||||
MaxSeals = x.MaxSeals,
|
||||
RequiredSeals = x.RequiredSeals,
|
||||
RequiredHuntingLog = x.Unknown10,
|
||||
RequiredHuntingLog = x.Unknown0,
|
||||
})
|
||||
.AsReadOnly();
|
||||
|
||||
@ -61,14 +63,14 @@ internal sealed class GameFunctions : IDisposable
|
||||
_clientState.TerritoryChanged += TerritoryChanged;
|
||||
}
|
||||
|
||||
private static string ExtractRankName<T>(IDataManager dataManager, uint rankId, Func<T, Lumina.Text.SeString> func)
|
||||
where T : ExcelRow
|
||||
private static string ExtractRankName<T>(IDataManager dataManager, uint rankId, Func<T, ReadOnlySeString> func)
|
||||
where T : struct, IExcelRow<T>
|
||||
{
|
||||
return func(dataManager.GetExcelSheet<T>()!.GetRow(rankId)!).ToString();
|
||||
return func(dataManager.GetExcelSheet<T>().GetRow(rankId)).ToString();
|
||||
}
|
||||
|
||||
|
||||
private void Logout()
|
||||
private void Logout(int type, int code)
|
||||
{
|
||||
_retainerItemCache.Clear();
|
||||
}
|
||||
|
@ -103,66 +103,66 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
||||
_configuration.ItemsAvailableToPurchase.Count == 1 && purchaseOption.ItemId == ItemIds.Venture);
|
||||
|
||||
var item = _itemLookup[purchaseOption.ItemId];
|
||||
var icon = _iconCache.GetIcon(item.IconId);
|
||||
Vector2 pos = ImGui.GetCursorPos();
|
||||
Vector2 iconSize = new Vector2(ImGui.GetTextLineHeight() + ImGui.GetStyle().ItemSpacing.Y);
|
||||
|
||||
icon.TryGetWrap(out IDalamudTextureWrap? wrap, out _);
|
||||
if (wrap != null)
|
||||
using (var icon = _iconCache.GetIcon(item.IconId))
|
||||
{
|
||||
ImGui.SetCursorPos(pos + new Vector2(iconSize.X + ImGui.GetStyle().FramePadding.X,
|
||||
ImGui.GetStyle().ItemSpacing.Y / 2));
|
||||
}
|
||||
Vector2 pos = ImGui.GetCursorPos();
|
||||
Vector2 iconSize = new Vector2(ImGui.GetTextLineHeight() + ImGui.GetStyle().ItemSpacing.Y);
|
||||
|
||||
ImGui.Selectable($"{item.Name}{(item.Limited ? $" {SeIconChar.Hyadelyn.ToIconString()}" : "")}{(purchaseOption.SameQuantityForAllLists ? $" {((SeIconChar)57412).ToIconString()} (Limit: {purchaseOption.GlobalLimit:N0})" : "")}",
|
||||
false, ImGuiSelectableFlags.SpanAllColumns);
|
||||
|
||||
if (ImGui.BeginDragDropSource())
|
||||
{
|
||||
ImGui.SetDragDropPayload("DeliverooDragDrop", nint.Zero, 0);
|
||||
_dragDropSource = purchaseOption;
|
||||
|
||||
ImGui.EndDragDropSource();
|
||||
}
|
||||
|
||||
if (ImGui.BeginDragDropTarget())
|
||||
{
|
||||
if (_dragDropSource != null &&
|
||||
ImGui.AcceptDragDropPayload("DeliverooDragDrop").NativePtr != null)
|
||||
if (icon != null)
|
||||
{
|
||||
itemToAdd = _dragDropSource;
|
||||
indexToAdd = i;
|
||||
|
||||
_dragDropSource = null;
|
||||
ImGui.SetCursorPos(pos + new Vector2(iconSize.X + ImGui.GetStyle().FramePadding.X,
|
||||
ImGui.GetStyle().ItemSpacing.Y / 2));
|
||||
}
|
||||
|
||||
ImGui.EndDragDropTarget();
|
||||
}
|
||||
ImGui.Selectable(
|
||||
$"{item.Name}{(item.Limited ? $" {SeIconChar.Hyadelyn.ToIconString()}" : "")}{(purchaseOption.SameQuantityForAllLists ? $" {((SeIconChar)57412).ToIconString()} (Limit: {purchaseOption.GlobalLimit:N0})" : "")}",
|
||||
false, ImGuiSelectableFlags.SpanAllColumns);
|
||||
|
||||
ImGui.OpenPopupOnItemClick($"###ctx{i}", ImGuiPopupFlags.MouseButtonRight);
|
||||
if (ImGui.BeginPopup($"###ctx{i}"))
|
||||
{
|
||||
bool sameQuantityForAllLists = purchaseOption.SameQuantityForAllLists;
|
||||
if (ImGui.MenuItem("Use same quantity for global and character-specific lists", null,
|
||||
ref sameQuantityForAllLists))
|
||||
if (ImGui.BeginDragDropSource())
|
||||
{
|
||||
purchaseOption.SameQuantityForAllLists = sameQuantityForAllLists;
|
||||
Save();
|
||||
ImGui.SetDragDropPayload("DeliverooDragDrop", nint.Zero, 0);
|
||||
_dragDropSource = purchaseOption;
|
||||
|
||||
ImGui.EndDragDropSource();
|
||||
}
|
||||
|
||||
if (ImGui.MenuItem($"Remove {_itemLookup[purchaseOption.ItemId].Name}"))
|
||||
itemToRemove = purchaseOption;
|
||||
if (ImGui.BeginDragDropTarget())
|
||||
{
|
||||
if (_dragDropSource != null &&
|
||||
ImGui.AcceptDragDropPayload("DeliverooDragDrop").NativePtr != null)
|
||||
{
|
||||
itemToAdd = _dragDropSource;
|
||||
indexToAdd = i;
|
||||
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
_dragDropSource = null;
|
||||
}
|
||||
|
||||
if (wrap != null)
|
||||
{
|
||||
ImGui.SameLine(0, 0);
|
||||
ImGui.SetCursorPos(pos);
|
||||
ImGui.Image(wrap.ImGuiHandle, iconSize);
|
||||
ImGui.EndDragDropTarget();
|
||||
}
|
||||
|
||||
wrap.Dispose();
|
||||
ImGui.OpenPopupOnItemClick($"###ctx{i}", ImGuiPopupFlags.MouseButtonRight);
|
||||
if (ImGui.BeginPopup($"###ctx{i}"))
|
||||
{
|
||||
bool sameQuantityForAllLists = purchaseOption.SameQuantityForAllLists;
|
||||
if (ImGui.MenuItem("Use same quantity for global and character-specific lists", null,
|
||||
ref sameQuantityForAllLists))
|
||||
{
|
||||
purchaseOption.SameQuantityForAllLists = sameQuantityForAllLists;
|
||||
Save();
|
||||
}
|
||||
|
||||
if (ImGui.MenuItem($"Remove {_itemLookup[purchaseOption.ItemId].Name}"))
|
||||
itemToRemove = purchaseOption;
|
||||
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
|
||||
if (icon != null)
|
||||
{
|
||||
ImGui.SameLine(0, 0);
|
||||
ImGui.SetCursorPos(pos);
|
||||
ImGui.Image(icon.ImGuiHandle, iconSize);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndDisabled();
|
||||
@ -202,14 +202,14 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
||||
foreach (var item in comboValues.Where(x =>
|
||||
x.Name.Contains(_searchString, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var icon = _iconCache.GetIcon(item.IconId);
|
||||
if (icon.TryGetWrap(out IDalamudTextureWrap? wrap, out _))
|
||||
using (var icon = _iconCache.GetIcon(item.IconId))
|
||||
{
|
||||
ImGui.Image(wrap.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.X);
|
||||
|
||||
wrap.Dispose();
|
||||
if (icon != null)
|
||||
{
|
||||
ImGui.Image(icon.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.X);
|
||||
}
|
||||
}
|
||||
|
||||
bool addThis =
|
||||
@ -217,7 +217,8 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
||||
$"{item.Name}{(item.Limited ? $" {SeIconChar.Hyadelyn.ToIconString()}" : "")}##SelectVenture{item.IconId}");
|
||||
if (addThis || addFirst)
|
||||
{
|
||||
_configuration.ItemsAvailableToPurchase.Add(new Configuration.PurchaseOption { ItemId = item.ItemId });
|
||||
_configuration.ItemsAvailableToPurchase.Add(new Configuration.PurchaseOption
|
||||
{ ItemId = item.ItemId });
|
||||
|
||||
if (addFirst)
|
||||
{
|
||||
@ -243,7 +244,7 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
||||
if (_clientState is { IsLoggedIn: true, LocalContentId: > 0 })
|
||||
{
|
||||
string currentCharacterName = _clientState.LocalPlayer!.Name.ToString();
|
||||
string currentWorldName = _clientState.LocalPlayer.HomeWorld.GameData!.Name.ToString();
|
||||
string currentWorldName = _clientState.LocalPlayer.HomeWorld.Value.Name.ToString();
|
||||
ImGui.Text($"Current Character: {currentCharacterName} @ {currentWorldName}");
|
||||
ImGui.Spacing();
|
||||
ImGui.Separator();
|
||||
|
@ -10,6 +10,7 @@ using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Deliveroo.GameData;
|
||||
@ -21,7 +22,7 @@ using LLib.ImGui;
|
||||
|
||||
namespace Deliveroo.Windows;
|
||||
|
||||
internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig<Configuration.MinimizableWindowConfig>
|
||||
{
|
||||
private static readonly IReadOnlyList<InventoryType> InventoryTypes = new[]
|
||||
{
|
||||
@ -55,6 +56,7 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
private readonly IconCache _iconCache;
|
||||
private readonly IKeyState _keyState;
|
||||
private readonly GameFunctions _gameFunctions;
|
||||
private readonly TitleBarButton _minimizeButton;
|
||||
|
||||
private bool _state;
|
||||
private Guid? _draggedItem;
|
||||
@ -88,6 +90,20 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
ShowCloseButton = false;
|
||||
AllowClickthrough = false;
|
||||
|
||||
_minimizeButton = new TitleBarButton
|
||||
{
|
||||
Icon = FontAwesomeIcon.Minus,
|
||||
Priority = int.MinValue,
|
||||
IconOffset = new Vector2(1.5f, 1),
|
||||
Click = _ =>
|
||||
{
|
||||
IsMinimized = !IsMinimized;
|
||||
_minimizeButton!.Icon = IsMinimized ? FontAwesomeIcon.WindowMaximize : FontAwesomeIcon.Minus;
|
||||
},
|
||||
AvailableClickthrough = true,
|
||||
};
|
||||
TitleBarButtons.Insert(0, _minimizeButton);
|
||||
|
||||
TitleBarButtons.Add(new TitleBarButton
|
||||
{
|
||||
Icon = FontAwesomeIcon.Cog,
|
||||
@ -103,7 +119,17 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
});
|
||||
}
|
||||
|
||||
public WindowConfig WindowConfig => _configuration.TurnInWindowConfig;
|
||||
public Configuration.MinimizableWindowConfig WindowConfig => _configuration.TurnInWindowConfig;
|
||||
|
||||
private bool IsMinimized
|
||||
{
|
||||
get => WindowConfig.IsMinimized;
|
||||
set
|
||||
{
|
||||
WindowConfig.IsMinimized = value;
|
||||
SaveWindowConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public bool State
|
||||
{
|
||||
@ -126,7 +152,7 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
|
||||
private bool IsOnHomeWorld =>
|
||||
_clientState.LocalPlayer == null ||
|
||||
_clientState.LocalPlayer.HomeWorld.Id == _clientState.LocalPlayer.CurrentWorld.Id;
|
||||
_clientState.LocalPlayer.HomeWorld.RowId == _clientState.LocalPlayer.CurrentWorld.RowId;
|
||||
|
||||
private IItemsToPurchase ItemsWrapper => UseCharacterSpecificItemsToPurchase
|
||||
? new CharacterSpecificItemsToPurchase(_plugin.CharacterConfiguration!, _pluginInterface)
|
||||
@ -218,56 +244,59 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
}
|
||||
|
||||
float indentSize = ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X;
|
||||
ImGui.Indent(indentSize);
|
||||
if (!string.IsNullOrEmpty(Error))
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, Error);
|
||||
using (ImRaii.PushIndent(indentSize))
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_configuration.BehaviorOnOtherWorld == Configuration.EBehaviorOnOtherWorld.Warning && !IsOnHomeWorld)
|
||||
using (ImRaii.PushIndent(indentSize))
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed,
|
||||
"You are not on your home world and will not earn FC points.");
|
||||
}
|
||||
|
||||
if (Multiplier == 1m)
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudYellow, "You do not have an active seal buff.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.HealerGreen, $"Current Buff: {(Multiplier - 1m) * 100:N0}%%");
|
||||
}
|
||||
|
||||
if (Multiplier <= 1.10m)
|
||||
{
|
||||
InventoryManager* inventoryManager = InventoryManager.Instance();
|
||||
AgentInventoryContext* agentInventoryContext = AgentInventoryContext.Instance();
|
||||
if (inventoryManager->GetInventoryItemCount(ItemIds.PrioritySealAllowance) > 0)
|
||||
if (_configuration.BehaviorOnOtherWorld == Configuration.EBehaviorOnOtherWorld.Warning &&
|
||||
!IsOnHomeWorld)
|
||||
{
|
||||
ImGui.BeginDisabled(_condition[ConditionFlag.OccupiedInQuestEvent] ||
|
||||
_condition[ConditionFlag.Casting] ||
|
||||
agentInventoryContext == null);
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Bolt, "Use Priority Seal Allowance (15%)"))
|
||||
{
|
||||
agentInventoryContext->UseItem(ItemIds.PrioritySealAllowance);
|
||||
}
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed,
|
||||
"You are not on your home world and will not earn FC points.");
|
||||
}
|
||||
|
||||
ImGui.EndDisabled();
|
||||
if (Multiplier == 1m)
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudYellow, "You do not have an active seal buff.");
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.HealerGreen, $"Current Buff: {(Multiplier - 1m) * 100:N0}%%");
|
||||
}
|
||||
|
||||
if (Multiplier <= 1.10m)
|
||||
{
|
||||
InventoryManager* inventoryManager = InventoryManager.Instance();
|
||||
AgentInventoryContext* agentInventoryContext = AgentInventoryContext.Instance();
|
||||
if (inventoryManager->GetInventoryItemCount(ItemIds.PrioritySealAllowance) > 0)
|
||||
{
|
||||
ImGui.BeginDisabled(_condition[ConditionFlag.OccupiedInQuestEvent] ||
|
||||
_condition[ConditionFlag.Casting] ||
|
||||
agentInventoryContext == null);
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Bolt,
|
||||
"Use Priority Seal Allowance (15%)"))
|
||||
{
|
||||
agentInventoryContext->UseItem(ItemIds.PrioritySealAllowance);
|
||||
}
|
||||
|
||||
ImGui.EndDisabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Unindent(indentSize);
|
||||
ImGui.Separator();
|
||||
ImGui.BeginDisabled(state);
|
||||
|
||||
DrawItemsToBuy(grandCompany);
|
||||
|
||||
ImGui.EndDisabled();
|
||||
if (!IsMinimized)
|
||||
{
|
||||
ImGui.Separator();
|
||||
using (ImRaii.Disabled(state))
|
||||
DrawItemsToBuy(grandCompany);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
if (_configuration.QuickTurnInKey != VirtualKey.NO_KEY)
|
||||
{
|
||||
var key = _configuration.QuickTurnInKey switch
|
||||
@ -278,14 +307,22 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
_ => _configuration.QuickTurnInKey.ToString()
|
||||
};
|
||||
if (!State && _keyState[_configuration.QuickTurnInKey])
|
||||
{
|
||||
ImGui.Separator();
|
||||
ImGui.TextColored(ImGuiColors.HealerGreen, "Click an item to turn it in without confirmation");
|
||||
else
|
||||
}
|
||||
else if (!IsMinimized)
|
||||
{
|
||||
ImGui.Separator();
|
||||
ImGui.Text($"Hold '{key}' when clicking an item to turn it in without confirmation.");
|
||||
|
||||
ImGui.Separator();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Text($"Debug (State): {_plugin.CurrentStage}");
|
||||
if (!IsMinimized)
|
||||
{
|
||||
ImGui.Separator();
|
||||
ImGui.Text($"Debug (State): {_plugin.CurrentStage}");
|
||||
}
|
||||
}
|
||||
|
||||
private unsafe void DrawNextRankPrequesites()
|
||||
@ -416,7 +453,7 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
itemsWrapper.Save();
|
||||
}
|
||||
|
||||
if (_configuration.ItemsToPurchase.Any(x =>
|
||||
if (_configuration.ItemsAvailableToPurchase.Any(x =>
|
||||
itemsWrapper.GetItemsToPurchase().All(y => x.ItemId != y.ItemId)))
|
||||
{
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, "Add Item"))
|
||||
@ -430,7 +467,8 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
{
|
||||
if (ImGui.MenuItem($"{reward.Name}##{purchaseOption.ItemId}"))
|
||||
{
|
||||
itemsWrapper.Add(new Configuration.PurchasePriority { ItemId = purchaseOption.ItemId, Limit = 0 });
|
||||
itemsWrapper.Add(new Configuration.PurchasePriority
|
||||
{ ItemId = purchaseOption.ItemId, Limit = 0 });
|
||||
itemsWrapper.Save();
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
@ -441,9 +479,10 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Cog, "Configure available Items"))
|
||||
_configWindow.IsOpen = true;
|
||||
}
|
||||
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Cog, "Configure available Items"))
|
||||
_configWindow.IsOpen = true;
|
||||
}
|
||||
|
||||
private void DrawItemToBuy(GrandCompany grandCompany, int i, IItemsToPurchase itemsWrapper,
|
||||
@ -514,13 +553,13 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
}
|
||||
|
||||
var comboItem = comboValues[comboValueIndex];
|
||||
var icon = _iconCache.GetIcon(comboItem.Item.IconId);
|
||||
if (icon.TryGetWrap(out IDalamudTextureWrap? wrap, out _))
|
||||
using (var icon = _iconCache.GetIcon(comboItem.Item.IconId))
|
||||
{
|
||||
ImGui.Image(wrap.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
|
||||
ImGui.SameLine(0, 3);
|
||||
|
||||
wrap.Dispose();
|
||||
if (icon != null)
|
||||
{
|
||||
ImGui.Image(icon.ImGuiHandle, new Vector2(ImGui.GetFrameHeight()));
|
||||
ImGui.SameLine(0, 3);
|
||||
}
|
||||
}
|
||||
|
||||
indentX = ImGui.GetCursorPosX() - indentX;
|
||||
@ -601,7 +640,7 @@ internal sealed class TurnInWindow : LWindow, IPersistableWindowConfig
|
||||
: "Remaining items to buy";
|
||||
if (ImGui.InputInt(label, ref limit, stepSize, stepSize * 10))
|
||||
{
|
||||
int newLimit = Math.Min(Math.Max(0, limit), (int)comboItem.Item.InventoryLimit);
|
||||
int newLimit = Math.Min(Math.Max(0, limit), (int)comboItem.Item.InventoryLimit);
|
||||
if (purchaseOption != null)
|
||||
{
|
||||
purchaseOption.GlobalLimit = newLimit;
|
||||
|
@ -4,9 +4,9 @@
|
||||
"net8.0-windows7.0": {
|
||||
"DalamudPackager": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.1.13, )",
|
||||
"resolved": "2.1.13",
|
||||
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
|
||||
"requested": "[11.0.0, )",
|
||||
"resolved": "11.0.0",
|
||||
"contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA=="
|
||||
},
|
||||
"DotNet.ReproducibleBuilds": {
|
||||
"type": "Direct",
|
||||
@ -79,7 +79,7 @@
|
||||
"llib": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"DalamudPackager": "[2.1.13, )"
|
||||
"DalamudPackager": "[11.0.0, )"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
LLib
2
LLib
@ -1 +1 @@
|
||||
Subproject commit 7027d291efbbff6a55944dd521d3907210ddecbe
|
||||
Subproject commit b581e2ea2a61f44ed3f0cb4f6ea8cc1595525544
|
Loading…
Reference in New Issue
Block a user