From: Liza Carvelli Date: Mon, 28 Jul 2025 20:49:33 +0000 (+0200) Subject: Don't draw debug overlay if quest window isn't visible X-Git-Tag: v6.0~20 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=a08cb9adc261279c6a05eb18b73df7429b67d194;p=Questionable.git Don't draw debug overlay if quest window isn't visible --- diff --git a/Questionable/Controller/QuestController.cs b/Questionable/Controller/QuestController.cs index 255aff2b..7c52b732 100644 --- a/Questionable/Controller/QuestController.cs +++ b/Questionable/Controller/QuestController.cs @@ -153,7 +153,8 @@ internal sealed class QuestController : MiniTaskController public string? DebugState { get; private set; } - public Func IsQuestWindowOpen { private get; set; } = () => true; + public bool IsQuestWindowOpen => IsQuestWindowOpenFunction?.Invoke() ?? true; + public Func? IsQuestWindowOpenFunction { private get; set; } = () => true; public void Reload() { @@ -191,7 +192,7 @@ internal sealed class QuestController : MiniTaskController } } - if (AutomationType == EAutomationType.Manual && !IsRunning && !IsQuestWindowOpen()) + if (AutomationType == EAutomationType.Manual && !IsRunning && !IsQuestWindowOpen) return; UpdateCurrentQuest(); diff --git a/Questionable/Windows/DebugOverlay.cs b/Questionable/Windows/DebugOverlay.cs index 6842d2b6..9916dc05 100644 --- a/Questionable/Windows/DebugOverlay.cs +++ b/Questionable/Windows/DebugOverlay.cs @@ -68,6 +68,9 @@ internal sealed class DebugOverlay : Window if (_clientState is not { IsLoggedIn: true, LocalPlayer: not null, IsPvPExcludingDen: false }) return; + if (!_questController.IsQuestWindowOpen) + return; + DrawCurrentQuest(); DrawHighlightedQuest(); diff --git a/Questionable/Windows/QuestWindow.cs b/Questionable/Windows/QuestWindow.cs index 5723c0dd..94385247 100644 --- a/Questionable/Windows/QuestWindow.cs +++ b/Questionable/Windows/QuestWindow.cs @@ -104,7 +104,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig _activeQuestComponent.Reload += OnReload; _quickAccessButtonsComponent.Reload += OnReload; - _questController.IsQuestWindowOpen = () => IsOpen; + _questController.IsQuestWindowOpenFunction = () => IsOpen; } public WindowConfig WindowConfig => _configuration.DebugWindowConfig;