Bartender4

Bartender4

70M Downloads

Masque: Updated Support

StormFX opened this issue ยท 1 comments

commented

I realize that I've been a bit lax in maintaining Masque's documentation (an issue I'm in the process of addressing) but I wanted to mention a change that I made in Masque's update last year. One of the things I implemented was specifying button types in the :AddButton() method. Eg:

Group:AddButton({Button} [, {Regions} [, "Type" [, Strict]]])

Where "Type" can be one of the following (or a custom type):

  • "Action"
  • "Pet"
  • "Item"
  • "Aura"
  • "Buff"
  • "Debuff"
  • "Enchant"

(Strict is a boolean that tells Masque to only skin the regions that are passed in the {Regions} table)

This allows Masque to filter the region iterations when searching for missing regions and when skinning a button. While Masque will attempt to determine the type if possible, it's a bit more efficient if it's passed in the :AddButton() method.

For most bars, it will only require adding the appropriate "Type" string as the third parameter to the :AddButton() call. In BT4's case, it would be "Item" for the bag bar, "Pet" for the pet bar and (I think) "Action" for everything else (The type is based on the template used by the default UI).

I realize that LAB would require a separate update but given that it's a library that's used by other action bar add-ons, it might be a good idea to include all of Masque's :AddButton() parameters in its :AddToMasque(group) method. Eg:

function Generic:AddToMasque(group, regions, type, strict)
	if type(group) ~= "table" or type(group.AddButton) ~= "function" then
		error("LibActionButton-1.0:AddToMasque: You need to supply a proper group to use!", 2)
	end
	group:AddButton(self, regions, type, strict)
	self.MasqueSkinned = true
end

I'd be more than happy to create a pull request or whatever if your time is limited or something. If you're not interested, that's fine too. I just figured I'd bring it up. Thanks!

commented

I've made it pass the type as appropriate.