I’m not at all experienced with making addons and I’m having some trouble getting some of my UI scripts to work in addon form. I have been running these in macros in WoW Classic but I’d like to have them run in an addon.
This is what I’m trying to get to work – it seems that only the first and second lines are running. Is this because the other elements haven’t loaded yet?
Thanks Elvenbane! I did actually use that website to create the addon and that helped me confirm it was loading.
I have just managed to get the addon to work by using SetAlpha(0) instead of SetTexture(nil)! I would be interested to know if anyone knows why this works instead?
Best guess, your addon was nil-ing the texture before it was being initially set because it’s not using any event based programming to determine when it should execute. Whereas alpha is just being defaulted rather than being set by the core addons.
To override that you could disable your keyring entirely with the cvar showKeyring or add something like this
local function hookSetTexture(frameName)
local frame = _G[frameName]
local hookEnabled = true -- to prevent infinite recursion
hooksecurefunc(frame, "SetTexture", function()
if hookEnabled then
hookEnabled = false
frame:SetTexture(nil)
hookEnabled = true
end
end)
end
hookSetTexture("MainMenuBarTexture2")
hookSetTexture("MainMenuBarTexture3")
As for MainMenuMaxLevelBar, I don’t know what that is supposed to be so not sure about that one. For me, SetTexture never gets called on any of those frames after loading.