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

Commit

Permalink
fix: allowed one option used multiple times.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 23, 2023
1 parent a432ba4 commit 2d30001
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ClickingCount": 6208
"ClickingCount": 6217
}
2 changes: 1 addition & 1 deletion RotationSolver/UI/SearchableConfigs/CheckBoxSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/SearchableConfigs/ColorEditSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/SearchableConfigs/DragFloatSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/SearchableConfigs/DragIntRangeSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/UI/SearchableConfigs/DragIntSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ 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);
}
}
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);
}
Expand Down

0 comments on commit 2d30001

Please sign in to comment.