Originally Posted by myrroddin
I figured out that I do need to create a skin ....
|
No, unless your addon actually bundles its own skin. You just need to tell Masque about your addon:
Code:
local Masque = LibStub("Masque", true)
local group = Masque:Group("MyAddon")
Then add each button your addon creates to the group:
Code:
group:AddButton(button)
If your buttons have a normal structure with the expected regions at the expected locations, that's all you need to do. If your buttons don't inherit from ActionButtonTemplate, don't have the same regions under the same keys (eg. button -> button.Cooldown) or with the same names (eg. MyButtonGlobalName -> MyButtonGlobalNameCooldown) then you need to additionally explain to Masque how your button works.
For example, if your button's icon texture is referenced only as button.ShinyRainbowThing, you'd need to tell Masque that:
Code:
local buttonData = {
Icon = button.ShinyRainbowThing,
}
group:AddButton(button, buttonData)
This is also how you tell Masque to leave part of your button alone, either because you want to do something special with that part, or because that part doesn't even exist:
Code:
local buttonData = {
Cooldown = false,
}
group:AddButton(button, buttonData)
You shouldn't need to register a callback unless you're doing something non-standard. For example, in my buff addon, I want the borders of temporary enchant icons to be purple all the time, no matter what skin the player is using or which color they chose for the border, so I use a callback to re-color those borders purple after Masque does its thing:
Code:
local function OnSkinChanged(_, _, skin, gloss, backdrop, colors, fonts)
for i = 1, #PhanxTempEnchantFrame.buttons do
PhanxTempEnchantFrame.buttons[i].border:SetVertexColor(0.46, 0.18, 0.67, 1)
end
end
Masque:Register("PhanxBuffs", OnSkinChanged)
However, like I said, you probably don't need to worry about anything like that. I'm not even sure what buttons a quest log addon has, but they're probably not doing anything too exotic.
Edit:
You also don't need to do anything in your addon to store skin settings. Unlike its predecessors, Masque stores all that stuff itself; addons don't need to do anything in that area.