/Tukui/modules/blizzard/symbol.lua

http://github.com/Asphyxia/Tukui · Lua · 37 lines · 31 code · 3 blank · 3 comment · 9 complexity · 73eb92b6f2c3ad7ee03bd3980e3813c8 MD5 · raw file

  1. local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
  2. --[[
  3. original code by alza, edited by tukz for tukui
  4. --]]
  5. local menuFrame = CreateFrame("Frame", "TukuiMarkingFrame", UIParent, "UIDropDownMenuTemplate")
  6. local menuList = {
  7. {text = L.symbol_CLEAR,
  8. func = function() SetRaidTarget("target", 0) end},
  9. {text = L.symbol_SKULL,
  10. func = function() SetRaidTarget("target", 8) end},
  11. {text = "|cffff0000"..L.symbol_CROSS.."|r",
  12. func = function() SetRaidTarget("target", 7) end},
  13. {text = "|cff00ffff"..L.symbol_SQUARE.."|r",
  14. func = function() SetRaidTarget("target", 6) end},
  15. {text = "|cffC7C7C7"..L.symbol_MOON.."|r",
  16. func = function() SetRaidTarget("target", 5) end},
  17. {text = "|cff00ff00"..L.symbol_TRIANGLE.."|r",
  18. func = function() SetRaidTarget("target", 4) end},
  19. {text = "|cff912CEE"..L.symbol_DIAMOND.."|r",
  20. func = function() SetRaidTarget("target", 3) end},
  21. {text = "|cffFF8000"..L.symbol_CIRCLE.."|r",
  22. func = function() SetRaidTarget("target", 2) end},
  23. {text = "|cffffff00"..L.symbol_STAR.."|r",
  24. func = function() SetRaidTarget("target", 1) end},
  25. }
  26. WorldFrame:HookScript("OnMouseDown", function(self, button)
  27. if(button=="LeftButton" and IsShiftKeyDown() and IsControlKeyDown() and UnitExists("mouseover")) then
  28. local inParty = (GetNumPartyMembers() > 0)
  29. local inRaid = (GetNumRaidMembers() > 0)
  30. if(inRaid and (IsRaidLeader() or IsRaidOfficer()) or (inParty and not inRaid)) then
  31. EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 1)
  32. end
  33. end
  34. end)