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

Commit

Permalink
fix: fixed No Move button in Control window.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 8, 2023
1 parent f716c38 commit 9e210f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public override void Draw()
ImGui.TextColored(ImGuiColors.DPSRed, DataCenter.TargetingType.ToName());

RotationConfigWindow.DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoMove,
ref Service.Config.IsControlWindowLock, Service.Default.IsControlWindowLock);
ref Service.Config.IsControlWindowLock);
ImGui.EndGroup();

ImGui.SameLine();
Expand Down
17 changes: 10 additions & 7 deletions RotationSolver/UI/RotationConfigWindow_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ internal static void DrawCheckBox(string name, SettingsCommand command, string d
}

internal static void DrawCheckBox(string name, ref bool value, bool @default, string description = "", Action otherThing = null)
{
DrawCheckBox(name, ref value, description, otherThing);

if (value != @default)
{
ImGuiHelper.UndoValue(name, ref value, @default, otherThing);
}
}

internal static void DrawCheckBox(string name, ref bool value, string description = "", Action otherThing = null)
{
if (ImGui.Checkbox(name, ref value))
{
Expand All @@ -94,15 +104,8 @@ internal static void DrawCheckBox(string name, ref bool value, bool @default, st
}

ImGuiHelper.HoveredString(description);

if(value != @default)
{
ImGuiHelper.UndoValue(name, ref value, @default, otherThing);
}
}



private static void DrawRangedFloat(string name, ref float minValue, ref float maxValue, float defaultMin, float defaultMax, float speed = 0.01f, float min = 0, float max = 3, string description = "")
{
ImGui.SetNextItemWidth(100);
Expand Down

0 comments on commit 9e210f6

Please sign in to comment.