From b3633640fc8463ccebe3679ea3fad94927c8086a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Sun, 19 Mar 2023 18:49:59 +0800 Subject: [PATCH] fix: fix some control window showing stuff. --- .../Configuration/PluginConfiguration.cs | 3 ++- RotationSolver/Commands/RSCommands_Actions.cs | 16 ++++++++-------- RotationSolver/UI/ControlWindow.cs | 10 ++++++---- .../UI/RotationConfigWindow_Control.cs | 3 +++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/RotationSolver.Basic/Configuration/PluginConfiguration.cs b/RotationSolver.Basic/Configuration/PluginConfiguration.cs index dd62851d2..12bfa3e58 100644 --- a/RotationSolver.Basic/Configuration/PluginConfiguration.cs +++ b/RotationSolver.Basic/Configuration/PluginConfiguration.cs @@ -157,7 +157,7 @@ public class PluginConfiguration : IPluginConfiguration public MacroInfo DutyEnd { get; set; } = new MacroInfo(); public bool ShowControlWindow = false; - public bool IsControlWindowLock = true; + public bool IsControlWindowLock = false; public bool UseKeyboardCommand = false; public bool UseGamepadCommand = false; @@ -167,6 +167,7 @@ public class PluginConfiguration : IPluginConfiguration public float ControlWindow0GCDSize = 30; public float ControlWindowNextSizeRatio = 1.5f; public float ControlProgressHeight = 8; + public bool ControlShowCooldown = false; public Dictionary KeyState { get; set; } = new Dictionary(); public Dictionary KeySpecial { get; set; } = new Dictionary(); diff --git a/RotationSolver/Commands/RSCommands_Actions.cs b/RotationSolver/Commands/RSCommands_Actions.cs index e3c8764b8..aa07ae83f 100644 --- a/RotationSolver/Commands/RSCommands_Actions.cs +++ b/RotationSolver/Commands/RSCommands_Actions.cs @@ -24,9 +24,16 @@ internal static unsafe void DoAnAction(bool isGCD) if (DateTime.Now - _fastClickStopwatch < _fastSpan) return; _fastClickStopwatch = DateTime.Now; + //Do Action + var nextAction = ActionUpdater.NextAction; + if (nextAction == null) return; +#if DEBUG + //if (nextAction is BaseAction acti) + // Service.ChatGui.Print($"Will Do {acti} {ActionUpdater.WeaponElapsed}"); +#endif if (SocialUpdater.InHighEndDuty && !RotationUpdater.RightNowRotation.IsAllowed(out var str)) { - if(_loop % 5 == 0) + if (_loop % 5 == 0) { Service.ToastGui.ShowError(string.Format(LocalizationManager.RightLang.HighEndBan, str)); } @@ -35,13 +42,6 @@ internal static unsafe void DoAnAction(bool isGCD) return; } - //Do Action - var nextAction = ActionUpdater.NextAction; -#if DEBUG - //if (nextAction is BaseAction acti) - // Service.ChatGui.Print($"Will Do {acti} {ActionUpdater.WeaponElapsed}"); -#endif - if (nextAction == null) return; if (!isGCD && nextAction is BaseAction act1 && act1.IsRealGCD) return; if (nextAction.Use()) diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index e2f4d820e..de97b828b 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -28,7 +28,8 @@ internal class ControlWindow : Window public ControlWindow() : base(nameof(ControlWindow), _baseFlags) { - this.IsOpen = true; + Size = new Vector2(540f, 490f); + //SizeCondition = ImGuiCond.FirstUseEver; } public override void PreDraw() @@ -79,10 +80,10 @@ public override void Draw() DrawSpecials(); ImGui.Columns(1); - ImGui.Separator(); - if(RotationUpdater.RightNowRotation!= null) + if(Service.Config.ControlShowCooldown && RotationUpdater.RightNowRotation!= null) { + ImGui.Separator(); foreach (var pair in RotationUpdater.AllGroupedActions) { ImGui.Text(pair.Key); @@ -126,7 +127,8 @@ private static void DrawActionCooldown(IAction act) if(act is IBaseAction bAct && bAct.MaxCharges > 1) { - //Draw charges here. + ImGui.SetCursorPos(pos); + ImGui.TextDisabled(bAct.CurrentCharges.ToString()); } ImGui.EndGroup(); diff --git a/RotationSolver/UI/RotationConfigWindow_Control.cs b/RotationSolver/UI/RotationConfigWindow_Control.cs index bd49dc921..735c456f2 100644 --- a/RotationSolver/UI/RotationConfigWindow_Control.cs +++ b/RotationSolver/UI/RotationConfigWindow_Control.cs @@ -19,6 +19,9 @@ private void DrawControlTab() if (!Service.Config.ShowControlWindow) return; + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsControlWindowLock, + ref Service.Config.IsControlWindowLock); + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseKeyboardCommand, ref Service.Config.UseKeyboardCommand);