From a08cb9adc261279c6a05eb18b73df7429b67d194 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 28 Jul 2025 22:49:33 +0200 Subject: [PATCH] Don't draw debug overlay if quest window isn't visible --- Questionable/Controller/QuestController.cs | 5 +++-- Questionable/Windows/DebugOverlay.cs | 3 +++ Questionable/Windows/QuestWindow.cs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) 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; -- 2.30.2