From 78d4e0a56ee2e50d43b0202b6a756b84a4e52de0 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 31 Oct 2026 14:28:01 -0500 Subject: [PATCH] Run the Turtle WoW setup with RunNextFrame and hook the map once The one-shot OnUpdate frame becomes RunNextFrame. Its call into the map loader ran with the delay frame as this, so the loader's hooked flag sat on a different frame than on PLAYER_ENTERING_WORLD and the map hooks went on twice: shift and ctrl mouse wheel changed alpha and scale by two steps. The flag is now a local of the module. --- modules/map.lua | 9 ++++++--- modules/turtle-wow.lua | 5 +---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/map.lua b/modules/map.lua index 44bea54b..2f6d0c4b 100644 --- a/modules/map.lua +++ b/modules/map.lua @@ -33,6 +33,10 @@ pfUI:RegisterModule("map", function () local alpha = C.position["WorldMapFrame"].alpha local scale = C.position["WorldMapFrame"].scale + -- the hooks go on once, however often the loader runs: turtle-wow.lua also + -- calls it, outside of an event + local hooked + local pfMapLoader = CreateFrame("Frame") pfMapLoader:RegisterEvent("PLAYER_ENTERING_WORLD") pfMapLoader:SetScript("OnEvent", function() @@ -46,9 +50,8 @@ pfUI:RegisterModule("map", function () WorldMapFrame:EnableMouse(true) WorldMapFrame:RegisterForDrag("LeftButton") - -- make sure the hooks get only applied once - if not this.hooked then - this.hooked = true + if not hooked then + hooked = true WorldMapFrame:HookScript("OnShow", function() -- customize diff --git a/modules/turtle-wow.lua b/modules/turtle-wow.lua index d2cf0eb1..1d1adc74 100644 --- a/modules/turtle-wow.lua +++ b/modules/turtle-wow.lua @@ -78,10 +78,7 @@ pfUI:RegisterModule("turtle-wow", function () end) end - local delay = CreateFrame("Frame") - delay:SetScript("OnUpdate", function() - this:Hide() - + RunNextFrame(function() -- correct positions of new game menu layout if GameMenuButtonShop and (GameMenuButtonPFUI or GameMenuButtonPFUIAddOns) then -- calculate new offset for the shop button