Initial release: HSUI v1.0.0.0 - HUD replacement with configurable hotbars
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using HSUI.Config;
|
||||
using HSUI.Helpers;
|
||||
using HSUI.Interface.Bars;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
namespace HSUI.Interface.GeneralElements
|
||||
{
|
||||
public class PullTimerHud : DraggableHudElement, IHudElementWithActor
|
||||
{
|
||||
private PullTimerConfig Config => (PullTimerConfig)_config;
|
||||
|
||||
public IGameObject? Actor { get; set; } = null;
|
||||
|
||||
public PullTimerHud(PullTimerConfig config, string displayName) : base(config, displayName) { }
|
||||
|
||||
protected override (List<Vector2>, List<Vector2>) ChildrenPositionsAndSizes()
|
||||
{
|
||||
return (new List<Vector2>() { Config.Position }, new List<Vector2>() { Config.Size });
|
||||
}
|
||||
|
||||
public override void DrawChildren(Vector2 origin)
|
||||
{
|
||||
PullTimerState helper = PullTimerHelper.Instance.PullTimerState;
|
||||
|
||||
Config.Label.SetValue(helper.CountDownValue);
|
||||
|
||||
if (!helper.CountingDown)
|
||||
{
|
||||
Config.Label.SetText("");
|
||||
}
|
||||
|
||||
if (!Config.Enabled || Actor is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.HideWhenInactive && !helper.CountingDown)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PluginConfigColor? fillColor = Config.UseJobColor ? ColorUtils.ColorForActor(Actor) : null;
|
||||
|
||||
BarHud bar = BarUtilities.GetProgressBar(Config,
|
||||
helper.CountDownValue,
|
||||
helper.CountDownMax, 0F, Actor, fillColor);
|
||||
|
||||
AddDrawActions(bar.GetDrawActions(origin, Config.StrataLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user