SecureHandlerClickTemplate vs SecureActionButtonTemplate
My addon lets you create and put custom flyouts on your action bars.
The "main" button that sits on the action bar and opens/closes the flyout uses
̶S̶e̶c̶u̶r̶e̶A̶c̶t̶i̶o̶n̶B̶u̶t̶t̶o̶n̶T̶e̶m̶p̶l̶a̶t̶e̶ [EDIT] SecureHandlerClickTemplate with its SetFrameRef("flyoutRef", theFlyoutFrame) and flyoutRef:Show() / Hide()
The buttons on the flyout all use SecureActionButtonTemplate to cast the spells, summon pets, consume items, etc. via SetAttribute("type", "spell") etc etc.
My question: Can I get my "main" button to cast a spell, summon a pet, do any of the Restricted actions available to SecureActionButtonTemplate. (Goal: a right click on the "main" button will perform the action of the first of the flyout buttons).
I tried SetFrameRef("btn1", theFirstButton) but it's been pruned of its Click() method. I've tried mainBtn:SetAttribute("type", "spell") etc but I find that SecureHandlerClickTemplate lacks any of that magic. I've tried CastSpellById() inside the mainBtn:SetAttribute("_onclick", "bunch of lua code") but the Restricted Env does not provide that method.
Help please :-)
Last edited by scottingram : 08-30-23 at 10:40 PM.
|