Files
AetherBags/KamiToolKit/Nodes/Component/ProgressBarNode.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

52 lines
1.4 KiB
C#

using System.Numerics;
namespace KamiToolKit.Nodes;
public class ProgressBarNode : ProgressNode {
public readonly NineGridNode BackgroundNode;
public readonly NineGridNode ForegroundNode;
public ProgressBarNode() {
BackgroundNode = new SimpleNineGridNode {
TexturePath = "ui/uld/ToDoList.tex",
TextureCoordinates = new Vector2(108.0f, 8.0f),
TextureSize = new Vector2(44.0f, 12.0f),
LeftOffset = 6,
RightOffset = 6,
};
BackgroundNode.AttachNode(this);
ForegroundNode = new SimpleNineGridNode {
TexturePath = "ui/uld/ToDoList.tex",
TextureCoordinates = new Vector2(112.0f, 0.0f),
TextureSize = new Vector2(40.0f, 8.0f),
LeftOffset = 4,
RightOffset = 4,
};
ForegroundNode.AttachNode(this);
}
public override Vector4 BackgroundColor {
get => BackgroundNode.Color;
set => BackgroundNode.Color = value;
}
public override Vector4 BarColor {
get => ForegroundNode.Color;
set => ForegroundNode.Color = value;
}
public override float Progress {
get => ForegroundNode.Width / Width;
set => ForegroundNode.Width = Width * value;
}
protected override void OnSizeChanged() {
base.OnSizeChanged();
BackgroundNode.Size = Size;
ForegroundNode.Size = Size;
}
}