diff --git a/Questionable/Controller/CommandHandler.cs b/Questionable/Controller/CommandHandler.cs index 160310bf3..ed552f62f 100644 --- a/Questionable/Controller/CommandHandler.cs +++ b/Questionable/Controller/CommandHandler.cs @@ -5,6 +5,7 @@ using Dalamud.Game.Command; using Dalamud.Plugin.Services; using Questionable.Model; using Questionable.Windows; +using Questionable.Windows.QuestComponents; namespace Questionable.Controller; @@ -14,6 +15,7 @@ internal sealed class CommandHandler : IDisposable private readonly IChatGui _chatGui; private readonly QuestController _questController; private readonly MovementController _movementController; + private readonly QuickAccessButtonsComponent _quickAccessButtonsComponent; private readonly QuestRegistry _questRegistry; private readonly ConfigWindow _configWindow; private readonly DebugOverlay _debugOverlay; @@ -22,15 +24,25 @@ internal sealed class CommandHandler : IDisposable private readonly ITargetManager _targetManager; private readonly GameFunctions _gameFunctions; - public CommandHandler(ICommandManager commandManager, IChatGui chatGui, QuestController questController, - MovementController movementController, QuestRegistry questRegistry, - ConfigWindow configWindow, DebugOverlay debugOverlay, QuestWindow questWindow, - QuestSelectionWindow questSelectionWindow, ITargetManager targetManager, GameFunctions gameFunctions) + public CommandHandler( + ICommandManager commandManager, + IChatGui chatGui, + QuestController questController, + MovementController movementController, + QuickAccessButtonsComponent quickAccessButtonsComponent, + QuestRegistry questRegistry, + ConfigWindow configWindow, + DebugOverlay debugOverlay, + QuestWindow questWindow, + QuestSelectionWindow questSelectionWindow, + ITargetManager targetManager, + GameFunctions gameFunctions) { _commandManager = commandManager; _chatGui = chatGui; _questController = questController; _movementController = movementController; + _quickAccessButtonsComponent = quickAccessButtonsComponent; _questRegistry = questRegistry; _configWindow = configWindow; _debugOverlay = debugOverlay; @@ -41,7 +53,14 @@ internal sealed class CommandHandler : IDisposable _commandManager.AddHandler("/qst", new CommandInfo(ProcessCommand) { - HelpMessage = "Opens the Questing window" + HelpMessage = string.Join($"{Environment.NewLine}\t", + "Opens the Questing window", + "/qst config - opens the configuration window", + "/qst start - starts doing quests", + "/qst stop - stops doing quests", + "/qst reload - reload all quest data", + "/qst which - shows all quests starting with your selected target", + "/qst zone - shows all quests starting in the current zone (only includes quests with a known quest path, and currently visible unaccepted quests)") }); } @@ -56,6 +75,7 @@ internal sealed class CommandHandler : IDisposable break; case "start": + _questWindow.IsOpen = true; _questController.ExecuteNextStep(true); break; @@ -64,6 +84,10 @@ internal sealed class CommandHandler : IDisposable _questController.Stop("Stop command"); break; + case "reload": + _quickAccessButtonsComponent.Reload(); + break; + case "do": ConfigureDebugOverlay(parts.Skip(1).ToArray()); break; @@ -85,9 +109,13 @@ internal sealed class CommandHandler : IDisposable _questSelectionWindow.OpenForCurrentZone(); break; - default: + case "": _questWindow.Toggle(); break; + + default: + _chatGui.PrintError($"Unknown subcommand {parts[0]}", "Questionable"); + break; } } diff --git a/Questionable/Controller/QuestController.cs b/Questionable/Controller/QuestController.cs index 310784f77..5f4787cce 100644 --- a/Questionable/Controller/QuestController.cs +++ b/Questionable/Controller/QuestController.cs @@ -321,7 +321,7 @@ internal sealed class QuestController private void ClearTasksInternal() { - _logger.LogDebug("Clearing task (internally)"); + //_logger.LogDebug("Clearing task (internally)"); _currentTask = null; if (_taskQueue.Count > 0) diff --git a/Questionable/Windows/QuestComponents/QuickAccessButtonsComponent.cs b/Questionable/Windows/QuestComponents/QuickAccessButtonsComponent.cs index 61ed51b7a..8e7d65bbb 100644 --- a/Questionable/Windows/QuestComponents/QuickAccessButtonsComponent.cs +++ b/Questionable/Windows/QuestComponents/QuickAccessButtonsComponent.cs @@ -73,11 +73,7 @@ internal sealed class QuickAccessButtonsComponent ImGui.EndDisabled(); if (ImGui.Button("Reload Data")) - { - _questController.Reload(); - _framework.RunOnTick(() => _gameUiController.HandleCurrentDialogueChoices(), - TimeSpan.FromMilliseconds(200)); - } + Reload(); if (_questRegistry.ValidationIssueCount > 0) { @@ -87,6 +83,13 @@ internal sealed class QuickAccessButtonsComponent } } + public void Reload() + { + _questController.Reload(); + _framework.RunOnTick(() => _gameUiController.HandleCurrentDialogueChoices(), + TimeSpan.FromMilliseconds(200)); + } + private bool DrawValidationIssuesButton() { int errorCount = _questRegistry.ValidationErrorCount;