From 5d8c5450e9ea0d58dec3dc313ab236da1d6bb990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Sat, 8 Apr 2023 00:21:24 +0800 Subject: [PATCH] fix: changed some ui default values. --- .../Actions/BaseAction_Target.cs | 2 +- .../Configuration/PluginConfiguration.cs | 2 +- RotationSolver.Default/Ranged/MCH_Default.cs | 21 +++++++++++++++---- RotationSolver/UI/ControlWindow.cs | 2 +- .../UI/RotationConfigWindow_Debug.cs | 3 +++ 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index 6f9fb9716..aa005268b 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -179,7 +179,7 @@ private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player) else { Vector3 directionToTank = attackT.Position - player.Position; - var MoveDirection = directionToTank / directionToTank.Length() * (disToTankRound - _action.EffectRange); + var MoveDirection = directionToTank / directionToTank.Length() * Math.Max(0, disToTankRound - _action.EffectRange); _position = player.Position + MoveDirection; } } diff --git a/RotationSolver.Basic/Configuration/PluginConfiguration.cs b/RotationSolver.Basic/Configuration/PluginConfiguration.cs index eaf2b4dee..b7707a543 100644 --- a/RotationSolver.Basic/Configuration/PluginConfiguration.cs +++ b/RotationSolver.Basic/Configuration/PluginConfiguration.cs @@ -168,7 +168,7 @@ public class PluginConfiguration : IPluginConfiguration public bool OnlyShowWithHostileOrInDuty = true; public bool ShowControlWindow = false; public bool IsControlWindowLock = false; - public bool ShowNextActionWindow = false; + public bool ShowNextActionWindow = true; public bool IsInfoWindowNoInputs = false; public bool IsInfoWindowNoMove = false; public bool UseKeyboardCommand = false; diff --git a/RotationSolver.Default/Ranged/MCH_Default.cs b/RotationSolver.Default/Ranged/MCH_Default.cs index d9de5613d..187e54d3b 100644 --- a/RotationSolver.Default/Ranged/MCH_Default.cs +++ b/RotationSolver.Default/Ranged/MCH_Default.cs @@ -77,8 +77,7 @@ protected override bool AttackAbility(byte abilitiesRemaining, out IAction act) } if (!CombatElapsedLess(12) && CanUseHypercharge(out act)) return true; - if (!AirAnchorBlockTime(8) - && RookAutoturret.CanUse(out act)) return true; + if (CanUseRookAutoturret(out act)) return true; if (BarrelStabilizer.CanUse(out act)) return true; @@ -106,6 +105,21 @@ private static bool AirAnchorBlockTime(float time) } } + private bool CanUseRookAutoturret(out IAction act) + { + act = null; + if (AirAnchor.EnoughLevel) + { + if (!AirAnchor.IsCoolingDown || AirAnchor.ElapsedAfter(10)) return false; + } + else + { + if (!HotShot.IsCoolingDown || HotShot.ElapsedAfter(10)) return false; + } + + return RookAutoturret.CanUse(out act); + } + const float REST_TIME = 6f; private static bool CanUseHypercharge(out IAction act) { @@ -135,7 +149,6 @@ private static bool CanUseHypercharge(out IAction act) if (Drill.EnoughLevel && Drill.WillHaveOneCharge(REST_TIME)) return false; if (ChainSaw.EnoughLevel && ChainSaw.WillHaveOneCharge(REST_TIME)) return false; - if (Hypercharge.CanUse(out act)) return true; - return false; + return Hypercharge.CanUse(out act); } } diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index 0dd0e9ec6..40aa00652 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -18,7 +18,7 @@ internal class ControlWindow : Window public ControlWindow() : base(nameof(ControlWindow), BaseFlags) { - Size = new Vector2(540f, 490f); + Size = new Vector2(540f, 300f); SizeCondition = ImGuiCond.FirstUseEver; } diff --git a/RotationSolver/UI/RotationConfigWindow_Debug.cs b/RotationSolver/UI/RotationConfigWindow_Debug.cs index 381e1bfab..1c5fe964a 100644 --- a/RotationSolver/UI/RotationConfigWindow_Debug.cs +++ b/RotationSolver/UI/RotationConfigWindow_Debug.cs @@ -141,6 +141,9 @@ private void DrawCDEX() private unsafe void DrawIcon() { + var A = new Vector3(3, 4, 0); + var B = new Vector3(6, 8, 0); + ImGui.Text(Vector3.Distance(B, A).ToString()); //var pointer = (AddonActionCross*) Service.GetAddon(); //if (pointer != null) //{