Quest window: Only enable skip if not on the last step

This commit is contained in:
Liza 2024-06-16 18:24:59 +02:00
parent f8402ba857
commit b87f54c8e8
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Numerics; using System.Numerics;
using Dalamud.Game.ClientState.Objects; using Dalamud.Game.ClientState.Objects;
using Dalamud.Interface; using Dalamud.Interface;
@ -162,10 +163,14 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig
QuestStep? currentStep = currentQuest.Quest QuestStep? currentStep = currentQuest.Quest
.FindSequence(currentQuest.Sequence) .FindSequence(currentQuest.Sequence)
?.FindStep(currentQuest.Step); ?.FindStep(currentQuest.Step);
bool colored = currentStep != null && currentStep.InteractionType == EInteractionType.Instruction bool lastStep = currentStep ==
&& _questController currentQuest.Quest.FindSequence(currentQuest.Sequence)?.Steps.LastOrDefault();
.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>(); bool colored = currentStep != null
&& !lastStep
&& currentStep.InteractionType == EInteractionType.Instruction
&& _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>();
ImGui.BeginDisabled(lastStep);
if (colored) if (colored)
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.HealerGreen); ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.HealerGreen);
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ArrowCircleRight, "Skip")) if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ArrowCircleRight, "Skip"))
@ -176,6 +181,7 @@ internal sealed class DebugWindow : LWindow, IPersistableWindowConfig
if (colored) if (colored)
ImGui.PopStyleColor(); ImGui.PopStyleColor();
ImGui.EndDisabled();
bool autoAcceptNextQuest = _configuration.General.AutoAcceptNextQuest; bool autoAcceptNextQuest = _configuration.General.AutoAcceptNextQuest;
if (ImGui.Checkbox("Automatically accept next quest", ref autoAcceptNextQuest)) if (ImGui.Checkbox("Automatically accept next quest", ref autoAcceptNextQuest))