mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-06 02:28:58 +00:00
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.
This commit is contained in:
+6
-3
@@ -33,6 +33,10 @@ pfUI:RegisterModule("map", function ()
|
|||||||
local alpha = C.position["WorldMapFrame"].alpha
|
local alpha = C.position["WorldMapFrame"].alpha
|
||||||
local scale = C.position["WorldMapFrame"].scale
|
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")
|
local pfMapLoader = CreateFrame("Frame")
|
||||||
pfMapLoader:RegisterEvent("PLAYER_ENTERING_WORLD")
|
pfMapLoader:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
pfMapLoader:SetScript("OnEvent", function()
|
pfMapLoader:SetScript("OnEvent", function()
|
||||||
@@ -46,9 +50,8 @@ pfUI:RegisterModule("map", function ()
|
|||||||
WorldMapFrame:EnableMouse(true)
|
WorldMapFrame:EnableMouse(true)
|
||||||
WorldMapFrame:RegisterForDrag("LeftButton")
|
WorldMapFrame:RegisterForDrag("LeftButton")
|
||||||
|
|
||||||
-- make sure the hooks get only applied once
|
if not hooked then
|
||||||
if not this.hooked then
|
hooked = true
|
||||||
this.hooked = true
|
|
||||||
|
|
||||||
WorldMapFrame:HookScript("OnShow", function()
|
WorldMapFrame:HookScript("OnShow", function()
|
||||||
-- customize
|
-- customize
|
||||||
|
|||||||
@@ -78,10 +78,7 @@ pfUI:RegisterModule("turtle-wow", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
local delay = CreateFrame("Frame")
|
RunNextFrame(function()
|
||||||
delay:SetScript("OnUpdate", function()
|
|
||||||
this:Hide()
|
|
||||||
|
|
||||||
-- correct positions of new game menu layout
|
-- correct positions of new game menu layout
|
||||||
if GameMenuButtonShop and (GameMenuButtonPFUI or GameMenuButtonPFUIAddOns) then
|
if GameMenuButtonShop and (GameMenuButtonPFUI or GameMenuButtonPFUIAddOns) then
|
||||||
-- calculate new offset for the shop button
|
-- calculate new offset for the shop button
|
||||||
|
|||||||
Reference in New Issue
Block a user