RiZLA
30-08-2008, 06:11 PM
The Button works fine Casting my hearthstone, until I add the OnClick SendChatMessage section, then it just says the message, but does not cast Hearth.
I also tried making the OnClick point to a function in the lua file, but that had the exact same result.<Button name="HearthButton" inherits="SecureActionButtonTemplate">
<Size x="16" y="16" />
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="272" y="-72" />
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetAttribute("unit", "none")
this:SetAttribute("type1", "item")
this:SetAttribute("item1", "item:6948") -- Hearthstone
this:SetNormalTexture("Interface\\Icons\\INV_Misc_Rune_01.blp")
</OnLoad>
-- The <OnClick> below seems to overide the above <OnLoad> action
-- can there only be 1 action on a secure button?
<OnClick>
SendChatMessage("Hearthing to " .. GetBindLocation(), "SAY")
</OnClick>
</Scripts>
</Button>Thanks in advance for any help you can give :smiley:
I also tried making the OnClick point to a function in the lua file, but that had the exact same result.<Button name="HearthButton" inherits="SecureActionButtonTemplate">
<Size x="16" y="16" />
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="272" y="-72" />
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetAttribute("unit", "none")
this:SetAttribute("type1", "item")
this:SetAttribute("item1", "item:6948") -- Hearthstone
this:SetNormalTexture("Interface\\Icons\\INV_Misc_Rune_01.blp")
</OnLoad>
-- The <OnClick> below seems to overide the above <OnLoad> action
-- can there only be 1 action on a secure button?
<OnClick>
SendChatMessage("Hearthing to " .. GetBindLocation(), "SAY")
</OnClick>
</Scripts>
</Button>Thanks in advance for any help you can give :smiley: