From 3d6d04dde149d9abd5bde84d0ee6f2b66689d28f Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 10 Jan 2025 20:00:16 +0100 Subject: [PATCH] Fix bug in automation tab setting gearsets. --- Glamourer/Gui/Tabs/AutomationTab/SetPanel.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Glamourer/Gui/Tabs/AutomationTab/SetPanel.cs b/Glamourer/Gui/Tabs/AutomationTab/SetPanel.cs index ab2b3d6..924f822 100644 --- a/Glamourer/Gui/Tabs/AutomationTab/SetPanel.cs +++ b/Glamourer/Gui/Tabs/AutomationTab/SetPanel.cs @@ -230,6 +230,7 @@ public class SetPanel( } private int _tmpGearset = int.MaxValue; + private int _whichIndex = -1; private void DrawConditions(AutoDesign design, int idx) { @@ -245,14 +246,19 @@ public class SetPanel( ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X); if (usingGearset) { - var set = 1 + (_tmpGearset == int.MaxValue ? design.GearsetIndex : _tmpGearset); + var set = 1 + (_tmpGearset == int.MaxValue || _whichIndex != idx ? design.GearsetIndex : _tmpGearset); ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X); if (ImGui.InputInt("##whichGearset", ref set, 0, 0)) + { + _whichIndex = idx; _tmpGearset = Math.Clamp(set, 1, 100); + } + if (ImGui.IsItemDeactivatedAfterEdit()) { _manager.ChangeGearsetCondition(Selection, idx, (short)(_tmpGearset - 1)); _tmpGearset = int.MaxValue; + _whichIndex = -1; } } else