Skip to content

Instantly share code, notes, and snippets.

@Adirelle
Last active September 28, 2018 19:16
Show Gist options
  • Save Adirelle/9b6f2078996305045824e74db8927953 to your computer and use it in GitHub Desktop.
Save Adirelle/9b6f2078996305045824e74db8927953 to your computer and use it in GitHub Desktop.
Masque: issue with addon loading order and custom skins
## Interface: 80000
## OptionalDeps: Masque
MasqueTest.lua
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