I'm trying to make a (pseudo) GetAllSetAttributes function for use on SecureActionButtonTemplate. I'm looking to generate a table of all potential attributes that could be set using the attribute naming scheme for
SecureActionButtonTemplate.
So here is an excerpt from a wiki on SecureActionButtonTemplate, as an example.
"type" Any clicks.
"*type1" Any left click.
"type1" Unmodified left click.
"shift-type2" Shift+right click. (But not Alt+Shift+right click)
"shift-type*" Shift+any button click.
"alt-ctrl-shift-type*" Alt+Control+Shift+any button click.
Rules- General order {modifiers-attribute-suffix}
- Order of 'alt-ctrl-shift' is strict for modifiers. Also, for at least the 'spell' attribute, the format "modifiers-attribute-{nuke | heal}", is valid.
- The 'attribute' part is required, other parts are not.
- Asterisks can only be at the end (any button), beginning (any prior modifiers), or omitted. Note: I believe ctrl and shift can be straight up omitted, so "alt-attribute" should be valid. Not sure if "alt-*-attribute" is legal (matching both alt-shift and alt-ctrl).
Primary Attributes
Code:
local primaryAttributes = {
"type", "spell", "item", "action", "macro", "macrotext",
"checkselfcast", "checkfocuscast", "toy", "flyoutDirection",
"clickbutton", "unit", "marker", "harmbutton", "helpbutton",
"attribute-name", "attribute-value", "actionpage",
"downbutton", "unit-suffix", "toggleForVehicle", "allowVehicleTarget"
}
String parsing isn't my strong suit (I can do it), but if anyone has any ideas or suggestions, or wants a little fun challenge; the help would be appreciated. This is for my addon
MagnetButtons, trying to add insertion of custom (not yet supported in the addon) attributes. I will give credit to anyone with viable code to use.
Reference:
Format details