Thread Tools Display Modes
05-27-07, 03:44 PM   #1
Saiiyna
An Aku'mai Servant
 
Saiiyna's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 33
I cannot figure out how to do this

I have a secure button that used Netherweave bandage if you click it and I want it to use say runecloth bandage when you shift-click it. Can anyone give me a hint as to how to do this? I can make it have different targets on right and left click but the shift is killing me!


Thanks in advance!

Saii
  Reply With Quote
05-27-07, 04:03 PM   #2
holydiver
A Murloc Raider
Join Date: Oct 2006
Posts: 6
Im a tad noobishm on this, so this might not be the best way to type this macro but this should work.

Code:
#showtooltip 
/cast [modifier:shift] Runecloth Bandage
/cast [nomodifier:shift] Netherweave Bandage
  Reply With Quote
05-27-07, 04:06 PM   #3
speak
A Wyrmkin Dreamwalker
 
speak's Avatar
Join Date: Oct 2005
Posts: 57
you could also just use [modifier] and [nomodifier] so whatever modifier you use when clicking it it will work. i do this on my mage for conjuring mana gems. regular click [nomodifier] uses the gem, and [modifier] lets me use control or alt or shift click to conjure.
  Reply With Quote
05-27-07, 06:39 PM   #4
Saiiyna
An Aku'mai Servant
 
Saiiyna's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 33
Originally Posted by holydiver
Im a tad noobishm on this, so this might not be the best way to type this macro but this should work.

Code:
#showtooltip 
/cast [modifier:shift] Runecloth Bandage
/cast [nomodifier:shift] Netherweave Bandage
well guys thanks for the answer but I should have been more specific. I am doing this in an Addon not a macro.
  Reply With Quote
05-28-07, 06:35 AM   #5
mulesh
A Chromatic Dragonspawn
 
mulesh's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 193
First you need to have a button frame that inherits the SecureActionButtonTemplate
Code:
<Button name="NAMEOFYOURBUTTONFRAME" hidden="false" enableMouse="true" inherits="SecureActionButtonTemplate">
Also in your XML file, you need to set up script handlers for user clicks. Add this to your OnLoad handler area
Code:
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
Some other buttons presses you can check for RegisterForClicks

Now for the LUA parts.
The SetAttribute function is what you will use to to get your button to "work". Secure Frames Overview
This is just an example of how you CAN set it up when your addon loads (put in the function called when OnLoad happens)
Code:
function YOURADDON_OnLoad()
     NAMEOFYOURBUTTONFRAME:SetAttribute("unit", "player")
     NAMEOFYOURBUTTONFRAME:SetAttribute("type", "item")
     NAMEOFYOURBUTTONFRAME:SetAttribute("item", "Netherweave Bandage")
     NAMEOFYOURBUTTONFRAME:SetAttribute("shift-item", "Runecloth Bandage")
end
You could also try it this way
Code:
function YOURADDON_OnLoad()
     NAMEOFYOURBUTTONFRAME:SetAttribute("unit", "player")
     NAMEOFYOURBUTTONFRAME:SetAttribute("type", "macro")
     NAMEOFYOURBUTTONFRAME:SetAttribute("macrotext", "/cast [modifier:shift] Runecloth Bandage; /cast [nomodifier:shift] Netherweave Bandage")
end
You probably dont need all this info but I thought it couldnt hurt to be thorough
__________________
"Don"t tase me bro!" ~ Andrew Meyer
  Reply With Quote
05-28-07, 07:09 AM   #6
Saiiyna
An Aku'mai Servant
 
Saiiyna's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 33
Thanks for the info this is exactly what I think I need.

Saii
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » I cannot figure out how to do this


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off