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 1db1d6e..9026dd6 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 e6c6a16..98842cc 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 8a0fae6..d77f339 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 e5bb01f..66de0e1 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 a975b81..7550a8d 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;