[7.2] Add RSR confirmation
authorLiza Carvelli <liza@carvel.li>
Sat, 22 Mar 2025 23:18:52 +0000 (00:18 +0100)
committerLiza Carvelli <liza@carvel.li>
Sat, 22 Mar 2025 23:18:52 +0000 (00:18 +0100)
Questionable/Windows/ConfigComponents/GeneralConfigComponent.cs

index dedce924579d34a559e7e20b3b6c2b6d72ebcf4b..3dd0779a4c38e0f0054829e972d13c62254175c2 100644 (file)
@@ -1,7 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using Dalamud.Interface;
 using Dalamud.Interface.Colors;
+using Dalamud.Interface.Components;
 using Dalamud.Interface.Utility.Raii;
 using Dalamud.Plugin;
 using Dalamud.Plugin.Services;
@@ -31,6 +33,8 @@ internal sealed class GeneralConfigComponent : ConfigComponent
     private readonly EClassJob[] _classJobIds;
     private readonly string[] _classJobNames;
 
+    private Configuration.ECombatModule? _pendingCombatModule;
+
     public GeneralConfigComponent(
         IDalamudPluginInterface pluginInterface,
         Configuration configuration,
@@ -69,13 +73,7 @@ internal sealed class GeneralConfigComponent : ConfigComponent
 
         using (ImRaii.Disabled(_combatController.IsRunning))
         {
-            int selectedCombatModule = (int)Configuration.General.CombatModule;
-            if (ImGui.Combo("Preferred Combat Module", ref selectedCombatModule, _combatModuleNames,
-                    _combatModuleNames.Length))
-            {
-                Configuration.General.CombatModule = (Configuration.ECombatModule)selectedCombatModule;
-                Save();
-            }
+            DrawCombatModule();
         }
 
         int selectedMount = Array.FindIndex(_mountIds, x => x == Configuration.General.MountId);
@@ -157,4 +155,70 @@ internal sealed class GeneralConfigComponent : ConfigComponent
             }
         }
     }
+
+    private void DrawCombatModule()
+    {
+        using (_ = ImRaii.Disabled(_pendingCombatModule != null))
+        {
+            int selectedCombatModule = (int)Configuration.General.CombatModule;
+            if (ImGui.Combo("Preferred Combat Module", ref selectedCombatModule, _combatModuleNames,
+                    _combatModuleNames.Length))
+            {
+                if (selectedCombatModule == (int)Configuration.ECombatModule.RotationSolverReborn)
+                {
+                    Configuration.General.CombatModule = Configuration.ECombatModule.None;
+                    _pendingCombatModule = Configuration.ECombatModule.RotationSolverReborn;
+                }
+                else
+                {
+                    Configuration.General.CombatModule = (Configuration.ECombatModule)selectedCombatModule;
+                    _pendingCombatModule = null;
+                }
+                Save();
+            }
+
+            if (Configuration.General.CombatModule == Configuration.ECombatModule.RotationSolverReborn)
+            {
+                ImGuiComponents.HelpMarker("The 'Rotation Solver Reborn' module will be removed in Patch 7.3.", FontAwesomeIcon.ExclamationTriangle, ImGuiColors.DalamudYellow);
+            }
+        }
+
+        if (_pendingCombatModule == null)
+            return;
+
+        using var indent = ImRaii.PushIndent();
+
+        ImGui.TextColored(ImGuiColors.DalamudYellow, "The 'Rotation Solver Reborn' module is unsupported, obsolete and will be removed in Patch 7.3.");
+        ImGui.Text("According to the RSR development team, RSR is not meant to run without human inputs/automatically/as bot.");
+        ImGui.Text("Additionally, they have considered disabling RSR if it detects that Questionable is installed.");
+        ImGui.Text("Please consider switching to 'Wrath Combo' or 'Boss Mod (VBM)'.");
+
+        if (ImGui.Button("Use 'Wrath Combo'"))
+        {
+            Configuration.General.CombatModule = Configuration.ECombatModule.WrathCombo;
+            _pendingCombatModule = null;
+            Save();
+        }
+
+        ImGui.SameLine();
+
+        if (ImGui.Button("Use 'Boss Mod (VBM)'"))
+        {
+            Configuration.General.CombatModule = Configuration.ECombatModule.BossMod;
+            _pendingCombatModule = null;
+            Save();
+        }
+
+        ImGui.SameLine();
+
+        if (ImGui.Button("Use 'Rotation Solver Reborn'"))
+        {
+            Configuration.General.CombatModule = Configuration.ECombatModule.RotationSolverReborn;
+            _pendingCombatModule = null;
+            Save();
+        }
+
+
+        ImGui.Separator();
+    }
 }