master #3

Open
cacahuetes wants to merge 653 commits from liza/Questionable:master into cacahuetes-ShB-Healer
3 changed files with 26 additions and 9 deletions
Showing only changes of commit ea42b5b8df - Show all commits

View File

@ -205,7 +205,24 @@ internal sealed class CommandHandler : IDisposable
{
if (_questRegistry.TryGetQuest(questId, out Quest? quest))
{
_questController.SimulateQuest(quest);
byte sequenceId = 0;
int stepId = 0;
if (arguments.Length >= 2 && byte.TryParse(arguments[1], out byte parsedSequence))
{
QuestSequence? sequence = quest.FindSequence(parsedSequence);
if (sequence != null)
{
sequenceId = (byte)sequence.Sequence;
if (arguments.Length >= 3 && int.TryParse(arguments[2], out int parsedStep))
{
QuestStep? step = sequence.FindStep(parsedStep);
if (step != null)
stepId = parsedStep;
}
}
}
_questController.SimulateQuest(quest, sequenceId, stepId);
_chatGui.Print($"Simulating quest {questId} ({quest.Info.Name}).", MessageTag, TagColor);
}
else
@ -213,7 +230,7 @@ internal sealed class CommandHandler : IDisposable
}
else
{
_questController.SimulateQuest(null);
_questController.SimulateQuest(null, 0, 0);
_chatGui.Print("Cleared simulated quest.", MessageTag, TagColor);
}
}

View File

@ -509,11 +509,11 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
Stop(label);
}
public void SimulateQuest(Quest? quest)
public void SimulateQuest(Quest? quest, byte sequence, int step)
{
_logger.LogInformation("SimulateQuest: {QuestId}", quest?.Id);
if (quest != null)
_simulatedQuest = new QuestProgress(quest);
_simulatedQuest = new QuestProgress(quest, sequence, step);
else
_simulatedQuest = null;
}
@ -675,16 +675,16 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
public int Step { get; private set; }
public StepProgress StepProgress { get; private set; } = new(DateTime.Now);
public QuestProgress(Quest quest, byte sequence = 0)
public QuestProgress(Quest quest, byte sequence = 0, int step = 0)
{
Quest = quest;
SetSequence(sequence);
SetSequence(sequence, step);
}
public void SetSequence(byte sequence)
public void SetSequence(byte sequence, int step = 0)
{
Sequence = sequence;
SetStep(0);
SetStep(step);
}
public void SetStep(int step)

View File

@ -400,7 +400,7 @@ internal sealed partial class ActiveQuestComponent
ImGui.SameLine();
if (ImGui.Button("Clear sim"))
{
_questController.SimulateQuest(null);
_questController.SimulateQuest(null, 0, 0);
_movementController.Stop();
_questController.Stop("ClearSim");