
Expose overlay alpha setting in UI
Closed this issue ยท 20 comments
I'm a bit busy dealing with the fallout of the new macro support but I'll look at this soon.
Can you share your Masque setup somehow? Masque isn't (or at least wasn't the last time I looked at it) really set up to handle what LBA wants to do at all. It would be better if it just worked out of the box, I should probably have another dive into the evils of Masque if I'm to keep supporting it.
Got to somewhere w/o modifying LBA with this masque skin setup.
Ingame masque settings also don't let you change that region.
MSQ:AddSkin("Butger LBA", {
Template = "Butger",
SpellHighlight = {
BlendMode = "BLEND",
DrawLayer = "OVERLAY",
DrawLevel = 5,
Width = 44,
Height = 44,
Color = {1, 1, 1, 1},
Texture = [[Interface\AddOns\Masque_Butger\Textures\Debuffs]],
},
},
true)
But even with GlowAlpha set to 1.0 there's still some transparency unlike "Checked" region with same settings, handled by Dominos here on mount button on right side.
Thanks, I assume the transparency is either in the texture itself or part of the masque config for "SpellHighlight". I'll see if I can unpick if Masque has improved since last time I looked at it in how I can specify things.
So this is all... well... outside my paygrade. Though I did learn a lot more about Masque, and their documentation has improved quite a lot.
So Masque is designed to reskin the kinds of things that already exist in WoW, and the graphical elements they have. A list of the button types they support is https://github.com/SFX-WoW/Masque/wiki/Button-Types
LBA is obviously not one of the regular button types. It adds an overlay over the top of the action buttons, and adds new elements that don't exist already in the base UI.
Masque does not inherently support this as a concept, so what LBA has to do is tell Masque that it is one of the other types of button (in our case ActionButton, which makes sense since it wants to be shaped like the ActionButton it overlays).
Then it has to say to Masque, hey this Glow should be styled like this specified element of an ActionButton. The list of possible elements it could pretend to be is https://github.com/SFX-WoW/Masque/wiki/Regions. At the moment it pretends to be SpellHighlight, the "texture that flashes on an ability when its spell book entry is hovered over." I assume this must be working ok since nobody has complained, though I don't know if it is the best option. The skins included with Masque do have a config for SpellHighlight, but some other popular ones (e.g., Neuron) don't. I don't know if that causes issues.
Masque skins can specify they want to change the texture, color, alpha, etc of the regions. And they do this based on expecting that the region behaves the same as the ActionButton region. Sometimes they can hide the regions completely.
So LBA needs to pretend to be the region that Masque skins will most expect behaves the way it does. Particularly one that is expected to change its color so Masque skins will not interfere. I'm not sure what the best region is.
AdiButtonAuras pretends to be "Border", but I don't think that's a good idea since plenty of skins would hide the border completely and LBA would just not appear. If you wanted that you should just uninstall.
I think it is probably not correct that LBA is setting alpha from glowAlpha every dynamic update, since that prevents Masque skins from overriding it. I'll change it so that it sets that up in Style(), though I should probably try to figure out if that will trigger Masque to apply itself, or if not how to make it.
I'm open to suggestions about which region is appropriate I guess, otherwise I'll try to survey some of the popular skins and see which ones they shape but don't try to color.
I see you can also add your own buttontype now
https://github.com/SFX-WoW/Masque/wiki/AddType
I don't know if this helps in any way, since the skins just specify regions anyway.
If LBA creates a custom frame to attach its regions to, that can be used as the "button" that gets passed to Masque, though you will need to pass a Regions
table with the applicable regions to AddButton
. You could then choose which static texture to use (eg, Border) and since LBA would be passing "custom" buttons, no other add-on would affect it.
This assumes, of course, that you create a custom button type and assign the appropriate regions (eg, Border
).
This also allows LBA to be configured separately from whatever action button add-on is being skinned in Masque's UI.
Ah, obviously I didn't explain very well. What you describe is how it works right now.
I have two choices:
- Use the Action Masque button type and choose a region for the glow to pretend to be (what is done now).
- Make a custom Masque button type and namea new Masque region, where no Masque skin will style it unless it has specific LiteButtonAuras support (unfeasible really, that's just going to annoy people).
I've surveyed a selection of the popular Masque skins and seems like "Gloss" is probably the best region to pretend to be. SpellHighlight is not visible at all or very very dim in a lot of skins. Icon is the one that works best for 90% of skins but in the other 10% the texture is zoomed in and you can't see the edge coloring at all, doh.
SpellHighlight, depending on if the add-on uses the default API, should only be visible when the mouse is over that spell in the spell book.
I wouldn't recommend using the icon, because some skins trim the edges off to get rid of the metallic border in the native icons, which in turn causes the icons to be "zoomed".
You'll likely need to use a default region as Masque's custom regions (Gloss, Shadow) are created and tracked internally. Given that your add-on seems to do some sort of aura tracking or something, you could add it as an Aura
type and use the Border
region. Then, it would first check the skin for your Border.YourCustomType
, then Aura.Border
and then just the base Border
skin which would allow skin authorss to target your add-on, if installed.
Eg:
Masque:AddType("LBA_Aura", {"Icon", "Border", "Cooldown"}, "Aura")
Hi, thanks for your comments.
SpellHighlight, depending on if the add-on uses the default API, should only be visible when the mouse is over that spell in the spell book.
No I'm completely unrelated to the ActionButton API, I show and hide the relevant region myself. It's just a matter of picking a region that skins will generally style the right way as an overlaid texture. Skins tend to have their own ideas about (for example) whether anything at all should be shown when you hover over a button. Or whether there is a border at all.
You'll likely need to use a default region as Masque's custom regions (Gloss, Shadow) are created and tracked internally.
I know you are the expert here but this is working correctly as far as I can tell. Is there some issue I don't see?
MasqueGroup:AddButton(overlay, { Gloss = overlay.Glow, Normal = false, }, "Action")
you could add it as an Aura type and use the Border region.
Worth checking into, I'll see. I think there's no point making a custom type, nobody is going to make their skin handle my tiny barely used addon. Seeing what skins do with Aura.Border is worth looking into though -- I fear many skins will decide to hide that too sadlly. [Edit] Also I fear there will be skins with differently shaped aura buttons from actionbuttons, and since I am overlaying actionbutton it needs to get the texture shape from there.
I know you are the expert here but this is working correctly as far as I can tell. Is there some issue I don't see?
Masque creates and removes those regions depending on the user's skin settings. You can play around with it and see if it acts weird. I suppose if it works, it works.
After a bit of thought, it might be easier to just add a way for users to customize the texture in your add-on without having to invoke or worry about Masque.
Yeah I'm not sure you might be right. The main problem is getting the shape right, which is something that will be shipped in the Masque skin. Maybe it is possible to query Masque for one of the underlying textures (edit: probably Border) from the ActionButton itself and copy it. I tried Gloss and while it didn't show any adverse behaviour it also wasn't much good as something like Circe doesn't provide a Gloss texture and it was just square.
Btw, apologies for the strangeness of the original reply, half asleep I assumed you were the issue submitter.
How does Masque handle SpellActivationAlert? What I'm doing is probably closest to that.
Spell alerts are part of the default UI, so I have to basically hook and intercept everything. It's a pain. If you're just adding a texture, that's easier to handle.
The main problem is getting the shape right
You could either
- Use ambiguous textures that can be applied to any shape of button (Eg, a marker or small icon over the button)
- Create textures for each of the shapes Masque natively supports and then just query the action button's
.__MSQ_Shape
field.
Thanks, plenty to think about there. It's probably easier if I just delve into the Masque code for SpellActivationAlert and __MSQ_Shape rather than ask a million questions.
Looking at how Masque works would definitely help, but I'd avoid spell alert stuff. :P
@StormFX sorry to bother you. So I have a working setup that (a) allows the user to specify their own texture path (easy), and (b) allows automatically using the format("Interface/AddOns/Masque/Textures/%s/AutoCast-Mask", button.__MSQ_Shape)
texture.
Only awkwardness is that I need to reskin whenever Masque does, and I can't obviously see anywhere to hook into "user changed skins" or anywhere to hook "this button was reskinned". Any idea? Too hard?
Sorry about the delay. Real life and stuff.