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

Commit

Permalink
fix: fixed cooldown cover size.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 10, 2023
1 parent 948dd9c commit 28df880
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ static void DrawIAction(nint handle, string id, float width, StateCommandType co
}
}

internal static void DrawIAction(IAction action, float width, float percent)
internal static (Vector2, Vector2) DrawIAction(IAction action, float width, float percent)
{
DrawIAction(GetTexture(action).ImGuiHandle, width, action == null ? -1 : percent);
var result = DrawIAction(GetTexture(action).ImGuiHandle, width, action == null ? -1 : percent);
if (action != null) ImGuiHelper.HoveredString(action.Name, () =>
{
if (DataCenter.StateType == StateCommandType.Cancel)
Expand All @@ -428,15 +428,17 @@ internal static void DrawIAction(IAction action, float width, float percent)
DataCenter.AddCommandAction(action, 5);
}
});
return result;
}

static void DrawIAction(nint handle, float width, float percent)
static (Vector2, Vector2) DrawIAction(nint handle, float width, float percent)
{
var cursor = ImGui.GetCursorPos();
ImGui.BeginGroup();

var pt = ImGui.GetCursorPos();
ImGui.Image(handle, new Vector2(width, width));

var size = ImGui.GetItemRectSize();
var pixPerUnit = width / 82;

if (percent < 0)
Expand Down Expand Up @@ -515,6 +517,7 @@ static void DrawIAction(nint handle, float width, float percent)


ImGui.EndGroup();
return (pt, size);
}

static unsafe void DrawNextAction(float gcd, float ability, float width)
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/UI/CooldownWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ private static void DrawActionCooldown(IAction act)
var shouldSkip = recast < 3 && act is IBaseAction a && !a.IsRealGCD;

ImGui.BeginGroup();
var pos = ImGui.GetCursorPos();
var winPos = ImGui.GetWindowPos();

var r = -1f;
if (Service.Config.UseOriginalCooldown)
{
r = !act.EnoughLevel ? 0: recast == 0 || !act.IsCoolingDown || shouldSkip ? 1 : elapsed / recast;
}
ControlWindow.DrawIAction(act, width, r);
var size = ImGui.GetItemRectSize();
var pair = ControlWindow.DrawIAction(act, width, r);
var pos = pair.Item1;
var size = pair.Item2;
ImGuiHelper.HoveredString(act.Name + "\n" + LocalizationManager.RightLang.ConfigWindow_Control_ClickToUse);

if (!act.EnoughLevel)
Expand Down

0 comments on commit 28df880

Please sign in to comment.