View Single Post
09-22-22, 06:17 AM   #8
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Interesting, SDPhantom. Thank you.

I have to say that I'm not sure how to adapt my code based on what you found.
As a reminder, I use the following basic code for a button with a macrotext attribute. It works fine on WoW 9.x:

Lua Code:
  1. local frame = CreateFrame("Frame", "Test", UIParent, "SecureHandlerStateTemplate")
  2.     frame:SetSize(40, 40)
  3.     frame:SetPoint("TOPLEFT", UIParent, 10, -150)
  4.  
  5.     local button = CreateFrame("Button", "TestBtn", frame, "SecureActionButtonTemplate")
  6.     button:ClearAllPoints()
  7.     button:SetSize(32, 32)
  8.     button:SetPoint("CENTER", frame)
  9.     local texture = button:CreateTexture("$parent_tex", "BACKGROUND")
  10.     texture:SetAllPoints(true)
  11.     texture:SetTexture(GetSpellTexture(783)) -- "Travel Form"
  12.     button.texture = texture
  13.  
  14.     button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
  15.     button:SetMouseClickEnabled(true)
  16.     button:SetAttribute("type", "macro")
  17.     button:SetAttribute("macrotext", "/abs")
  18.    
  19.     ------ testing purpose
  20.     button:SetScript("PostClick", function(self, arg1)
  21.         print("POSTCLICK: Clicked button=", self:GetName(), "  macroTxt=", self:GetAttribute("macrotext"))
  22.     end)
  23. end

Also, I believe the code you found concerns the raid markers (placed on units) and not the ground markers (placed on... the ground ).
__________________
Zax - Addons List, not all maintained.
  Reply With Quote