Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add an line to cooldown window for better showcase.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 26, 2023
1 parent 751aced commit 09607f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RotationSolver/UI/CooldownWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void Draw()
}
}

static readonly uint progressCol = ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.6f, 0.6f, 0.6f));
static readonly uint progressCol = ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.6f, 0.6f, 0.7f));
private static void DrawActionCooldown(IAction act)
{
var width = Service.Config.ControlWindow0GCDSize;
Expand All @@ -69,9 +69,10 @@ private static void DrawActionCooldown(IAction act)
else if (act.IsCoolingDown)
{
var ratio = recast == 0 ? 0 : elapsed % recast / recast;
ImGui.GetWindowDrawList().AddRectFilled(new Vector2(pos.X + width * ratio, pos.Y) + winPos,
var startPos = new Vector2(pos.X + width * ratio, pos.Y) + winPos;
ImGui.GetWindowDrawList().AddRectFilled(startPos,
new Vector2(pos.X + width, pos.Y + width) + winPos, progressCol);

ImGui.GetWindowDrawList().AddLine(startPos, startPos + new Vector2(0, width), black);
string time = recast == 0 || !act.EnoughLevel ? "0" : ((int)(recast - elapsed % recast) + 1).ToString();
var strSize = ImGui.CalcTextSize(time);
var fontPos = new Vector2(pos.X + width / 2 - strSize.X / 2, pos.Y + width / 2 - strSize.Y / 2) + winPos;
Expand Down

0 comments on commit 09607f7

Please sign in to comment.