Remove YA interaction for SinglePlayerDuty; remove data id being required for accept/complete quest + SinglePlayerDuty
This commit is contained in:
parent
263e0b9a24
commit
fdb8eed7a4
@ -397,23 +397,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"if": {
|
|
||||||
"properties": {
|
|
||||||
"InteractionType": {
|
|
||||||
"const": "SinglePlayerDuty"
|
|
||||||
},
|
|
||||||
"Emote": {
|
|
||||||
"not": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"then": {
|
|
||||||
"required": [
|
|
||||||
"DataId"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"if": {
|
"if": {
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -20,10 +20,14 @@ internal static class Interact
|
|||||||
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
|
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
|
||||||
{
|
{
|
||||||
if (step.InteractionType is EInteractionType.AcceptQuest or EInteractionType.CompleteQuest
|
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)
|
if (step.Emote != null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
|
if (step.DataId == null)
|
||||||
|
yield break;
|
||||||
}
|
}
|
||||||
else if (step.InteractionType != EInteractionType.Interact)
|
else if (step.InteractionType != EInteractionType.Interact)
|
||||||
yield break;
|
yield break;
|
||||||
|
@ -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<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";
|
|
||||||
}
|
|
||||||
}
|
|
@ -154,9 +154,6 @@ public sealed class QuestionablePlugin : IDalamudPlugin
|
|||||||
serviceCollection.AddTaskWithFactory<EquipItem.Factory, EquipItem.DoEquip>();
|
serviceCollection.AddTaskWithFactory<EquipItem.Factory, EquipItem.DoEquip>();
|
||||||
serviceCollection.AddTaskWithFactory<EquipRecommended.Factory, EquipRecommended.DoEquipRecommended>();
|
serviceCollection.AddTaskWithFactory<EquipRecommended.Factory, EquipRecommended.DoEquipRecommended>();
|
||||||
serviceCollection.AddTaskWithFactory<TurnInDelivery.Factory, TurnInDelivery.SatisfactionSupplyTurnIn>();
|
serviceCollection.AddTaskWithFactory<TurnInDelivery.Factory, TurnInDelivery.SatisfactionSupplyTurnIn>();
|
||||||
serviceCollection
|
|
||||||
.AddTaskWithFactory<SinglePlayerDuty.Factory, SinglePlayerDuty.DisableYesAlready,
|
|
||||||
SinglePlayerDuty.RestoreYesAlready>();
|
|
||||||
serviceCollection
|
serviceCollection
|
||||||
.AddTaskWithFactory<InitiateLeve.Factory,
|
.AddTaskWithFactory<InitiateLeve.Factory,
|
||||||
InitiateLeve.SkipInitiateIfActive,
|
InitiateLeve.SkipInitiateIfActive,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
@ -119,6 +120,8 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw()
|
public override void Draw()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_activeQuestComponent.Draw(IsMinimized);
|
_activeQuestComponent.Draw(IsMinimized);
|
||||||
if (!IsMinimized)
|
if (!IsMinimized)
|
||||||
@ -138,6 +141,11 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
|
|||||||
_remainingTasksComponent.Draw();
|
_remainingTasksComponent.Draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
ImGui.TextColored(ImGuiColors.DalamudRed, e.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnReload(object? sender, EventArgs e) => Reload();
|
private void OnReload(object? sender, EventArgs e) => Reload();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user