diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index c8533fdf6..96560c310 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -397,23 +397,6 @@ ] } }, - { - "if": { - "properties": { - "InteractionType": { - "const": "SinglePlayerDuty" - }, - "Emote": { - "not": true - } - } - }, - "then": { - "required": [ - "DataId" - ] - } - }, { "if": { "properties": { diff --git a/Questionable/Controller/Steps/Interactions/Interact.cs b/Questionable/Controller/Steps/Interactions/Interact.cs index dc50ac06a..9fc576384 100644 --- a/Questionable/Controller/Steps/Interactions/Interact.cs +++ b/Questionable/Controller/Steps/Interactions/Interact.cs @@ -20,10 +20,14 @@ internal static class Interact public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) { if (step.InteractionType is EInteractionType.AcceptQuest or EInteractionType.CompleteQuest - or EInteractionType.AcceptLeve or EInteractionType.CompleteLeve) + or EInteractionType.AcceptLeve or EInteractionType.CompleteLeve + or EInteractionType.SinglePlayerDuty) { if (step.Emote != null) yield break; + + if (step.DataId == null) + yield break; } else if (step.InteractionType != EInteractionType.Interact) yield break; diff --git a/Questionable/Controller/Steps/Interactions/SinglePlayerDuty.cs b/Questionable/Controller/Steps/Interactions/SinglePlayerDuty.cs deleted file mode 100644 index 0e1dbf8ce..000000000 --- a/Questionable/Controller/Steps/Interactions/SinglePlayerDuty.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using Dalamud.Plugin.Services; -using Microsoft.Extensions.DependencyInjection; -using Questionable.External; -using Questionable.Model; -using Questionable.Model.Questing; - -namespace Questionable.Controller.Steps.Interactions; - -internal static class SinglePlayerDuty -{ - internal sealed class Factory(IServiceProvider serviceProvider) : ITaskFactory - { - public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) - { - if (step.InteractionType != EInteractionType.SinglePlayerDuty) - return []; - - ArgumentNullException.ThrowIfNull(step.DataId); - return - [ - serviceProvider.GetRequiredService(), - serviceProvider.GetRequiredService() - .With(step.DataId.Value, quest, EInteractionType.None, true), - serviceProvider.GetRequiredService() - ]; - } - - public ITask CreateTask(Quest quest, QuestSequence sequence, QuestStep step) - => throw new InvalidOperationException(); - } - - internal sealed class DisableYesAlready(YesAlreadyIpc yesAlreadyIpc) : ITask - { - public bool Start() - { - yesAlreadyIpc.DisableYesAlready(); - return true; - } - - public ETaskResult Update() => ETaskResult.TaskComplete; - - public override string ToString() => "DisableYA"; - } - - internal sealed class RestoreYesAlready(YesAlreadyIpc yesAlreadyIpc, IGameGui gameGui) : ITask - { - public bool Start() => true; - - public ETaskResult Update() - { - if (gameGui.GetAddonByName("SelectYesno") != nint.Zero || - gameGui.GetAddonByName("DifficultySelectYesNo") != nint.Zero) - return ETaskResult.StillRunning; - - yesAlreadyIpc.RestoreYesAlready(); - return ETaskResult.TaskComplete; - } - - public override string ToString() => "Wait(DialogClosed) → RestoreYA"; - } -} diff --git a/Questionable/QuestionablePlugin.cs b/Questionable/QuestionablePlugin.cs index 4a9702f85..1068f274a 100644 --- a/Questionable/QuestionablePlugin.cs +++ b/Questionable/QuestionablePlugin.cs @@ -154,9 +154,6 @@ public sealed class QuestionablePlugin : IDalamudPlugin serviceCollection.AddTaskWithFactory(); serviceCollection.AddTaskWithFactory(); serviceCollection.AddTaskWithFactory(); - serviceCollection - .AddTaskWithFactory(); serviceCollection .AddTaskWithFactory