From: Liza Carvelli Date: Thu, 2 Jan 2025 22:25:40 +0000 (+0100) Subject: Skip most of the framework update logic if no quest is running and quest window isn... X-Git-Tag: v4.12~9 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=c0c2e324bbba2df5f87923e85fdf81620b757ce9;p=Questionable.git Skip most of the framework update logic if no quest is running and quest window isn't visible --- diff --git a/Questionable/Controller/QuestController.cs b/Questionable/Controller/QuestController.cs index 5554404c..9d17fed1 100644 --- a/Questionable/Controller/QuestController.cs +++ b/Questionable/Controller/QuestController.cs @@ -146,6 +146,8 @@ internal sealed class QuestController : MiniTaskController, IDi public string? DebugState { get; private set; } + public Func IsQuestWindowOpen { private get; set; } = () => true; + public void Reload() { lock (_progressLock) @@ -181,6 +183,9 @@ internal sealed class QuestController : MiniTaskController, IDi } } + if (AutomationType == EAutomationType.Manual && !IsRunning && !IsQuestWindowOpen()) + return; + UpdateCurrentQuest(); if (!_clientState.IsLoggedIn || _condition[ConditionFlag.Unconscious]) diff --git a/Questionable/Windows/QuestWindow.cs b/Questionable/Windows/QuestWindow.cs index 2bcdbf9d..1463895a 100644 --- a/Questionable/Windows/QuestWindow.cs +++ b/Questionable/Windows/QuestWindow.cs @@ -104,6 +104,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig _activeQuestComponent.Reload += OnReload; _quickAccessButtonsComponent.Reload += OnReload; + _questController.IsQuestWindowOpen = () => IsOpen; } public WindowConfig WindowConfig => _configuration.DebugWindowConfig;