Is there a way to convert this into a secure worldmarker button and still cycle the index on click? Bonus if it clears on shift-click.
local b = CreateFrame("Button", "_MB", nil, "SecureActionButtonTemplate")
b:SetAttribute("*type5","macro") SecureHandlerWrapScript(b,"PreClick",b,'Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("macrotext5","/wm [@cursor] "..Z)')
The macro to trigger this version is
/cwm [mod:shift] 0
/click _MB Button5
Also, I’m not stuck on button 5, it’s just something I stole from the original macro.
[added]
Tried the following and it gives me the reticle to place {square}
but doesn’t increment and I’d like it to place without a 2nd click.
local b = CreateFrame("Button", "_MB", nil, "SecureActionButtonTemplate")
b:SetAttribute("*type5","worldmarker") SecureHandlerWrapScript(b,"PreClick",b,'Z=IsShiftKeyDown()and 0 or(Z or 0)%8+1 self:SetAttribute("marker"..Z,"set")')
Looks like to place the marker at cursor I need to pass cursor
as a 2nd argument to PlaceRaidMarker()
which worldmarker secure buttons don’t appear to support.
https://github.com/Gethe/wow-ui-source/blob/live/Interface/AddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua#L566
https://github.com/Gethe/wow-ui-source/blob/live/Interface/AddOns/Blizzard_ChatFrameBase/Mainline/ChatFrame.lua#L1668