Skip to content

Commit

Permalink
Fix action rendering in macro window to be consistent with hotbars
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Nov 18, 2023
1 parent 65b41f5 commit 2f6d585
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Craftimizer/Windows/MacroEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ private void DrawMacro()
using var _color = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero);
using var _color3 = ImRaii.PushColor(ImGuiCol.ButtonHovered, Vector4.Zero);
using var _color2 = ImRaii.PushColor(ImGuiCol.ButtonActive, Vector4.Zero);
using var _alpha = ImRaii.PushStyle(ImGuiStyleVar.DisabledAlpha, ImGui.GetStyle().DisabledAlpha * .5f);
for (var i = 0; i < Macro.Count; i++)
{
if (i % itemsPerRow != 0)
Expand All @@ -1208,7 +1209,15 @@ private void DrawMacro()
using var id = ImRaii.PushId(i);
if (ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, failedAction ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One))
RemoveStep(i);
if (response is ActionResponse.ActionNotUnlocked)
if (response is ActionResponse.ActionNotUnlocked ||
(
failedAction &&
(CharacterStats.Level < actionBase.Level ||
(action == ActionType.Manipulation && !CharacterStats.CanUseManipulation) ||
(action is ActionType.HeartAndSoul or ActionType.CarefulObservation && !CharacterStats.IsSpecialist)
)
)
)
{
Vector2 v1 = ImGui.GetItemRectMin(), v2 = ImGui.GetItemRectMax();
ImGui.PushClipRect(v1, v2, true);
Expand Down

1 comment on commit 2f6d585

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 2f6d585 Previous: a8c3f34 Ratio
Craftimizer.Benchmark.Bench.Solve(State: 73376A90, Config: CB26C3F4) 1422424626.6666667 ns (± 3534513.921817795)
Craftimizer.Benchmark.Bench.Solve(State: 73376A90, Config: CB26C3F4) 1049562933.3333334 ns (± 2656957.4083006694)
Craftimizer.Benchmark.Bench.Solve(State: BA6E491F, Config: CB26C3F4) 1453229450 ns (± 5319119.532946146)
Craftimizer.Benchmark.Bench.Solve(State: BA6E491F, Config: CB26C3F4) 1143691926.6666667 ns (± 4712793.586075289)

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.