View Single Post
02-13-16, 09:02 AM   #28
tyroneexe
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2016
Posts: 13
Still messing around with the addon.
After a test in Ashran last night, I found some functions could be added.

So I've added a second frame and found some code SDPhantom helped another user with

Lua Code:
  1. button:SetAttribute("type","macro");--  "type" without a number will handle all clicks unless a more specific attribute is found
  2. button:SetAttribute("macrotext1",SLASH_WORLD_MARKER1.." 1");--      Adds world marker 1 on left-click
  3. button:SetAttribute("macrotext2",SLASH_CLEAR_WORLD_MARKER1.." 1");--    Clears world marker 1 on right-click

I already use wMarker in Ashran to set gathering spots or direct the focus of the raid to certain enemies or if AA carrier is killed, to mark the AA location quickly.
Having just one marker is enough and placing/removing(well removing isn't really needed in Ashran, but it's nice either way) works.

My issue is getting the button to also send out msg to the raid in RAID_WARNING and INSTANCE_CHAT - sending different msg to each chat, Shorter ones in /rw longer ones in /i

Tried placing SDPhantoms code in different places within the function, and tried adding SetRaidTarget("mouseover",6); as well - although mouseover would be a bad choice since the mouse is clicking the button But just to see if I was on the right track.

This is the current mashup
Lua Code:
  1. local button=CreateButton(frame,"AshranCommanderButton22","Interface\\Icons\\ability_blackhand_marked4death",nil,"Place World Marker");
  2. button:SetPoint("TOP",AshranCommanderButton21,"BOTTOM",0,0);-- Anchors always default to an object's parent
  3. button:SetAttribute("type","macro");--  "type" without a number will handle all clicks unless a more specific attribute is found
  4. button:SetAttribute("macrotext1",SLASH_WORLD_MARKER1.." 1");--      Adds world marker 1 on left-click
  5. button:SetAttribute("macrotext2",SLASH_CLEAR_WORLD_MARKER1.." 1");--    Clears world marker 1 on right-click
  6. --button:SetScript("OnClick", function()
  7. --       SendChatMessage("{square} is used by a commander to mark the battlefront, gathering spot, defensive lines and on AA if it is dropped.","INSTANCE_CHAT")
  8. --       SendChatMessage("{square} Get to {square}", "RAID_WARNING")
  9.          --SetRaidTarget("mouseover",6);
  10. --  end )

Last edited by tyroneexe : 02-13-16 at 10:18 AM.
  Reply With Quote