From c0c2e324bbba2df5f87923e85fdf81620b757ce9 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Thu, 2 Jan 2025 23:25:40 +0100 Subject: [PATCH] Skip most of the framework update logic if no quest is running and quest window isn't visible --- Questionable/Controller/QuestController.cs | 5 +++++ Questionable/Windows/QuestWindow.cs | 1 + 2 files changed, 6 insertions(+) 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;