Skip most of the framework update logic if no quest is running and quest window isn...
authorLiza Carvelli <liza@carvel.li>
Thu, 2 Jan 2025 22:25:40 +0000 (23:25 +0100)
committerLiza Carvelli <liza@carvel.li>
Thu, 2 Jan 2025 22:25:40 +0000 (23:25 +0100)
Questionable/Controller/QuestController.cs
Questionable/Windows/QuestWindow.cs

index 5554404cfec72ebb02dd69b99ae641d4362aa63c..9d17fed1dea46592bc154005bf1f3755eb4016b3 100644 (file)
@@ -146,6 +146,8 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
 
     public string? DebugState { get; private set; }
 
+    public Func<bool> IsQuestWindowOpen { private get; set; } = () => true;
+
     public void Reload()
     {
         lock (_progressLock)
@@ -181,6 +183,9 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
             }
         }
 
+        if (AutomationType == EAutomationType.Manual && !IsRunning && !IsQuestWindowOpen())
+            return;
+
         UpdateCurrentQuest();
 
         if (!_clientState.IsLoggedIn || _condition[ConditionFlag.Unconscious])
index 2bcdbf9d2befe2bcfd96fcac470877088485a8c3..1463895a5b332740060516ad328122b2edc380de 100644 (file)
@@ -104,6 +104,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
 
         _activeQuestComponent.Reload += OnReload;
         _quickAccessButtonsComponent.Reload += OnReload;
+        _questController.IsQuestWindowOpen = () => IsOpen;
     }
 
     public WindowConfig WindowConfig => _configuration.DebugWindowConfig;