From 0c3d7c74ea83124685823863abdc05f58ac9d576 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Thu, 9 Nov 2023 11:46:26 +0100 Subject: [PATCH] Update header icon logic for Dalamud changes --- LLib | 2 +- Workshoppa/Windows/CeruleumTankWindow.cs | 7 +------ Workshoppa/Windows/ConfigWindow.cs | 3 ++- Workshoppa/Windows/MainWindow.cs | 5 ++--- Workshoppa/Windows/RepairKitWindow.cs | 8 +------- Workshoppa/Windows/ShopWindow.cs | 4 ++-- Workshoppa/WorkshopPlugin.cs | 4 ++-- Workshoppa/Workshoppa.csproj | 2 +- 8 files changed, 12 insertions(+), 23 deletions(-) diff --git a/LLib b/LLib index 7f83ece..865a608 160000 --- a/LLib +++ b/LLib @@ -1 +1 @@ -Subproject commit 7f83ece6a0c07d0fbc1902502050563b5a8c09e4 +Subproject commit 865a6080319f8ccbcd5fd5b0004404822b6e60d4 diff --git a/Workshoppa/Windows/CeruleumTankWindow.cs b/Workshoppa/Windows/CeruleumTankWindow.cs index 7a48fb5..e8f2cca 100644 --- a/Workshoppa/Windows/CeruleumTankWindow.cs +++ b/Workshoppa/Windows/CeruleumTankWindow.cs @@ -2,7 +2,6 @@ using System.Linq; using Dalamud.Interface; using Dalamud.Interface.Components; -using Dalamud.Plugin; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Component.GUI; using ImGuiNET; @@ -19,7 +18,6 @@ internal sealed class CeruleumTankWindow : ShopWindow private const int CeruleumTankItemId = 10155; private readonly WorkshopPlugin _plugin; - private readonly DalamudPluginInterface _pluginInterface; private readonly IPluginLog _pluginLog; private readonly Configuration _configuration; @@ -27,13 +25,12 @@ internal sealed class CeruleumTankWindow : ShopWindow private int _buyStackCount; private bool _buyPartialStacks = true; - public CeruleumTankWindow(WorkshopPlugin plugin, DalamudPluginInterface pluginInterface, IPluginLog pluginLog, + public CeruleumTankWindow(WorkshopPlugin plugin, IPluginLog pluginLog, IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration, ExternalPluginHandler externalPluginHandler) : base("Ceruleum Tanks###WorkshoppaCeruleumTankWindow", "FreeCompanyCreditShop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler) { _plugin = plugin; - _pluginInterface = pluginInterface; _pluginLog = pluginLog; _configuration = configuration; } @@ -84,8 +81,6 @@ internal sealed class CeruleumTankWindow : ShopWindow int ceruleumTanks = GetItemCount(CeruleumTankItemId); int freeInventorySlots = _plugin.GetFreeInventorySlots(); - LImGui.AddPatreonIcon(_pluginInterface); - ImGui.Text("Inventory"); ImGui.Indent(); ImGui.Text($"Ceruleum Tanks: {FormatStackCount(ceruleumTanks)}"); diff --git a/Workshoppa/Windows/ConfigWindow.cs b/Workshoppa/Windows/ConfigWindow.cs index 75a25f4..45d7b8a 100644 --- a/Workshoppa/Windows/ConfigWindow.cs +++ b/Workshoppa/Windows/ConfigWindow.cs @@ -2,10 +2,11 @@ using Dalamud.Interface.Windowing; using Dalamud.Plugin; using ImGuiNET; +using LLib; namespace Workshoppa.Windows; -internal sealed class ConfigWindow : Window +internal sealed class ConfigWindow : LImGui.LWindow { private readonly DalamudPluginInterface _pluginInterface; private readonly Configuration _configuration; diff --git a/Workshoppa/Windows/MainWindow.cs b/Workshoppa/Windows/MainWindow.cs index 47f3f62..79e53b1 100644 --- a/Workshoppa/Windows/MainWindow.cs +++ b/Workshoppa/Windows/MainWindow.cs @@ -17,7 +17,7 @@ using Workshoppa.GameData; namespace Workshoppa.Windows; // FIXME The close button doesn't work near the workshop, either hide it or make it work -internal sealed class MainWindow : Window +internal sealed class MainWindow : LImGui.LWindow { private readonly WorkshopPlugin _plugin; private readonly DalamudPluginInterface _pluginInterface; @@ -50,6 +50,7 @@ internal sealed class MainWindow : Window }; Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; + AllowClickthrough = false; } public EOpenReason OpenReason { get; set; } = EOpenReason.None; @@ -61,8 +62,6 @@ internal sealed class MainWindow : Window public override void Draw() { - LImGui.AddPatreonIcon(_pluginInterface); - var currentItem = _configuration.CurrentlyCraftedItem; if (currentItem != null) { diff --git a/Workshoppa/Windows/RepairKitWindow.cs b/Workshoppa/Windows/RepairKitWindow.cs index e87f9d2..5c7d3a2 100644 --- a/Workshoppa/Windows/RepairKitWindow.cs +++ b/Workshoppa/Windows/RepairKitWindow.cs @@ -4,11 +4,9 @@ using Dalamud.Game.Text; using Dalamud.Interface; using Dalamud.Interface.Colors; using Dalamud.Interface.Components; -using Dalamud.Plugin; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Component.GUI; using ImGuiNET; -using LLib; using LLib.GameUI; using Workshoppa.External; using Workshoppa.GameData.Shops; @@ -20,16 +18,14 @@ internal sealed class RepairKitWindow : ShopWindow { private const int DarkMatterCluster6ItemId = 10386; - private readonly DalamudPluginInterface _pluginInterface; private readonly IPluginLog _pluginLog; private readonly Configuration _configuration; - public RepairKitWindow(WorkshopPlugin plugin, DalamudPluginInterface pluginInterface, IPluginLog pluginLog, + public RepairKitWindow(WorkshopPlugin plugin, IPluginLog pluginLog, IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration, ExternalPluginHandler externalPluginHandler) : base("Repair Kits###WorkshoppaRepairKitWindow", "Shop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler) { - _pluginInterface = pluginInterface; _pluginLog = pluginLog; _configuration = configuration; } @@ -92,8 +88,6 @@ internal sealed class RepairKitWindow : ShopWindow return; } - LImGui.AddPatreonIcon(_pluginInterface); - ImGui.Text("Inventory"); ImGui.Indent(); ImGui.Text($"Dark Matter Clusters: {darkMatterClusters:N0}"); diff --git a/Workshoppa/Windows/ShopWindow.cs b/Workshoppa/Windows/ShopWindow.cs index 1382325..153fb10 100644 --- a/Workshoppa/Windows/ShopWindow.cs +++ b/Workshoppa/Windows/ShopWindow.cs @@ -2,18 +2,18 @@ using System.Numerics; using Dalamud.Game.Addon.Lifecycle; using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; -using Dalamud.Interface.Windowing; using Dalamud.Plugin.Services; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Component.GUI; using ImGuiNET; +using LLib; using LLib.GameUI; using Workshoppa.External; using Workshoppa.GameData.Shops; namespace Workshoppa.Windows; -internal abstract class ShopWindow : Window, IDisposable +internal abstract class ShopWindow : LImGui.LWindow, IDisposable { private readonly string _addonName; private readonly WorkshopPlugin _plugin; diff --git a/Workshoppa/WorkshopPlugin.cs b/Workshoppa/WorkshopPlugin.cs index 5aa7356..1c27828 100644 --- a/Workshoppa/WorkshopPlugin.cs +++ b/Workshoppa/WorkshopPlugin.cs @@ -75,10 +75,10 @@ public sealed partial class WorkshopPlugin : IDalamudPlugin _windowSystem.AddWindow(_mainWindow); _configWindow = new(_pluginInterface, _configuration); _windowSystem.AddWindow(_configWindow); - _repairKitWindow = new(this, _pluginInterface, _pluginLog, _gameGui, addonLifecycle, _configuration, + _repairKitWindow = new(this, _pluginLog, _gameGui, addonLifecycle, _configuration, _externalPluginHandler); _windowSystem.AddWindow(_repairKitWindow); - _ceruleumTankWindow = new(this, _pluginInterface, _pluginLog, _gameGui, addonLifecycle, _configuration, + _ceruleumTankWindow = new(this, _pluginLog, _gameGui, addonLifecycle, _configuration, _externalPluginHandler); _windowSystem.AddWindow(_ceruleumTankWindow); diff --git a/Workshoppa/Workshoppa.csproj b/Workshoppa/Workshoppa.csproj index 0d3e9f4..929c377 100644 --- a/Workshoppa/Workshoppa.csproj +++ b/Workshoppa/Workshoppa.csproj @@ -1,7 +1,7 @@ net7.0-windows - 3.5 + 3.6 11.0 enable true