Automatically select 'Mouse/Keyboard' for new characters
authorLiza Carvelli <liza@carvel.li>
Mon, 18 Aug 2025 21:47:31 +0000 (23:47 +0200)
committerLiza Carvelli <liza@carvel.li>
Mon, 18 Aug 2025 22:33:40 +0000 (00:33 +0200)
QuestPaths/2.x - A Realm Reborn/MSQ-1/Gridania/39_Coming to Gridania.json
QuestPaths/2.x - A Realm Reborn/MSQ-1/Limsa/107_Coming to Limsa Lominsa.json
QuestPaths/2.x - A Realm Reborn/MSQ-1/Ul'dah/594_Coming to Ul'dah.json
Questionable/Controller/GameUi/InteractionUiController.cs
Questionable/DalamudInitializer.cs

index 1db1d6e18205db07dfab86493f2ce50ee1d46e1a..9026dd6eea6ae623b3a6cc047f2527b3729c722f 100644 (file)
             "Z": 143.63306
           },
           "TerritoryId": 183,
-          "InteractionType": "AcceptQuest"
+          "InteractionType": "AcceptQuest",
+          "DialogueChoices": [
+            {
+              "Type": "List",
+              "ExcelSheet": "opening/OpeningGridania",
+              "Prompt": "TEXT_OPENINGGRIDANIA_FST_SYSTEM_Q_01",
+              "Answer": "TEXT_OPENINGGRIDANIA_FST_SYSTEM_A_01"
+            }
+          ]
         }
       ]
     },
index e6c6a168a8a4695baf515cd4138d4f6291641627..98842cc81d72a427788857f978ce4bb8f673ebd0 100644 (file)
             "Z": -4.9592285
           },
           "TerritoryId": 181,
-          "InteractionType": "AcceptQuest"
+          "InteractionType": "AcceptQuest",
+          "DialogueChoices": [
+            {
+              "Type": "List",
+              "ExcelSheet": "opening/OpeningLimsaLominsa",
+              "Prompt": "TEXT_OPENINGLIMSALOMINSA_FST_SYSTEM_Q_01",
+              "Answer": "TEXT_OPENINGLIMSALOMINSA_FST_SYSTEM_A_01"
+            }
+          ]
         }
       ]
     },
index 8a0fae6cac1e51485d834edf5284d7b4ee853697..d77f339b2e6623bd8f31ca300c6660ccbe38e7b1 100644 (file)
             "Z": -151.99518
           },
           "TerritoryId": 182,
-          "InteractionType": "AcceptQuest"
+          "InteractionType": "AcceptQuest",
+          "DialogueChoices": [
+            {
+              "Type": "List",
+              "ExcelSheet": "opening/OpeningUldah",
+              "Prompt": "TEXT_OPENINGULDAH_FST_SYSTEM_Q_01",
+              "Answer": "TEXT_OPENINGULDAH_FST_SYSTEM_A_01"
+            }
+          ]
         }
       ]
     },
index e5bb01feae7f46af8f5d45e4819d2773cfd1a6d7..66de0e17705c724c5a14638f803bcf5a663072b7 100644 (file)
@@ -93,6 +93,7 @@ internal sealed class InteractionUiController : IDisposable
         _returnRegex = _dataManager.GetExcelSheet<Addon>().GetRow(196).GetRegex(addon => addon.Text, pluginLog)!;
         _purchaseItemRegex = _dataManager.GetRegex<Addon>(3406, addon => addon.Text, pluginLog)!;
 
+        _questController.AutomationTypeChanged += HandleCurrentDialogueChoices;
         _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectString", SelectStringPostSetup);
         _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "CutSceneSelectString", CutsceneSelectStringPostSetup);
         _addonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectIconString", SelectIconStringPostSetup);
@@ -114,6 +115,12 @@ internal sealed class InteractionUiController : IDisposable
                                                _questController.IsRunning ||
                                                _territoryData.IsQuestBattleInstance(_clientState.TerritoryType);
 
+    private void HandleCurrentDialogueChoices(object sender, QuestController.EAutomationType automationType)
+    {
+        if (automationType != QuestController.EAutomationType.Manual)
+            HandleCurrentDialogueChoices();
+    }
+
     internal unsafe void HandleCurrentDialogueChoices()
     {
         try
@@ -970,6 +977,7 @@ internal sealed class InteractionUiController : IDisposable
         _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "SelectIconString", SelectIconStringPostSetup);
         _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "CutSceneSelectString", CutsceneSelectStringPostSetup);
         _addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "SelectString", SelectStringPostSetup);
+        _questController.AutomationTypeChanged -= HandleCurrentDialogueChoices;
     }
 
     private sealed record DialogueChoiceInfo(Quest? Quest, DialogueChoice DialogueChoice);
index a975b817dbf87a4ed9135006c356dc6dd1adce95..7550a8d89478ae5c3d35917e90b0984958190544 100644 (file)
@@ -73,7 +73,6 @@ internal sealed class DalamudInitializer : IDisposable
         _pluginInterface.UiBuilder.OpenMainUi += ToggleQuestWindow;
         _pluginInterface.UiBuilder.OpenConfigUi += _configWindow.Toggle;
         _framework.Update += FrameworkUpdate;
-        _framework.RunOnTick(interactionUiController.HandleCurrentDialogueChoices, TimeSpan.FromMilliseconds(200));
         _toastGui.Toast += OnToast;
         _toastGui.ErrorToast += OnErrorToast;
         _toastGui.QuestToast += OnQuestToast;