Fix KTK, set up Lifecycles

This commit is contained in:
Zeffuro
2025-12-28 09:14:20 +01:00
parent 9b7e99276e
commit 75f278c945
5 changed files with 231 additions and 200 deletions
@@ -0,0 +1,25 @@
using System;
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
namespace AetherBags.AddonLifecycles;
public class InventoryLifecycles : IDisposable
{
public InventoryLifecycles()
{
Services.AddonLifecycle.RegisterListener(AddonEvent.PreOpen, ["Inventory", "InventoryLarge", "InventoryExpansion"], HandleInventorySetup);
Services.Logger.Verbose("InventoryLifecycles initialized");
}
private void HandleInventorySetup(AddonEvent type, AddonArgs args)
{
Services.Logger.Debug("HandleInventorySetup called");
}
public void Dispose()
{
Services.AddonLifecycle.UnregisterListener(AddonEvent.PreOpen, ["Inventory", "InventoryLarge", "InventoryExpansion"]);
}
}
+2
View File
@@ -1,6 +1,8 @@
using System;
using Dalamud.Hooking;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
namespace AetherBags.Hooks;
+1 -1
View File
@@ -17,7 +17,7 @@
// FIX: Manually expose the pointers that are 'internal' in KamiToolKit
// We access the raw AtkComponentNode* via 'this.ResNode' and cast from there.
private new AtkComponentDragDrop* Component => (AtkComponentDragDrop*)this.InternalComponentNode->Component;
private new AtkComponentDragDrop* Component => (AtkComponentDragDrop*)Node->Component;
private new AtkUldComponentDataDragDrop* Data => (AtkUldComponentDataDragDrop*)Component->UldManager.ComponentData;
public readonly ImageNode DragDropBackgroundNode;
+4
View File
@@ -1,5 +1,6 @@
using System;
using System.Numerics;
using AetherBags.AddonLifecycles;
using AetherBags.Addons;
using AetherBags.Helpers;
using AetherBags.Hooks;
@@ -16,6 +17,7 @@ public unsafe class Plugin : IDalamudPlugin
private static string HelpDescription => "Opens your inventory.";
private readonly InventoryHooks _inventoryHooks;
private readonly InventoryLifecycles _inventoryLifecycles;
public Plugin(IDalamudPluginInterface pluginInterface)
{
@@ -64,6 +66,7 @@ public unsafe class Plugin : IDalamudPlugin
}
_inventoryHooks = new InventoryHooks();
_inventoryLifecycles = new InventoryLifecycles();
}
public void Dispose()
@@ -82,6 +85,7 @@ public unsafe class Plugin : IDalamudPlugin
KamiToolKitLibrary.Dispose();
_inventoryHooks.Dispose();
_inventoryLifecycles.Dispose();
}
private void OnCommand(string command, string args)