public IEnumerable<ITask> 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;
+++ /dev/null
-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<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
- {
- if (step.InteractionType != EInteractionType.SinglePlayerDuty)
- return [];
-
- ArgumentNullException.ThrowIfNull(step.DataId);
- return
- [
- serviceProvider.GetRequiredService<DisableYesAlready>(),
- serviceProvider.GetRequiredService<Interact.DoInteract>()
- .With(step.DataId.Value, quest, EInteractionType.None, true),
- serviceProvider.GetRequiredService<RestoreYesAlready>()
- ];
- }
-
- 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";
- }
-}
serviceCollection.AddTaskWithFactory<EquipItem.Factory, EquipItem.DoEquip>();
serviceCollection.AddTaskWithFactory<EquipRecommended.Factory, EquipRecommended.DoEquipRecommended>();
serviceCollection.AddTaskWithFactory<TurnInDelivery.Factory, TurnInDelivery.SatisfactionSupplyTurnIn>();
- serviceCollection
- .AddTaskWithFactory<SinglePlayerDuty.Factory, SinglePlayerDuty.DisableYesAlready,
- SinglePlayerDuty.RestoreYesAlready>();
serviceCollection
.AddTaskWithFactory<InitiateLeve.Factory,
InitiateLeve.SkipInitiateIfActive,
using System;
using System.Numerics;
using Dalamud.Interface;
+using Dalamud.Interface.Colors;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using ImGuiNET;
public override void Draw()
{
- _activeQuestComponent.Draw(IsMinimized);
- if (!IsMinimized)
+ try
{
- ImGui.Separator();
-
- if (_aRealmRebornComponent.ShouldDraw)
+ _activeQuestComponent.Draw(IsMinimized);
+ if (!IsMinimized)
{
- _aRealmRebornComponent.Draw();
ImGui.Separator();
- }
- _creationUtilsComponent.Draw();
- ImGui.Separator();
+ if (_aRealmRebornComponent.ShouldDraw)
+ {
+ _aRealmRebornComponent.Draw();
+ ImGui.Separator();
+ }
+
+ _creationUtilsComponent.Draw();
+ ImGui.Separator();
- _quickAccessButtonsComponent.Draw();
- _remainingTasksComponent.Draw();
+ _quickAccessButtonsComponent.Draw();
+ _remainingTasksComponent.Draw();
+ }
+ }
+ catch (Exception e)
+ {
+ ImGui.TextColored(ImGuiColors.DalamudRed, e.ToString());
}
}