Hello,
I’m kinda trying to understand how the SecureActionButtonTemplate works.
I have a Button that inherits this Template in my XML :
<Button name="OldSpellButtonTemplate" inherits="SecureActionButtonTemplate" virtual="true">
<Size>
<AbsDimension x="37" y="37" />
</Size>
[...]
</Button>
And Buttons that inherits this newly created template :
<Button name="OldSpellButton1"
inherits="OldSpellButtonTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="34" y="-85" />
</Offset>
</Anchor>
</Anchors>
</Button>
And in the Lua, if the spell is a flyoutSpell, I change the button type attribute to a flyout.
if spellData.spellType == Enum.SpellBookItemType.Flyout then
-- Show flyout arrow
if flyoutArrow then
flyoutArrow:Show()
end
-- Set sub-spell string to indicate it's a Flyout spell
subSpellString:SetText("Flyout")
subSpellString:Show()
-- Securely handle the flyout toggle
self:SetAttribute("type", "flyout")
self:SetAttribute("flyout", spellID)
self:SetAttribute("flyoutDirection", "RIGHT")
else
Yes, spellID in this case is a flyoutID, I checked. When I parse spells, I do something like this :
spellID = flyoutID or spellInfo.spellID or spellInfo.actionID,
And I checked at runtime, when I run GetFlyoutInfo, I get all info without any problems. But, for the love of god, why do I have this error that appears when I click on any Button that is a flyout?
Blizzard_ActionBar/Mainline/SpellFlyout.lua:225: Usage: name, description, numSlots, isKnown = GetFlyoutInfo(flyoutID)
[string "=[C]"]: in function 'GetFlyoutInfo'
[string "@Blizzard_ActionBar/Mainline/SpellFlyout.lua"]:225: in function 'Toggle'
[string "@Blizzard_FrameXML/Mainline/SecureTemplates.lua"]:368: in function 'handler'
[string "@Blizzard_FrameXML/Mainline/SecureTemplates.lua"]:667: in function <...ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:649>
[string "@Blizzard_FrameXML/Mainline/SecureTemplates.lua"]:681: in function <...ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:674>
[string "@Blizzard_FrameXML/Mainline/SecureTemplates.lua"]:723: in function <...ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:707>
Locals:
(*temporary) = nil
I’m currently lost.
Edit: To be noted, all type="spell"
Buttons are working great. So in this case, the SecureActionButtonTemplate is working fine.