From 78aefa4af84eccfdf77742ddb51b690a10ec336d Mon Sep 17 00:00:00 2001 From: Xurkon Date: Sun, 7 Jun 2026 08:42:40 -0500 Subject: [PATCH] perf: skip TestGameCache wait on clustering-only redraws - SmoothReset now accepts { skipCacheTest = true } to short-circuit the game cache wait and draw-queue drain - ClusterRedraw passes the flag so icon-cluster and dense-pin-clustering sliders redraw immediately - QuestieOptionsAdvanced wires the spawn-pin-dedup-radius slider directly to ClusterRedraw instead of the delayed SmoothReset path --- Modules/Options/AdvancedTab/QuestieOptionsAdvanced.lua | 2 +- Modules/Options/QuestieOptions.lua | 5 +++-- Modules/Quest/QuestieQuest.lua | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/Options/AdvancedTab/QuestieOptionsAdvanced.lua b/Modules/Options/AdvancedTab/QuestieOptionsAdvanced.lua index 33f4d89..a8c2b27 100644 --- a/Modules/Options/AdvancedTab/QuestieOptionsAdvanced.lua +++ b/Modules/Options/AdvancedTab/QuestieOptionsAdvanced.lua @@ -374,7 +374,7 @@ function QuestieOptions.tabs.advanced:Initialize() if QuestieDB and QuestieDB.ClearModeCaches then QuestieDB:ClearModeCaches() end - QuestieOptionsUtils:Delay(0.05, QuestieQuest.SmoothReset, l10n('Setting spawn pin dedup radius to %s : Redrawing!', value)) + QuestieOptions:ClusterRedraw() end, }, learnerCommsIntensity = { diff --git a/Modules/Options/QuestieOptions.lua b/Modules/Options/QuestieOptions.lua index 444e431..cf894e0 100644 --- a/Modules/Options/QuestieOptions.lua +++ b/Modules/Options/QuestieOptions.lua @@ -118,8 +118,9 @@ end function QuestieOptions:ClusterRedraw() Questie:Debug(Questie.DEBUG_INFO, "Clustering changed, redrawing!") - --Redraw clusters here - QuestieQuest:SmoothReset(); + -- Cluster-only changes don't depend on quest log state — skip the + -- TestGameCache wait and draw-queue drain that SmoothReset does. + QuestieQuest:SmoothReset({ skipCacheTest = true }) end ---@return table diff --git a/Modules/Quest/QuestieQuest.lua b/Modules/Quest/QuestieQuest.lua index b217ab0..8e3c507 100644 --- a/Modules/Quest/QuestieQuest.lua +++ b/Modules/Quest/QuestieQuest.lua @@ -330,7 +330,10 @@ local function _UpdateSpecials(questId) end end -function QuestieQuest:SmoothReset() +---@param opts? table Options table +---@field opts.skipCacheTest boolean If true, skip the TestGameCache wait and draw-queue drain. Use for clustering-only changes that don't depend on quest log state. +function QuestieQuest:SmoothReset(opts) + opts = opts or {} Questie:Debug(Questie.DEBUG_DEVELOP, "[QuestieQuest:SmoothReset]") if QuestieQuest._isResetting then QuestieQuest._resetAgain = true @@ -344,6 +347,8 @@ function QuestieQuest:SmoothReset() local stepTable = { function() -- Wait until game cache has quest log okay. + -- Skipped when opts.skipCacheTest is set (clustering-only redraws). + if opts.skipCacheTest then return true end return QuestLogCache.TestGameCache() end, function()