diff --git a/Deliveroo/Deliveroo.csproj b/Deliveroo/Deliveroo.csproj index c66aaab..c9dccd3 100644 --- a/Deliveroo/Deliveroo.csproj +++ b/Deliveroo/Deliveroo.csproj @@ -1,7 +1,7 @@ net7.0-windows - 2.7 + 2.8 11.0 enable true diff --git a/Deliveroo/DeliverooPlugin.cs b/Deliveroo/DeliverooPlugin.cs index 8fb96bf..9ee4ffe 100644 --- a/Deliveroo/DeliverooPlugin.cs +++ b/Deliveroo/DeliverooPlugin.cs @@ -77,7 +77,7 @@ public sealed partial class DeliverooPlugin : IDalamudPlugin _gcRewardsCache = new GcRewardsCache(dataManager); _configWindow = new ConfigWindow(_pluginInterface, this, _configuration, _gcRewardsCache, _clientState, _pluginLog); _windowSystem.AddWindow(_configWindow); - _turnInWindow = new TurnInWindow(this, _pluginInterface, _configuration, _gcRewardsCache, _configWindow); + _turnInWindow = new TurnInWindow(this, _pluginInterface, _configuration, _condition, _gcRewardsCache, _configWindow); _windowSystem.AddWindow(_turnInWindow); _sealCaps = dataManager.GetExcelSheet()!.Where(x => x.RowId > 0) .ToDictionary(x => x.RowId, x => x.MaxSeals); diff --git a/Deliveroo/GameData/ItemIds.cs b/Deliveroo/GameData/ItemIds.cs index 6230251..d90d13c 100644 --- a/Deliveroo/GameData/ItemIds.cs +++ b/Deliveroo/GameData/ItemIds.cs @@ -2,5 +2,6 @@ public static class ItemIds { + public const uint PrioritySealAllowance = 14946; public const uint Venture = 21072; } diff --git a/Deliveroo/Windows/ConfigWindow.cs b/Deliveroo/Windows/ConfigWindow.cs index 022afc8..86a662a 100644 --- a/Deliveroo/Windows/ConfigWindow.cs +++ b/Deliveroo/Windows/ConfigWindow.cs @@ -9,7 +9,6 @@ using Dalamud.Interface.Windowing; using Dalamud.Plugin; using Dalamud.Plugin.Services; using Deliveroo.GameData; -using FFXIVClientStructs.FFXIV.Client.UI.Agent; using ImGuiNET; using LLib; diff --git a/Deliveroo/Windows/TurnInWindow.cs b/Deliveroo/Windows/TurnInWindow.cs index 5fcee10..3aa898a 100644 --- a/Deliveroo/Windows/TurnInWindow.cs +++ b/Deliveroo/Windows/TurnInWindow.cs @@ -2,12 +2,14 @@ using System.Collections.Generic; using System.Linq; using System.Numerics; +using Dalamud.Game.ClientState.Conditions; using Dalamud.Interface; using Dalamud.Interface.Colors; using Dalamud.Interface.Components; using Dalamud.Interface.Utility; using Dalamud.Interface.Windowing; using Dalamud.Plugin; +using Dalamud.Plugin.Services; using Deliveroo.GameData; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.UI.Agent; @@ -21,16 +23,18 @@ internal sealed class TurnInWindow : Window private readonly DeliverooPlugin _plugin; private readonly DalamudPluginInterface _pluginInterface; private readonly Configuration _configuration; + private readonly ICondition _condition; private readonly GcRewardsCache _gcRewardsCache; private readonly ConfigWindow _configWindow; public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration, - GcRewardsCache gcRewardsCache, ConfigWindow configWindow) + ICondition condition, GcRewardsCache gcRewardsCache, ConfigWindow configWindow) : base("GC Delivery###DeliverooTurnIn") { _plugin = plugin; _pluginInterface = pluginInterface; _configuration = configuration; + _condition = condition; _gcRewardsCache = gcRewardsCache; _configWindow = configWindow; @@ -89,7 +93,7 @@ internal sealed class TurnInWindow : Window } } - public override void Draw() + public override unsafe void Draw() { LImGui.AddPatreonIcon(_pluginInterface); @@ -134,6 +138,20 @@ internal sealed class TurnInWindow : Window ImGui.TextColored(ImGuiColors.HealerGreen, $"Current Buff: {(Multiplier - 1m) * 100:N0}%%"); } + if (Multiplier <= 1.10m) + { + InventoryManager* inventoryManager = InventoryManager.Instance(); + if (inventoryManager->GetInventoryItemCount(ItemIds.PrioritySealAllowance) > 0) + { + ImGui.BeginDisabled(_condition[ConditionFlag.OccupiedInQuestEvent] || _condition[ConditionFlag.Casting]); + if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Bolt, "Use Priority Seal Allowance (15%)")) + { + AgentInventoryContext.Instance()->UseItem(ItemIds.PrioritySealAllowance); + } + ImGui.EndDisabled(); + } + } + ImGui.Unindent(27); ImGui.Separator(); ImGui.BeginDisabled(state);