Originally Posted by SDPhantom
You're also recreating them at every loading screen instead of just at login. You should either unregister PLAYER_ENTERING_WORLD when done or use PLAYER_LOGIN instead.
|
Thanks very much for your suggestions and hints.
About the second part of the problems I have changed in this way (I realized that it should be broken because sometime the buttons fonts were mangled).
I used a mix of your tips using event "PLAYER_LOGIN" and then unregister once fired.
Lua Code:
local frame = CreateFrame("Frame")
frame:RegisterEvent('ACTIVE_TALENT_GROUP_CHANGED')
frame:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED')
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function(self, event, ...)
BuildActiveSpec()
UpdateLDB()
if event == "PLAYER_LOGIN" then
BuildMenu()
frame:UnregisterEvent("PLAYER_LOGIN")
end
end
)
Originally Posted by SDPhantom
From what I can tell, Menu is firing OnLeave you mouseover the spec buttons. You might want to have a custom handler check for that before hiding itself.
|
Uhm ...
This works but is so ugly ?
Lua Code:
Menu:SetScript('OnLeave', function()
local name = GetMouseFocus():GetName() or tostring(GetMouseFocus())
if string.sub(name,1,6) ~= "table:" then Menu:Hide() end
end)
The problem is when I hovering the buttons the "name" var is something like:
table:00000149a7cf46e0
or if I exit from the frame values I get are:
WorldFrame
ChocolateBar1
etc etc ...
Thanks anyway for your suggestions.