From 1e2f7e411d93271bcce6b66005d5be9a330167b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Sun, 2 Apr 2023 11:07:46 +0800 Subject: [PATCH] fix: add an option to control the info window's no move. --- .../Configuration/PluginConfiguration.cs | 3 ++- RotationSolver/Localization/Strings.cs | 3 ++- RotationSolver/UI/ControlWindow.cs | 2 +- RotationSolver/UI/CooldownWindow.cs | 8 +------- RotationSolver/UI/InfoWindow.cs | 12 +++++------- RotationSolver/UI/RotationConfigWindow_Control.cs | 9 ++++++--- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/RotationSolver.Basic/Configuration/PluginConfiguration.cs b/RotationSolver.Basic/Configuration/PluginConfiguration.cs index d39d8126d..937728e3a 100644 --- a/RotationSolver.Basic/Configuration/PluginConfiguration.cs +++ b/RotationSolver.Basic/Configuration/PluginConfiguration.cs @@ -164,7 +164,8 @@ public class PluginConfiguration : IPluginConfiguration public bool ShowControlWindow = false; public bool IsControlWindowLock = false; public bool ShowNextActionWindow = false; - public bool IsInfoWindowLock = false; + public bool IsInfoWindowNoInputs = false; + public bool IsInfoWindowNoMove = false; public bool UseKeyboardCommand = false; public bool UseGamepadCommand = false; public bool ShowItemsCooldown = false; diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index 9bd9ef186..53a6526a3 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -244,7 +244,8 @@ internal partial class Strings public string ConfigWindow_Control_UseKeyboardCommand { get; set; } = "Use Keyboard Command"; public string ConfigWindow_Control_UseGamepadCommand { get; set; } = "Use GamePad Command"; public string ConfigWindow_Control_ShowCooldownWindow { get; set; } = "Show Cooldown Window"; - public string ConfigWindow_Control_IsWindowLock { get; set; } = "Lock"; + public string ConfigWindow_Control_IsInfoWindowNoInputs { get; set; } = "No Inputs"; + public string ConfigWindow_Control_IsInfoWindowNoMove { get; set; } = "No Move"; public string ConfigWindow_Control_ShowItemsCooldown { get; set; } = "Show Items' Cooldown"; public string ConfigWindow_Control_UseOriginalCooldown { get; set; } = "Show Original Cooldown"; diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index debebd88f..59bba6f51 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -76,7 +76,7 @@ public override void Draw() ImGui.Text(DataCenter.TargetingType.ToName()); - RotationConfigWindow.DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsWindowLock, + RotationConfigWindow.DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs, ref Service.Config.IsControlWindowLock); ImGui.EndGroup(); diff --git a/RotationSolver/UI/CooldownWindow.cs b/RotationSolver/UI/CooldownWindow.cs index 5cbd8485c..392d077c3 100644 --- a/RotationSolver/UI/CooldownWindow.cs +++ b/RotationSolver/UI/CooldownWindow.cs @@ -1,13 +1,7 @@ using ImGuiNET; -using RotationSolver.Basic.Actions; using RotationSolver.Basic; +using RotationSolver.Basic.Actions; using RotationSolver.Updaters; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections; using System.Numerics; namespace RotationSolver.UI; diff --git a/RotationSolver/UI/InfoWindow.cs b/RotationSolver/UI/InfoWindow.cs index 468d60249..7457ef6ec 100644 --- a/RotationSolver/UI/InfoWindow.cs +++ b/RotationSolver/UI/InfoWindow.cs @@ -1,11 +1,6 @@ using Dalamud.Interface.Windowing; using ImGuiNET; using RotationSolver.Basic; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RotationSolver.UI; @@ -26,11 +21,14 @@ public override void PreDraw() ImGui.PushStyleColor(ImGuiCol.WindowBg, Service.Config.InfoWindowBg); Flags = BaseFlags; - if (Service.Config.IsInfoWindowLock) + if (Service.Config.IsInfoWindowNoInputs) { Flags |= ImGuiWindowFlags.NoInputs; } - + if (Service.Config.IsInfoWindowNoMove) + { + Flags |= ImGuiWindowFlags.NoMove; + } //ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0, 0)); ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0); } diff --git a/RotationSolver/UI/RotationConfigWindow_Control.cs b/RotationSolver/UI/RotationConfigWindow_Control.cs index 67517e979..cded87987 100644 --- a/RotationSolver/UI/RotationConfigWindow_Control.cs +++ b/RotationSolver/UI/RotationConfigWindow_Control.cs @@ -34,8 +34,11 @@ private void DrawControlTab() DrawColor4(LocalizationManager.RightLang.ConfigWindow_Control_InfoWindowBg, ref Service.Config.InfoWindowBg); - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsWindowLock, - ref Service.Config.IsInfoWindowLock); + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs, + ref Service.Config.IsInfoWindowNoInputs); + + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoMove, + ref Service.Config.IsInfoWindowNoMove); if (Service.Config.ShowCooldownWindow) { @@ -56,7 +59,7 @@ private void DrawControlTab() if (!Service.Config.ShowControlWindow) return; - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsWindowLock, + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs, ref Service.Config.IsControlWindowLock); if (Service.Config.IsControlWindowLock)