From 2f6d585a388021824e3946dc4999929696c8c8a5 Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Sat, 18 Nov 2023 01:48:11 -0800 Subject: [PATCH] Fix action rendering in macro window to be consistent with hotbars --- Craftimizer/Windows/MacroEditor.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Craftimizer/Windows/MacroEditor.cs b/Craftimizer/Windows/MacroEditor.cs index f84223b..be947ac 100644 --- a/Craftimizer/Windows/MacroEditor.cs +++ b/Craftimizer/Windows/MacroEditor.cs @@ -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) @@ -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);