Add 'EquipRecommended' task
This commit is contained in:
parent
d5e62ebc15
commit
2c77dc479f
@ -110,6 +110,7 @@
|
||||
"Combat",
|
||||
"UseItem",
|
||||
"EquipItem",
|
||||
"EquipRecommended",
|
||||
"Say",
|
||||
"Emote",
|
||||
"Action",
|
||||
|
@ -16,6 +16,7 @@ public sealed class InteractionTypeConverter() : EnumConverter<EInteractionType>
|
||||
{ EInteractionType.Combat, "Combat" },
|
||||
{ EInteractionType.UseItem, "UseItem" },
|
||||
{ EInteractionType.EquipItem, "EquipItem" },
|
||||
{ EInteractionType.EquipRecommended, "EquipRecommended" },
|
||||
{ EInteractionType.Say, "Say" },
|
||||
{ EInteractionType.Emote, "Emote" },
|
||||
{ EInteractionType.Action, "Action" },
|
||||
|
@ -15,6 +15,7 @@ public enum EInteractionType
|
||||
Combat,
|
||||
UseItem,
|
||||
EquipItem,
|
||||
EquipRecommended,
|
||||
Say,
|
||||
Emote,
|
||||
Action,
|
||||
|
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.Steps.Interactions;
|
||||
|
||||
internal static class EquipRecommended
|
||||
{
|
||||
internal sealed class Factory(IServiceProvider serviceProvider) : ITaskFactory
|
||||
{
|
||||
public ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
if (step.InteractionType != EInteractionType.EquipRecommended)
|
||||
return null;
|
||||
|
||||
return serviceProvider.GetRequiredService<DoEquipRecommended>();
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed unsafe class DoEquipRecommended(IClientState clientState) : ITask
|
||||
{
|
||||
private bool _equipped;
|
||||
|
||||
public bool Start()
|
||||
{
|
||||
RecommendEquipModule.Instance()->SetupForClassJob((byte)clientState.LocalPlayer!.ClassJob.Id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public ETaskResult Update()
|
||||
{
|
||||
if (RecommendEquipModule.Instance()->IsUpdating)
|
||||
return ETaskResult.StillRunning;
|
||||
|
||||
if (!_equipped)
|
||||
{
|
||||
RecommendEquipModule.Instance()->EquipRecommendedGear();
|
||||
_equipped = true;
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
|
||||
public override string ToString() => "EquipRecommended";
|
||||
}
|
||||
}
|
@ -151,6 +151,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
|
||||
.AddTaskWithFactory<UseItem.Factory, UseItem.UseOnGround, UseItem.UseOnObject, UseItem.Use,
|
||||
UseItem.UseOnPosition>();
|
||||
serviceCollection.AddTaskWithFactory<EquipItem.Factory, EquipItem.DoEquip>();
|
||||
serviceCollection.AddTaskWithFactory<EquipRecommended.Factory, EquipRecommended.DoEquipRecommended>();
|
||||
serviceCollection.AddTaskWithFactory<TurnInDelivery.Factory, TurnInDelivery.SatisfactionSupplyTurnIn>();
|
||||
serviceCollection
|
||||
.AddTaskWithFactory<SinglePlayerDuty.Factory, SinglePlayerDuty.DisableYesAlready,
|
||||
|
Loading…
Reference in New Issue
Block a user