From 2d300018bd2ff2c442baf34135d619f09d919063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Wed, 23 Aug 2023 14:05:08 +0800 Subject: [PATCH] fix: allowed one option used multiple times. --- Resources/RotationSolverRecord.json | 2 +- RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs | 2 +- RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs | 2 +- RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs | 2 +- RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs | 2 +- RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs | 2 +- RotationSolver/UI/SearchableConfigs/DragIntSearch.cs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Resources/RotationSolverRecord.json b/Resources/RotationSolverRecord.json index 2fe5cad9f..ebd79da8f 100644 --- a/Resources/RotationSolverRecord.json +++ b/Resources/RotationSolverRecord.json @@ -1,3 +1,3 @@ { - "ClickingCount": 6208 + "ClickingCount": 6217 } \ No newline at end of file diff --git a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs index 714dc0019..2defce351 100644 --- a/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs @@ -90,7 +90,7 @@ protected override void DrawMain(Job job) ImGui.SameLine(); - var name = $"{Name}##Config_{ID}"; + var name = $"{Name}##Config_{ID}{GetHashCode()}"; if(hasIcon) { ImGui.BeginGroup(); diff --git a/RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs b/RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs index 111bda197..9822dbca2 100644 --- a/RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs @@ -47,7 +47,7 @@ protected override void DrawMain(Job job) { var value = GetValue(job); ImGui.SetNextItemWidth(DRAG_WIDTH * 1.5f * Scale); - if(ImGui.ColorEdit4($"{Name}##Config_{ID}", ref value)) + if(ImGui.ColorEdit4($"{Name}##Config_{ID}{GetHashCode()}", ref value)) { SetValue(job, value); } diff --git a/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs b/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs index 8aa126cb8..fa02603c3 100644 --- a/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragFloatRangeSearch.cs @@ -124,7 +124,7 @@ protected override void DrawMain(Job job) var minValue = GetMinValue(job); var maxValue = GetMaxValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragFloatRange2($"##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) + if (ImGui.DragFloatRange2($"##Config_{ID}{GetHashCode()}", ref minValue, ref maxValue, Speed, Min, Max)) { SetMinValue(job, Math.Min(minValue, maxValue)); SetMaxValue(job, Math.Max(minValue, maxValue)); diff --git a/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs b/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs index 9e8bfcf1a..eaaeff783 100644 --- a/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs @@ -98,7 +98,7 @@ protected override void DrawMain(Job job) { var value = GetValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragFloat($"##Config_{ID}", ref value, Speed, Min, Max)) + if (ImGui.DragFloat($"##Config_{ID}{GetHashCode()}", ref value, Speed, Min, Max)) { SetValue(job, value); } diff --git a/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs b/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs index 3c51a9af6..7d9e2269f 100644 --- a/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs @@ -123,7 +123,7 @@ protected override void DrawMain(Job job) var minValue = GetMinValue(job); var maxValue = GetMaxValue(job); ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragIntRange2($"##Config_{ID}", ref minValue, ref maxValue, Speed, Min, Max)) + if (ImGui.DragIntRange2($"##Config_{ID}{GetHashCode()}", ref minValue, ref maxValue, Speed, Min, Max)) { SetMinValue(job, Math.Min(minValue, maxValue)); SetMaxValue(job, Math.Max(minValue, maxValue)); diff --git a/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs b/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs index f52de6496..807d8702f 100644 --- a/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs +++ b/RotationSolver/UI/SearchableConfigs/DragIntSearch.cs @@ -114,7 +114,7 @@ protected override void DrawMain(Job job) if(GetNames != null && GetNames() is string[] strs && strs.Length > 0) { ImGui.SetNextItemWidth(Math.Max(ImGui.CalcTextSize(strs[value]).X + 30, DRAG_WIDTH) * Scale); - if (ImGui.Combo($"##Config_{ID}", ref value, strs, strs.Length)) + if (ImGui.Combo($"##Config_{ID}{GetHashCode()}", ref value, strs, strs.Length)) { SetValue(job, value); } @@ -122,7 +122,7 @@ protected override void DrawMain(Job job) else { ImGui.SetNextItemWidth(Scale * DRAG_WIDTH); - if (ImGui.DragInt($"##Config_{ID}", ref value, Speed, Min, Max)) + if (ImGui.DragInt($"##Config_{ID}{GetHashCode()}", ref value, Speed, Min, Max)) { SetValue(job, value); }