Files
AetherBags/KamiToolKit/Nodes/Layout/ListItemNode.cs
T
KnackAtNite 8db4ce6094
Debug Build and Test / Build against Latest Dalamud (push) Has been cancelled
Debug Build and Test / Build against Staging Dalamud (push) Has been cancelled
Initial commit: AetherBags + KamiToolKit for FC Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 14:46:31 -05:00

41 lines
1.1 KiB
C#

using KamiToolKit.Classes;
namespace KamiToolKit.Nodes;
public abstract class ListItemNode<T> : SelectableNode {
public abstract float ItemHeight { get; }
public T? ItemData {
get;
set {
if (value is not null) {
if (!GenericUtil.AreEqual(field, value)) {
IsSettingNodeData = true;
SetNodeData(value);
IsSettingNodeData = false;
}
}
field = value;
IsVisible = value is not null;
}
}
/// <summary>
/// Bool that indicates if SetNodeDate when different is being called.
/// Used to prevent things like checkboxes from trigger a file save due to the value being changed.
/// </summary>
protected bool IsSettingNodeData { get; private set; }
protected abstract void SetNodeData(T itemData);
public virtual void Update() { }
protected void DisableInteractions() {
EnableSelection = false;
EnableHighlight = false;
DisableCollisionNode = true;
}
}