From a491e7e6241f3ee7e6c3e5ff773ff6a236aaf13e Mon Sep 17 00:00:00 2001 From: LTS-FFXIV <127939494+LTS-FFXIV@users.noreply.github.com> Date: Sun, 5 Jan 2025 22:31:48 -0600 Subject: [PATCH] ActionUpdater, MajorUpdater, DrawAbout, and updated resources Fixed ActionUpdater.cs to correct StopMovingTime and MovingTime to correctly track player movement Fixed MajorUpdater.cs to replace the foreach loop with a for loop to iterate over DataCenter.VfxDataQueue. This avoids modifying the collection while enumerating it, preventing the InvalidOperationException, maybe. Added Null handling to drawabout countclick section Expanded AnimationLockTime, HostileCastingArea, and HostileCastingKnockback lists Adjusted downtime and out of combat Eurkrasia --- BasicRotations/Healer/SGE_Default.cs | 4 +-- Resources/AnimationLockTime.json | 9 ++++--- Resources/HostileCastingArea.json | 6 ++++- Resources/HostileCastingKnockback.json | 9 ++++++- RotationSolver/UI/RotationConfigWindow.cs | 30 +++++++++++++---------- RotationSolver/Updaters/ActionUpdater.cs | 8 +++--- RotationSolver/Updaters/MajorUpdater.cs | 3 ++- 7 files changed, 43 insertions(+), 26 deletions(-) diff --git a/BasicRotations/Healer/SGE_Default.cs b/BasicRotations/Healer/SGE_Default.cs index e5ef2b103..ee876d080 100644 --- a/BasicRotations/Healer/SGE_Default.cs +++ b/BasicRotations/Healer/SGE_Default.cs @@ -381,8 +381,6 @@ protected override bool GeneralGCD(out IAction? act) if (HasSwift && SwiftLogic && EgeiroPvE.CanUse(out _)) return false; - if (!InCombat && !Player.HasStatus(true, StatusID.Eukrasia) && EukrasiaPvE.CanUse(out act)) return true; - if (PhlegmaIiiPvE.CanUse(out act, usedUp: IsMoving)) return true; if (PhlegmaIiPvE.CanUse(out act, usedUp: IsMoving)) return true; if (PhlegmaPvE.CanUse(out act, usedUp: IsMoving)) return true; @@ -401,6 +399,8 @@ protected override bool GeneralGCD(out IAction? act) if (DosisPvE.CanUse(out act)) return true; + if (!InCombat && !Player.HasStatus(true, StatusID.Eukrasia) && EukrasiaPvE.CanUse(out act)) return true; + if (InCombat && !HasHostilesInRange && EukrasiaPvE.CanUse(out act)) return true; return base.GeneralGCD(out act); } #endregion diff --git a/Resources/AnimationLockTime.json b/Resources/AnimationLockTime.json index fdcbc3fa4..e40c36370 100644 --- a/Resources/AnimationLockTime.json +++ b/Resources/AnimationLockTime.json @@ -756,8 +756,8 @@ "28901": 2.1, "28917": 2.1, "28924": 2.1, - "29054": 0.46599996, - "29056": 0.24599996, + "29054": 0.473, + "29056": 0.24299997, "29223": 0.1, "29224": 0.1, "29226": 0.6, @@ -790,7 +790,7 @@ "29484": 0.24099997, "29485": 0.4190002, "29709": 0.1, - "29711": 0.37699994, + "29711": 0.37800002, "29716": 0.1, "29731": 0.1, "29732": 0.6, @@ -878,6 +878,7 @@ "37018": 0.6, "37023": 0.6, "37024": 0.6, + "37025": 0.6, "37026": 0.6, "37028": 0.6, "37029": 0.6, @@ -901,7 +902,7 @@ "40109": 2.6, "40110": 2.6, "40111": 2.6, - "41467": 0.556, + "41467": 0.1, "41494": 0.1, "41496": 0.1, "41498": 0.15499976, diff --git a/Resources/HostileCastingArea.json b/Resources/HostileCastingArea.json index 074fb55c3..88e7faf81 100644 --- a/Resources/HostileCastingArea.json +++ b/Resources/HostileCastingArea.json @@ -717,5 +717,9 @@ 4205, 40516, 40522, - 40509 + 40509, + 1078, + 1074, + 20422, + 22660 ] \ No newline at end of file diff --git a/Resources/HostileCastingKnockback.json b/Resources/HostileCastingKnockback.json index f808b0ecd..e2e227f61 100644 --- a/Resources/HostileCastingKnockback.json +++ b/Resources/HostileCastingKnockback.json @@ -32,5 +32,12 @@ 28981, 29003, 37662, - 10535 + 10535, + 22769, + 36609, + 36610, + 36611, + 36612, + 37661, + 37662 ] \ No newline at end of file diff --git a/RotationSolver/UI/RotationConfigWindow.cs b/RotationSolver/UI/RotationConfigWindow.cs index f3f96574d..3485c0f29 100644 --- a/RotationSolver/UI/RotationConfigWindow.cs +++ b/RotationSolver/UI/RotationConfigWindow.cs @@ -733,23 +733,27 @@ private static void DrawAbout() { // Draw the clicking count with a specific color using var color = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.2f, 0.6f, 0.95f, 1)); - var countStr = string.Format(UiString.ConfigWindow_About_ClickingCount.GetDescription(), clickingCount); - ImGuiHelper.DrawItemMiddle(() => + var countStr = UiString.ConfigWindow_About_ClickingCount.GetDescription(); + if (countStr != null) { - ImGui.TextWrapped(countStr); - }, width, ImGui.CalcTextSize(countStr).X); + countStr = string.Format(countStr, clickingCount); + ImGuiHelper.DrawItemMiddle(() => + { + ImGui.TextWrapped(countStr); + }, width, ImGui.CalcTextSize(countStr).X); - // Draw the appropriate message based on the clicking count - foreach (var pair in CountStringPair.Reverse()) - { - if (clickingCount >= pair.Key) + // Draw the appropriate message based on the clicking count + foreach (var pair in CountStringPair.Reverse()) { - countStr = pair.Value; - ImGuiHelper.DrawItemMiddle(() => + if (clickingCount >= pair.Key && pair.Value != null) { - ImGui.TextWrapped(countStr); - }, width, ImGui.CalcTextSize(countStr).X); - break; + countStr = pair.Value; + ImGuiHelper.DrawItemMiddle(() => + { + ImGui.TextWrapped(countStr); + }, width, ImGui.CalcTextSize(countStr).X); + break; + } } } } diff --git a/RotationSolver/Updaters/ActionUpdater.cs b/RotationSolver/Updaters/ActionUpdater.cs index 0aa08cfa8..22b031cf9 100644 --- a/RotationSolver/Updaters/ActionUpdater.cs +++ b/RotationSolver/Updaters/ActionUpdater.cs @@ -134,13 +134,13 @@ private unsafe static void UpdateMoving() _startMovingTime = DateTime.Now; } - DataCenter.StopMovingRaw = _stopMovingTime == DateTime.MinValue + DataCenter.StopMovingRaw = DataCenter.IsMoving ? 0 : (float)(DateTime.Now - _stopMovingTime).TotalSeconds; - DataCenter.MovingRaw = _startMovingTime == DateTime.MinValue - ? 0 - : (float)(DateTime.Now - _startMovingTime).TotalSeconds; + DataCenter.MovingRaw = DataCenter.IsMoving + ? (float)(DateTime.Now - _startMovingTime).TotalSeconds + : 0; } static DateTime _startCombatTime = DateTime.MinValue; diff --git a/RotationSolver/Updaters/MajorUpdater.cs b/RotationSolver/Updaters/MajorUpdater.cs index 13fd5a91b..b66fcd259 100644 --- a/RotationSolver/Updaters/MajorUpdater.cs +++ b/RotationSolver/Updaters/MajorUpdater.cs @@ -159,8 +159,9 @@ private static void UpdateWork() // Collect expired VfxNewData items var expiredVfx = new List(); - foreach (var vfx in DataCenter.VfxDataQueue) + for (int i = 0; i < DataCenter.VfxDataQueue.Count; i++) { + var vfx = DataCenter.VfxDataQueue[i]; if (vfx.TimeDuration > TimeSpan.FromSeconds(10)) { expiredVfx.Add(vfx);