From f5febcaf7ffab2de08f69a0d2f59c87086a73a32 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 23 Mar 2025 00:18:52 +0100 Subject: [PATCH] [7.2] Add RSR confirmation --- .../GeneralConfigComponent.cs | 78 +++++++++++++++++-- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/Questionable/Windows/ConfigComponents/GeneralConfigComponent.cs b/Questionable/Windows/ConfigComponents/GeneralConfigComponent.cs index dedce924..3dd0779a 100644 --- a/Questionable/Windows/ConfigComponents/GeneralConfigComponent.cs +++ b/Questionable/Windows/ConfigComponents/GeneralConfigComponent.cs @@ -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(); + } } -- 2.30.2