diff --git a/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs b/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs index ebbe32a39..b3584af66 100644 --- a/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs +++ b/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs @@ -88,11 +88,8 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO } } - if(CastTime > 0) - { - if (DataCenter.IsMoving && - !player.HasStatus(true, CustomRotation.Swiftcast.StatusProvide)) return false; - } + if (CastTime > 0 && DataCenter.IsMoving && + !player.HasStatus(true, CustomRotation.Swiftcast.StatusProvide)) return false; if (IsGeneralGCD && IsEot && IsFriendly && IActionHelper.IsLastGCD(true, this) && DataCenter.TimeSinceLastAction.TotalSeconds < 3) return false; diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs index 15c38c88c..31ab2c936 100644 --- a/RotationSolver/UI/ImGuiHelper.cs +++ b/RotationSolver/UI/ImGuiHelper.cs @@ -421,7 +421,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation ImGui.PushStyleColor(ImGuiCol.Text, r.GetColor()); if (ImGui.Selectable(r.RotationName)) { - Service.Config.RotationChoices[rotation.Job.RowId] = r.RotationName; + Service.Config.RotationChoices[rotation.Job.RowId] = r.GetType().FullName; Service.Config.Save(); } if (ImGui.IsItemHovered()) diff --git a/RotationSolver/UI/RotationConfigWindow_Rotation.cs b/RotationSolver/UI/RotationConfigWindow_Rotation.cs index b09c78f4b..1c3220217 100644 --- a/RotationSolver/UI/RotationConfigWindow_Rotation.cs +++ b/RotationSolver/UI/RotationConfigWindow_Rotation.cs @@ -52,8 +52,7 @@ private static void DrawRotations(RotationUpdater.CustomRotationGroup[] rotation if (i > 0) ImGui.Separator(); var group = rotations[i]; - Service.Config.RotationChoices.TryGetValue((uint)group.jobId, out var rotationName); - var rotation = RotationUpdater.GetChooseRotation(group, rotationName); + var rotation = RotationUpdater.GetChooseRotation(group); var canAddButton = Service.Player != null && rotation.JobIDs.Contains((ClassJobID)Service.Player.ClassJob.Id); diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index 23caa60e4..e8d8c53a2 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -133,13 +133,12 @@ public static IEnumerable> AllGroupedActions public static void UpdateRotation() { var nowJob = (ClassJobID)Service.Player.ClassJob.Id; - Service.Config.RotationChoices.TryGetValue((uint)nowJob, out var newName); foreach (var group in _customRotations) { if (!group.classJobIds.Contains(nowJob)) continue; - RightNowRotation = GetChooseRotation(group, newName); + RightNowRotation = GetChooseRotation(group); RightRotationBaseActions = RightNowRotation.AllBaseActions; return; } @@ -147,9 +146,11 @@ public static void UpdateRotation() RightRotationBaseActions = new IBaseAction[0]; } - internal static ICustomRotation GetChooseRotation(CustomRotationGroup group, string name) + internal static ICustomRotation GetChooseRotation(CustomRotationGroup group) { - var rotation = group.rotations.FirstOrDefault(r => r.RotationName == name); + Service.Config.RotationChoices.TryGetValue((uint)group.jobId, out var name); + + var rotation = group.rotations.FirstOrDefault(r => r.GetType().FullName == name); rotation ??= group.rotations.FirstOrDefault(RotationHelper.IsDefault); rotation ??= group.rotations.FirstOrDefault(r => r.IsAllowed(out _)); rotation ??= group.rotations.FirstOrDefault();