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

Commit

Permalink
fix: make cooldown ation not adjust icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 22, 2023
1 parent 2c7a0f3 commit 4ab116f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ static string GetHelp(StateCommandType command)

static readonly Dictionary<uint, uint> _actionIcons = new Dictionary<uint, uint>();

static TextureWrap GetTexture(IAction action)
static TextureWrap GetTexture(IAction action, bool isAdjust = true)
{
uint iconId = 0;
if(action != null && !_actionIcons.TryGetValue(action.AdjustedID, out iconId))
if(action != null && !_actionIcons.TryGetValue(isAdjust ? action.AdjustedID : action.ID, out iconId))
{
iconId = action is IBaseAction ? Service.GetSheet<Lumina.Excel.GeneratedSheets.Action>().GetRow(action.AdjustedID).Icon
: Service.GetSheet<Lumina.Excel.GeneratedSheets.Item>().GetRow(action.AdjustedID).Icon;
Expand Down Expand Up @@ -411,9 +411,9 @@ static void DrawIAction(nint handle, string id, float width, StateCommandType co
}
}

internal static (Vector2, Vector2) DrawIAction(IAction action, float width, float percent)
internal static (Vector2, Vector2) DrawIAction(IAction action, float width, float percent, bool isAdjust = true)
{
var result = DrawIAction(GetTexture(action).ImGuiHandle, width, action == null ? -1 : percent);
var result = DrawIAction(GetTexture(action, isAdjust).ImGuiHandle, width, action == null ? -1 : percent);
if (action != null) ImGuiHelper.HoveredString(action.Name, () =>
{
if (DataCenter.StateType == StateCommandType.Cancel)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/CooldownWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static void DrawActionCooldown(IAction act)
{
r = !act.EnoughLevel ? 0: recast == 0 || !act.IsCoolingDown || shouldSkip ? 1 : elapsed / recast;
}
var pair = ControlWindow.DrawIAction(act, width, r);
var pair = ControlWindow.DrawIAction(act, width, r, false);
var pos = pair.Item1;
var size = pair.Item2;
ImGuiHelper.HoveredString(act.Name + "\n" + LocalizationManager.RightLang.ConfigWindow_Control_ClickToUse);
Expand Down

0 comments on commit 4ab116f

Please sign in to comment.