muffin v7.38.8
This commit is contained in:
parent
5e2d8f648b
commit
3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions
|
|
@ -0,0 +1,53 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.DebugCommands;
|
||||
|
||||
internal sealed class NextQuestCommandHandler : IDebugCommandHandler
|
||||
{
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly QuestRegistry _questRegistry;
|
||||
|
||||
private readonly QuestFunctions _questFunctions;
|
||||
|
||||
private readonly IChatGui _chatGui;
|
||||
|
||||
public string CommandName => "next";
|
||||
|
||||
public NextQuestCommandHandler(QuestController questController, QuestRegistry questRegistry, QuestFunctions questFunctions, IChatGui chatGui)
|
||||
{
|
||||
_questController = questController;
|
||||
_questRegistry = questRegistry;
|
||||
_questFunctions = questFunctions;
|
||||
_chatGui = chatGui;
|
||||
}
|
||||
|
||||
public void Execute(string[] arguments)
|
||||
{
|
||||
if (arguments.Length >= 1 && ElementId.TryFromString(arguments[0], out ElementId elementId) && elementId != null)
|
||||
{
|
||||
Quest quest;
|
||||
if (_questFunctions.IsQuestLocked(elementId))
|
||||
{
|
||||
_chatGui.PrintError($"Quest {elementId} is locked.", "Questionable", 576);
|
||||
}
|
||||
else if (_questRegistry.TryGetQuest(elementId, out quest))
|
||||
{
|
||||
_questController.SetNextQuest(quest);
|
||||
_chatGui.Print($"Set next quest to {elementId} ({quest.Info.Name}).", "Questionable", 576);
|
||||
}
|
||||
else
|
||||
{
|
||||
_chatGui.PrintError($"Unknown quest {elementId}.", "Questionable", 576);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_questController.SetNextQuest(null);
|
||||
_chatGui.Print("Cleared next quest.", "Questionable", 576);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue