Update header icon logic for Dalamud changes

This commit is contained in:
Liza 2023-11-09 11:46:26 +01:00
parent 1021220064
commit 0c3d7c74ea
Signed by: liza
GPG Key ID: 7199F8D727D55F67
8 changed files with 12 additions and 23 deletions

2
LLib

@ -1 +1 @@
Subproject commit 7f83ece6a0c07d0fbc1902502050563b5a8c09e4 Subproject commit 865a6080319f8ccbcd5fd5b0004404822b6e60d4

View File

@ -2,7 +2,6 @@
using System.Linq; using System.Linq;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Components; using Dalamud.Interface.Components;
using Dalamud.Plugin;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
@ -19,7 +18,6 @@ internal sealed class CeruleumTankWindow : ShopWindow
private const int CeruleumTankItemId = 10155; private const int CeruleumTankItemId = 10155;
private readonly WorkshopPlugin _plugin; private readonly WorkshopPlugin _plugin;
private readonly DalamudPluginInterface _pluginInterface;
private readonly IPluginLog _pluginLog; private readonly IPluginLog _pluginLog;
private readonly Configuration _configuration; private readonly Configuration _configuration;
@ -27,13 +25,12 @@ internal sealed class CeruleumTankWindow : ShopWindow
private int _buyStackCount; private int _buyStackCount;
private bool _buyPartialStacks = true; private bool _buyPartialStacks = true;
public CeruleumTankWindow(WorkshopPlugin plugin, DalamudPluginInterface pluginInterface, IPluginLog pluginLog, public CeruleumTankWindow(WorkshopPlugin plugin, IPluginLog pluginLog,
IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration, IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration,
ExternalPluginHandler externalPluginHandler) ExternalPluginHandler externalPluginHandler)
: base("Ceruleum Tanks###WorkshoppaCeruleumTankWindow", "FreeCompanyCreditShop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler) : base("Ceruleum Tanks###WorkshoppaCeruleumTankWindow", "FreeCompanyCreditShop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler)
{ {
_plugin = plugin; _plugin = plugin;
_pluginInterface = pluginInterface;
_pluginLog = pluginLog; _pluginLog = pluginLog;
_configuration = configuration; _configuration = configuration;
} }
@ -84,8 +81,6 @@ internal sealed class CeruleumTankWindow : ShopWindow
int ceruleumTanks = GetItemCount(CeruleumTankItemId); int ceruleumTanks = GetItemCount(CeruleumTankItemId);
int freeInventorySlots = _plugin.GetFreeInventorySlots(); int freeInventorySlots = _plugin.GetFreeInventorySlots();
LImGui.AddPatreonIcon(_pluginInterface);
ImGui.Text("Inventory"); ImGui.Text("Inventory");
ImGui.Indent(); ImGui.Indent();
ImGui.Text($"Ceruleum Tanks: {FormatStackCount(ceruleumTanks)}"); ImGui.Text($"Ceruleum Tanks: {FormatStackCount(ceruleumTanks)}");

View File

@ -2,10 +2,11 @@
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using Dalamud.Plugin; using Dalamud.Plugin;
using ImGuiNET; using ImGuiNET;
using LLib;
namespace Workshoppa.Windows; namespace Workshoppa.Windows;
internal sealed class ConfigWindow : Window internal sealed class ConfigWindow : LImGui.LWindow
{ {
private readonly DalamudPluginInterface _pluginInterface; private readonly DalamudPluginInterface _pluginInterface;
private readonly Configuration _configuration; private readonly Configuration _configuration;

View File

@ -17,7 +17,7 @@ using Workshoppa.GameData;
namespace Workshoppa.Windows; namespace Workshoppa.Windows;
// FIXME The close button doesn't work near the workshop, either hide it or make it work // 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 WorkshopPlugin _plugin;
private readonly DalamudPluginInterface _pluginInterface; private readonly DalamudPluginInterface _pluginInterface;
@ -50,6 +50,7 @@ internal sealed class MainWindow : Window
}; };
Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse;
AllowClickthrough = false;
} }
public EOpenReason OpenReason { get; set; } = EOpenReason.None; public EOpenReason OpenReason { get; set; } = EOpenReason.None;
@ -61,8 +62,6 @@ internal sealed class MainWindow : Window
public override void Draw() public override void Draw()
{ {
LImGui.AddPatreonIcon(_pluginInterface);
var currentItem = _configuration.CurrentlyCraftedItem; var currentItem = _configuration.CurrentlyCraftedItem;
if (currentItem != null) if (currentItem != null)
{ {

View File

@ -4,11 +4,9 @@ using Dalamud.Game.Text;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Colors; using Dalamud.Interface.Colors;
using Dalamud.Interface.Components; using Dalamud.Interface.Components;
using Dalamud.Plugin;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
using LLib;
using LLib.GameUI; using LLib.GameUI;
using Workshoppa.External; using Workshoppa.External;
using Workshoppa.GameData.Shops; using Workshoppa.GameData.Shops;
@ -20,16 +18,14 @@ internal sealed class RepairKitWindow : ShopWindow
{ {
private const int DarkMatterCluster6ItemId = 10386; private const int DarkMatterCluster6ItemId = 10386;
private readonly DalamudPluginInterface _pluginInterface;
private readonly IPluginLog _pluginLog; private readonly IPluginLog _pluginLog;
private readonly Configuration _configuration; private readonly Configuration _configuration;
public RepairKitWindow(WorkshopPlugin plugin, DalamudPluginInterface pluginInterface, IPluginLog pluginLog, public RepairKitWindow(WorkshopPlugin plugin, IPluginLog pluginLog,
IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration, IGameGui gameGui, IAddonLifecycle addonLifecycle, Configuration configuration,
ExternalPluginHandler externalPluginHandler) ExternalPluginHandler externalPluginHandler)
: base("Repair Kits###WorkshoppaRepairKitWindow", "Shop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler) : base("Repair Kits###WorkshoppaRepairKitWindow", "Shop", plugin, pluginLog, gameGui, addonLifecycle, externalPluginHandler)
{ {
_pluginInterface = pluginInterface;
_pluginLog = pluginLog; _pluginLog = pluginLog;
_configuration = configuration; _configuration = configuration;
} }
@ -92,8 +88,6 @@ internal sealed class RepairKitWindow : ShopWindow
return; return;
} }
LImGui.AddPatreonIcon(_pluginInterface);
ImGui.Text("Inventory"); ImGui.Text("Inventory");
ImGui.Indent(); ImGui.Indent();
ImGui.Text($"Dark Matter Clusters: {darkMatterClusters:N0}"); ImGui.Text($"Dark Matter Clusters: {darkMatterClusters:N0}");

View File

@ -2,18 +2,18 @@
using System.Numerics; using System.Numerics;
using Dalamud.Game.Addon.Lifecycle; using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
using LLib;
using LLib.GameUI; using LLib.GameUI;
using Workshoppa.External; using Workshoppa.External;
using Workshoppa.GameData.Shops; using Workshoppa.GameData.Shops;
namespace Workshoppa.Windows; namespace Workshoppa.Windows;
internal abstract class ShopWindow : Window, IDisposable internal abstract class ShopWindow : LImGui.LWindow, IDisposable
{ {
private readonly string _addonName; private readonly string _addonName;
private readonly WorkshopPlugin _plugin; private readonly WorkshopPlugin _plugin;

View File

@ -75,10 +75,10 @@ public sealed partial class WorkshopPlugin : IDalamudPlugin
_windowSystem.AddWindow(_mainWindow); _windowSystem.AddWindow(_mainWindow);
_configWindow = new(_pluginInterface, _configuration); _configWindow = new(_pluginInterface, _configuration);
_windowSystem.AddWindow(_configWindow); _windowSystem.AddWindow(_configWindow);
_repairKitWindow = new(this, _pluginInterface, _pluginLog, _gameGui, addonLifecycle, _configuration, _repairKitWindow = new(this, _pluginLog, _gameGui, addonLifecycle, _configuration,
_externalPluginHandler); _externalPluginHandler);
_windowSystem.AddWindow(_repairKitWindow); _windowSystem.AddWindow(_repairKitWindow);
_ceruleumTankWindow = new(this, _pluginInterface, _pluginLog, _gameGui, addonLifecycle, _configuration, _ceruleumTankWindow = new(this, _pluginLog, _gameGui, addonLifecycle, _configuration,
_externalPluginHandler); _externalPluginHandler);
_windowSystem.AddWindow(_ceruleumTankWindow); _windowSystem.AddWindow(_ceruleumTankWindow);

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net7.0-windows</TargetFramework>
<Version>3.5</Version> <Version>3.6</Version>
<LangVersion>11.0</LangVersion> <LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>