Originally Posted by Zax
I have to say that I'm not sure how to adapt my code based on what you found.
|
As for
Button:RegisterForClicks(), change this
Code:
button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
to either of these
Code:
button:RegisterForClicks("LeftButtonUp", "LeftButtonDown", "RightButtonUp", "RightButtonDown")
Code:
button:RegisterForClicks("AnyUp", "AnyDown")
Originally Posted by Zax
Also, I believe the code you found concerns the raid markers (placed on units) and not the ground markers (placed on... the ground ).
|
RaidTarget is what's placed on units and
WorldMarker is placed on the ground. RaidTargets aren't protected, so they don't need a
SecureActionButton to set.
RaidTargets are set by
SetRaidTarget() while WorldMarkers have
PlaceRaidMarker() and
ClearRaidMarker().
(WoWPedia doesn't have an API page on the WorldMarker functions)
Here's an example of your button configured for this.
Lua Code:
button:SetMouseClickEnabled(true);-- Make sure OnClick is enabled
button:RegisterForClicks("AnyUp","AnyDown");-- Listen for all mouse buttons (Both up and down are required for SecureActionButtonTemplate)
button:SetAttribute("type","worldmarker");-- Perform "WorldMarker" action
button:SetAttribute("marker",1);-- Use marker index 1
button:SetAttribute("action1","toggle");-- Set left button to toggle
button:SetAttribute("action2","clear");-- Set right button to force clear
Originally Posted by Xrystal
Although, I think ( not 100% sure ), that left button is default so maybe macrotext with no number is treated as macrotext1 :shrugs:
|
The default without the number suffix is to run on any button. Specifying one is useful if you want the same
SecureActionButton to perform different actions depending on what mouse button you click it with and/or what modifier keys are held.