ChaosInc
02-07-2007, 05:16 AM
Trying to add buttons to cast portals in Mage Taxi, but I havn't coded since pre-2.0 when "CastSpell" wasn't protected. I've looked over the information over at wowwiki, and I understand the concept of the new Secure Functions. However, it doesn't explain where to set the commands in order for it to work. Here's what I have:
------------
<Button name="$parent_Port1" inherits="SecureActionButtonTemplate" text="Cast!">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent_City1">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetAttribute("unit",nil);
this:SetAttribute("type1", "spell");
this:SetAttribute("spell1","Heroic Strike");
</OnLoad>
<OnClick></OnClick>
</Scripts>
</Button>
------------
When I load it up, the button doesn't appear, so obviously I'm doing something wrong.
------------
<Button name="$parent_Port1" inherits="SecureActionButtonTemplate" text="Cast!">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parent_City1">
<Offset><AbsDimension x="0" y="0"/></Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetAttribute("unit",nil);
this:SetAttribute("type1", "spell");
this:SetAttribute("spell1","Heroic Strike");
</OnLoad>
<OnClick></OnClick>
</Scripts>
</Button>
------------
When I load it up, the button doesn't appear, so obviously I'm doing something wrong.