View Single Post
09-24-22, 06:30 AM   #17
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
OK.

I still have an annoying problem: as the up and down mouse button are registered, it triggers the action twixe.
I can handle this on the PostClick script with the third argument, but I don't know how to handle the main action - the one defined as a shit-click macro.

For example, line #6 is executed twice

Lua Code:
  1. btnMarker:SetMouseClickEnabled(true) -- Make sure OnClick is enabled
  2.         btnMarker:RegisterForClicks("LeftButtonUp", "LeftButtonDown") -- up and down required for SecureActionButtonTemplate
  3.         btnMarker:SetAttribute("type", "macro")
  4.         local macroStr = format("/wm %d", markersOrder[i]) -- place ground marker #i
  5.         btnMarker:SetAttribute("macrotext1", macroStr)
  6.         btnMarker:SetAttribute("shift-macrotext1", "/say TESTING") -- executed twice !!!!!!!!
  7.         btnMarker:SetScript("PostClick", function(self, btn, isDown)
  8.             if (not isDown) then -- execute only when down
  9.                 if (not IsModifierKeyDown()) then
  10.                     -- do some stuff when mouseDown with modifier key
  11.                 end
  12.             end
  13.         end)

BTW, it's for NPCsMarker, a RP addon.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote