WIP pinning and hoisting

This commit is contained in:
Shawrkie Williams
2025-12-29 15:36:06 -05:00
parent 17a67b8c12
commit 47d5aa3bd6
31 changed files with 682 additions and 157 deletions
@@ -1,12 +1,10 @@
using System;
using System.Numerics;
using AetherBags.Extensions;
using AetherBags.Helpers;
using AetherBags.Inventory;
using AetherBags.Nodes.Layout;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Component.GUI;
using KamiToolKit.Classes;
using KamiToolKit.Nodes;
@@ -107,6 +105,8 @@ public class InventoryCategoryNode : SimpleComponentNode
}
}
public bool IsPinnedInConfig => CategorizedInventory.Category?.IsPinned ?? false;
public void BeginHeaderHover()
{
_hoverRefs++;
@@ -0,0 +1,45 @@
using AetherBags.Nodes.Layout;
namespace AetherBags.Nodes.Inventory;
public sealed class InventoryCategoryPinCoordinator
{
public bool ApplyPinnedStates(WrappingGridNode<InventoryCategoryNode> grid)
{
bool changed = false;
using (grid.DeferRecalculateLayout())
{
foreach (var node in grid.GetNodes<InventoryCategoryNode>())
{
bool shouldBePinned = node.IsPinnedInConfig;
bool isPinned = grid.IsPinned(node);
if (shouldBePinned)
{
if (!isPinned)
{
grid.PinNode(node);
changed = true;
}
}
else
{
if (isPinned)
{
grid.UnpinNode(node);
changed = true;
}
}
}
}
return changed;
}
public bool PrunePinnedNotInGrid(WrappingGridNode<InventoryCategoryNode> grid)
{
return false;
}
}