Initial commit: AetherBags + KamiToolKit for FC Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
using System.Numerics;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using KamiToolKit.Classes;
|
||||
using KamiToolKit.Nodes;
|
||||
|
||||
namespace KamiToolKit.Premade.GenericListItemNodes;
|
||||
|
||||
public abstract class GenericListItemNode<T> : ListItemNode<T> {
|
||||
public override float ItemHeight => 48.0f;
|
||||
|
||||
protected readonly IconImageNode IconNode;
|
||||
protected readonly TextNode LabelTextNode;
|
||||
protected readonly TextNode SubLabelTextNode;
|
||||
protected readonly TextNode IdTextNode;
|
||||
|
||||
protected GenericListItemNode() {
|
||||
IconNode = new IconImageNode {
|
||||
FitTexture = true,
|
||||
IconId = 60072,
|
||||
};
|
||||
IconNode.AttachNode(this);
|
||||
|
||||
LabelTextNode = new TextNode {
|
||||
TextFlags = TextFlags.Ellipsis | TextFlags.Emboss,
|
||||
FontSize = 14,
|
||||
LineSpacing = 14,
|
||||
AlignmentType = AlignmentType.BottomLeft,
|
||||
TextColor = ColorHelper.GetColor(8),
|
||||
TextOutlineColor = ColorHelper.GetColor(7),
|
||||
};
|
||||
LabelTextNode.AttachNode(this);
|
||||
|
||||
SubLabelTextNode = new TextNode {
|
||||
TextFlags = TextFlags.Ellipsis | TextFlags.Emboss,
|
||||
FontSize = 12,
|
||||
LineSpacing = 12,
|
||||
AlignmentType = AlignmentType.TopLeft,
|
||||
TextColor = ColorHelper.GetColor(3),
|
||||
TextOutlineColor = ColorHelper.GetColor(7),
|
||||
};
|
||||
SubLabelTextNode.AttachNode(this);
|
||||
|
||||
IdTextNode = new TextNode {
|
||||
TextFlags = TextFlags.Emboss,
|
||||
FontSize = 10,
|
||||
AlignmentType = AlignmentType.BottomRight,
|
||||
TextColor = ColorHelper.GetColor(3),
|
||||
};
|
||||
IdTextNode.AttachNode(this);
|
||||
|
||||
CollisionNode.ShowClickableCursor = true;
|
||||
}
|
||||
|
||||
protected override void OnSizeChanged() {
|
||||
base.OnSizeChanged();
|
||||
|
||||
IconNode.Size = new Vector2(Height - 4.0f, Height - 4.0f);
|
||||
IconNode.Position = new Vector2(2.0f, 2.0f);
|
||||
|
||||
LabelTextNode.Size = new Vector2(Width - Height - 2.0f - 30.0f, Height / 2.0f);
|
||||
LabelTextNode.Position = new Vector2(Height + 2.0f, 0.0f);
|
||||
|
||||
SubLabelTextNode.Size = new Vector2(Width - Height - 2.0f - 10.0f, Height / 2.0f);
|
||||
SubLabelTextNode.Position = new Vector2(Height + 2.0f + 10.0f, Height / 2.0f);
|
||||
|
||||
IdTextNode.Size = new Vector2(30.0f, Height / 2.0f);
|
||||
IdTextNode.Position = new Vector2(Width - 30.0f, 0.0f);
|
||||
}
|
||||
|
||||
protected override void SetNodeData(T itemData) {
|
||||
IconNode.IconId = GetIconId(itemData);
|
||||
LabelTextNode.String = GetLabelText(itemData);
|
||||
SubLabelTextNode.String = GetSubLabelText(itemData);
|
||||
IdTextNode.String = GetId(itemData).ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
protected abstract uint GetIconId(T data);
|
||||
protected abstract string GetLabelText(T data);
|
||||
protected abstract string GetSubLabelText(T data);
|
||||
protected abstract uint? GetId(T data);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Numerics;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using KamiToolKit.Classes;
|
||||
using KamiToolKit.Nodes;
|
||||
|
||||
namespace KamiToolKit.Premade.GenericListItemNodes;
|
||||
|
||||
public abstract class GenericSimpleListItemNode<T> : ListItemNode<T> {
|
||||
public override float ItemHeight => 48.0f;
|
||||
|
||||
protected readonly IconImageNode IconNode;
|
||||
protected readonly TextNode LabelTextNode;
|
||||
|
||||
protected GenericSimpleListItemNode() {
|
||||
IconNode = new IconImageNode {
|
||||
FitTexture = true,
|
||||
IconId = 60072,
|
||||
};
|
||||
IconNode.AttachNode(this);
|
||||
|
||||
LabelTextNode = new TextNode {
|
||||
TextFlags = TextFlags.Ellipsis | TextFlags.Emboss,
|
||||
FontSize = 14,
|
||||
LineSpacing = 14,
|
||||
AlignmentType = AlignmentType.Left,
|
||||
TextColor = ColorHelper.GetColor(8),
|
||||
TextOutlineColor = ColorHelper.GetColor(7),
|
||||
};
|
||||
LabelTextNode.AttachNode(this);
|
||||
|
||||
CollisionNode.ShowClickableCursor = true;
|
||||
}
|
||||
|
||||
protected override void OnSizeChanged() {
|
||||
base.OnSizeChanged();
|
||||
|
||||
IconNode.Size = new Vector2(Height - 4.0f, Height - 4.0f);
|
||||
IconNode.Position = new Vector2(2.0f, 2.0f);
|
||||
|
||||
LabelTextNode.Size = new Vector2(Width - IconNode.Width - 6.0f, Height);
|
||||
LabelTextNode.Position = new Vector2(IconNode.Bounds.Right + 6.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Numerics;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using KamiToolKit.Classes;
|
||||
using KamiToolKit.Nodes;
|
||||
|
||||
namespace KamiToolKit.Premade.GenericListItemNodes;
|
||||
|
||||
public abstract class GenericStringListItemNode<T> : ListItemNode<T> {
|
||||
public override float ItemHeight => 24.0f;
|
||||
|
||||
protected readonly TextNode StringNode;
|
||||
|
||||
protected GenericStringListItemNode() {
|
||||
StringNode = new TextNode {
|
||||
TextFlags = TextFlags.Ellipsis | TextFlags.Emboss,
|
||||
FontSize = 14,
|
||||
LineSpacing = 14,
|
||||
AlignmentType = AlignmentType.Left,
|
||||
TextColor = ColorHelper.GetColor(8),
|
||||
TextOutlineColor = ColorHelper.GetColor(7),
|
||||
};
|
||||
StringNode.AttachNode(this);
|
||||
}
|
||||
|
||||
protected override void OnSizeChanged() {
|
||||
base.OnSizeChanged();
|
||||
|
||||
StringNode.Size = new Vector2(Width - 20.0f, Height);
|
||||
StringNode.Position = new Vector2(10.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user