Skip most of the framework update logic if no quest is running and quest window isn't visible

This commit is contained in:
Liza 2025-01-02 23:25:40 +01:00
parent 86964dd6f9
commit c0c2e324bb
Signed by: liza
GPG Key ID: 2C41B84815CF6445
2 changed files with 6 additions and 0 deletions

View File

@ -146,6 +146,8 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
public string? DebugState { get; private set; } public string? DebugState { get; private set; }
public Func<bool> IsQuestWindowOpen { private get; set; } = () => true;
public void Reload() public void Reload()
{ {
lock (_progressLock) lock (_progressLock)
@ -181,6 +183,9 @@ internal sealed class QuestController : MiniTaskController<QuestController>, IDi
} }
} }
if (AutomationType == EAutomationType.Manual && !IsRunning && !IsQuestWindowOpen())
return;
UpdateCurrentQuest(); UpdateCurrentQuest();
if (!_clientState.IsLoggedIn || _condition[ConditionFlag.Unconscious]) if (!_clientState.IsLoggedIn || _condition[ConditionFlag.Unconscious])

View File

@ -104,6 +104,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
_activeQuestComponent.Reload += OnReload; _activeQuestComponent.Reload += OnReload;
_quickAccessButtonsComponent.Reload += OnReload; _quickAccessButtonsComponent.Reload += OnReload;
_questController.IsQuestWindowOpen = () => IsOpen;
} }
public WindowConfig WindowConfig => _configuration.DebugWindowConfig; public WindowConfig WindowConfig => _configuration.DebugWindowConfig;