From ded6f6bbb296d973e457550995486faca95d4188 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 30 Aug 2024 17:10:54 +0200 Subject: [PATCH 1/6] Always hide 'Cannot execute at this time' while moving, not only during diving --- Questionable/Controller/Steps/Shared/MoveTo.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Questionable/Controller/Steps/Shared/MoveTo.cs b/Questionable/Controller/Steps/Shared/MoveTo.cs index f9e0d690..28562a0b 100644 --- a/Questionable/Controller/Steps/Shared/MoveTo.cs +++ b/Questionable/Controller/Steps/Shared/MoveTo.cs @@ -68,7 +68,7 @@ internal static class MoveTo public ITask Move(MoveParams moveParams) { return new MoveInternal(moveParams, movementController, gameFunctions, - loggerFactory.CreateLogger(), condition, clientState, dataManager); + loggerFactory.CreateLogger(), clientState, dataManager); } public ITask Land() @@ -163,26 +163,22 @@ internal static class MoveTo private readonly string _cannotExecuteAtThisTime; private readonly MovementController _movementController; private readonly ILogger _logger; - private readonly ICondition _condition; private readonly IClientState _clientState; private readonly Action _startAction; private readonly Vector3 _destination; private readonly MoveParams _moveParams; - private readonly bool _isUnderwaterInitially; private bool _canRestart; public MoveInternal(MoveParams moveParams, MovementController movementController, GameFunctions gameFunctions, ILogger logger, - ICondition condition, IClientState clientState, IDataManager dataManager) { _movementController = movementController; _logger = logger; - _condition = condition; _clientState = clientState; _cannotExecuteAtThisTime = dataManager.GetString(579, x => x.Text)!; @@ -257,8 +253,7 @@ internal static class MoveTo public bool OnErrorToast(SeString message) { - if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue) && - _condition[ConditionFlag.Diving]) + if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue)) return true; return false; From 308d4b8253d1b0089ea4a27ff7fc90f822ddab3d Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 30 Aug 2024 20:35:37 +0200 Subject: [PATCH 2/6] Update source gen --- QuestPathGenerator/RoslynElements/QuestStepExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/QuestPathGenerator/RoslynElements/QuestStepExtensions.cs b/QuestPathGenerator/RoslynElements/QuestStepExtensions.cs index 11cdc214..e5b8eabb 100644 --- a/QuestPathGenerator/RoslynElements/QuestStepExtensions.cs +++ b/QuestPathGenerator/RoslynElements/QuestStepExtensions.cs @@ -62,6 +62,9 @@ internal static class QuestStepExtensions Assignment(nameof(QuestStep.IgnoreDistanceToObject), step.IgnoreDistanceToObject, emptyStep.IgnoreDistanceToObject) .AsSyntaxNodeOrToken(), + Assignment(nameof(QuestStep.RestartNavigationIfCancelled), + step.RestartNavigationIfCancelled, emptyStep.RestartNavigationIfCancelled) + .AsSyntaxNodeOrToken(), Assignment(nameof(QuestStep.Comment), step.Comment, emptyStep.Comment) .AsSyntaxNodeOrToken(), Assignment(nameof(QuestStep.Aetheryte), step.Aetheryte, emptyStep.Aetheryte) From a5d75eb0f549de13e8166438b41adac2c926ee30 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 30 Aug 2024 20:35:53 +0200 Subject: [PATCH 3/6] Update some late ARR quests --- .../MSQ-2/E6-2.55/427_The Parting Glass.json | 1 + .../MSQ-2/E6-2.55/428_Before the Dawn.json | 1 + .../Raid Quests/1709_Legacy of Allag.json | 44 +++++++++---------- .../Gold Saucer/435_World of Wonders.json | 18 ++++++++ 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/427_The Parting Glass.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/427_The Parting Glass.json index c02faa3e..28fc2c1b 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/427_The Parting Glass.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/427_The Parting Glass.json @@ -53,6 +53,7 @@ "Y": -0.63573146, "Z": -166.33862 }, + "StopDistance": 5, "TerritoryId": 141, "InteractionType": "Interact" } diff --git a/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/428_Before the Dawn.json b/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/428_Before the Dawn.json index a502544c..0db03bd8 100644 --- a/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/428_Before the Dawn.json +++ b/QuestPaths/2.x - A Realm Reborn/MSQ-2/E6-2.55/428_Before the Dawn.json @@ -35,6 +35,7 @@ }, "TerritoryId": 155, "InteractionType": "CompleteQuest", + "Mount": true, "DialogueChoices": [ { "Type": "YesNo", diff --git a/QuestPaths/2.x - A Realm Reborn/Raid Quests/1709_Legacy of Allag.json b/QuestPaths/2.x - A Realm Reborn/Raid Quests/1709_Legacy of Allag.json index 687fc403..1e363fb4 100644 --- a/QuestPaths/2.x - A Realm Reborn/Raid Quests/1709_Legacy of Allag.json +++ b/QuestPaths/2.x - A Realm Reborn/Raid Quests/1709_Legacy of Allag.json @@ -337,16 +337,6 @@ "InteractionType": "WalkTo", "Fly": true }, - { - "Position": { - "X": 233.0817, - "Y": 8, - "Z": -21.83023 - }, - "TerritoryId": 146, - "InteractionType": "WalkTo", - "Fly": true - }, { "DataId": 2000077, "Position": { @@ -360,18 +350,16 @@ "KillEnemyDataIds": [ 9489 ], - "$": "0 0 0 0 0 0 -> 16 17 0 0 0 128" - }, - { - "Position": { - "X": 614.4023, - "Y": 301.81046, - "Z": -101.94888 - }, - "TerritoryId": 155, - "InteractionType": "WalkTo", - "Fly": true, - "AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead" + "$": "0 0 0 0 0 0 -> 16 17 0 0 0 128", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 128 + ], + "Fly": true }, { "DataId": 2000078, @@ -386,7 +374,17 @@ "KillEnemyDataIds": [ 9490 ], - "$": "16 17 0 0 0 128 -> 0 17 0 0 0 0" + "Fly": true, + "AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead", + "$": "16 17 0 0 0 128 -> 0 17 0 0 0 0", + "CompletionQuestVariablesFlags": [ + null, + null, + null, + null, + null, + 64 + ] } ] }, diff --git a/QuestPaths/2.x - A Realm Reborn/Unlocks/Gold Saucer/435_World of Wonders.json b/QuestPaths/2.x - A Realm Reborn/Unlocks/Gold Saucer/435_World of Wonders.json index 7831f300..f6dce677 100644 --- a/QuestPaths/2.x - A Realm Reborn/Unlocks/Gold Saucer/435_World of Wonders.json +++ b/QuestPaths/2.x - A Realm Reborn/Unlocks/Gold Saucer/435_World of Wonders.json @@ -191,6 +191,15 @@ "AethernetShard": "[Gold Saucer] Cactpot Board", "DelaySecondsAtStart": 3 }, + { + "Position": { + "X": 111.36922, + "Y": 13.000123, + "Z": -24.209782 + }, + "TerritoryId": 144, + "InteractionType": "WalkTo" + }, { "DataId": 1011079, "Position": { @@ -207,6 +216,15 @@ { "Sequence": 6, "Steps": [ + { + "Position": { + "X": 111.36922, + "Y": 13.000123, + "Z": -24.209782 + }, + "TerritoryId": 144, + "InteractionType": "WalkTo" + }, { "TerritoryId": 144, "InteractionType": "None", From de7cf2a94fec6d2317d33d34a888d806a8e316f6 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Fri, 30 Aug 2024 21:40:42 +0200 Subject: [PATCH 4/6] Handle accepting quests via 'PickupQuestId' if NPC offers multiple quests --- .../Controller/GameUi/InteractionUiController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Questionable/Controller/GameUi/InteractionUiController.cs b/Questionable/Controller/GameUi/InteractionUiController.cs index e630d7d6..21c95d29 100644 --- a/Questionable/Controller/GameUi/InteractionUiController.cs +++ b/Questionable/Controller/GameUi/InteractionUiController.cs @@ -235,6 +235,16 @@ internal sealed class InteractionUiController : IDisposable _logger.LogInformation("Checking if current quest {Name} is on the list", currentQuest.Quest.Info.Name); if (CheckQuestSelection(addonSelectIconString, currentQuest.Quest, answers)) return; + + var sequence = currentQuest.Quest.FindSequence(currentQuest.Sequence); + QuestStep? step = sequence?.FindStep(currentQuest.Step); + if (step is { InteractionType: EInteractionType.AcceptQuest, PickUpQuestId: not null } && + _questRegistry.TryGetQuest(step.PickUpQuestId, out Quest? pickupQuest)) + { + _logger.LogInformation("Checking if current picked-up {Name} is on the list", pickupQuest.Info.Name); + if (CheckQuestSelection(addonSelectIconString, pickupQuest, answers)) + return; + } } var nextQuest = _questController.NextQuest; From 1572ff11a8aa752e1a0f4215f0037cc3b350452b Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 31 Aug 2024 14:03:53 +0200 Subject: [PATCH 5/6] Add IPC methods IsRunning/GetCurrentQuestId --- Questionable/External/QuestionableIpc.cs | 31 ++++++++++++++++++++++++ Questionable/QuestionablePlugin.cs | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 Questionable/External/QuestionableIpc.cs diff --git a/Questionable/External/QuestionableIpc.cs b/Questionable/External/QuestionableIpc.cs new file mode 100644 index 00000000..e73053ef --- /dev/null +++ b/Questionable/External/QuestionableIpc.cs @@ -0,0 +1,31 @@ +using System; +using Dalamud.Plugin; +using Dalamud.Plugin.Ipc; +using Questionable.Controller; + +namespace Questionable.External; + +internal sealed class QuestionableIpc : IDisposable +{ + private const string IpcIsRunning = "Questionable.IsRunning"; + private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId"; + + private readonly ICallGateProvider _isRunning; + private readonly ICallGateProvider _getCurrentQuestId; + + public QuestionableIpc(QuestController questController, IDalamudPluginInterface pluginInterface) + { + _isRunning = pluginInterface.GetIpcProvider(IpcIsRunning); + _isRunning.RegisterFunc(() => questController.IsRunning); + + _getCurrentQuestId = pluginInterface.GetIpcProvider(IpcGetCurrentQuestId); + _getCurrentQuestId.RegisterFunc(() => questController.CurrentQuest?.Quest.Id.ToString()); + } + + + public void Dispose() + { + _getCurrentQuestId.UnregisterFunc(); + _isRunning.UnregisterFunc(); + } +} diff --git a/Questionable/QuestionablePlugin.cs b/Questionable/QuestionablePlugin.cs index 207cf2b1..d1a5b543 100644 --- a/Questionable/QuestionablePlugin.cs +++ b/Questionable/QuestionablePlugin.cs @@ -120,6 +120,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); } private static void AddTaskFactories(ServiceCollection serviceCollection) @@ -235,6 +236,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin serviceProvider.GetRequiredService(); serviceProvider.GetRequiredService(); serviceProvider.GetRequiredService(); + serviceProvider.GetRequiredService(); serviceProvider.GetRequiredService(); } From aaad336c64b583d27ff27f02056101fb4cf82375 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sat, 31 Aug 2024 14:04:07 +0200 Subject: [PATCH 6/6] Fix next quest display --- Questionable/Windows/QuestComponents/ActiveQuestComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs index 6d4a4384..b1ffd40b 100644 --- a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs @@ -177,7 +177,7 @@ internal sealed partial class ActiveQuestComponent { using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); ImGui.TextUnformatted( - $"Next Quest: {Shorten(currentQuest.Quest.Info.Name)} / {currentQuest.Sequence} / {currentQuest.Step}"); + $"Next Quest: {Shorten(nextQuest.Quest.Info.Name)} / {nextQuest.Sequence} / {nextQuest.Step}"); } } }