Last active
September 28, 2018 19:16
-
-
Save Adirelle/9b6f2078996305045824e74db8927953 to your computer and use it in GitHub Desktop.
Masque: issue with addon loading order and custom skins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Interface: 80000 | |
## OptionalDeps: Masque | |
MasqueTest.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local MYSELF, addon = ... | |
function listKeys(t, prev) | |
local key = next(t, prev) | |
if key then | |
return key, listKeys(t, key) | |
end | |
end | |
local Masque, Version = LibStub('Masque') | |
print('Masque version: ', Version) | |
local button = CreateFrame('CheckButton', MYSELF .. "Button", nil, 'ActionBarButtonTemplate') | |
button:SetScript('OnEvent', function(_, event, name) | |
print(event, name) | |
print('- skins:', listKeys(Masque:GetSkins())) | |
if name == MYSELF then | |
Masque:Register(MYSELF, function(arg, group, skinID, gloss, backdrop, colors, disabled) | |
print('Masque callback:', arg, group, skinID, gloss, backdrop, colors, disabled) | |
print('- skins:', listKeys(Masque:GetSkins())) | |
print('- my skin:', Masque:GetSkin(skinID)) | |
end) | |
local group = Masque:Group(MYSELF) | |
group:AddButton(button) | |
end | |
end) | |
button:RegisterEvent('ADDON_LOADED') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment