Advertisement
Xzempt

Untitled

Jul 13th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. mitems = {
  2. "Ban",
  3. "Kick",
  4. "Mute",
  5. "Summon"
  6. }
  7. SendChatMessage(".", "SAY", nil, nil)
  8. local function MenuOnOpen(self, ...)
  9. local level = UIDROPDOWNMENU_MENU_LEVEL
  10. local parent = UIDROPDOWNMENU_MENU_VALUE
  11. if (arg1 ~= true) then
  12. if (level == 1) and (string.match(arg1, "player:(.*):")) then
  13. info = UIDropDownMenu_CreateInfo()
  14. info.text = "|cff00ccffPlayer Control"
  15. info.value = "Player Control"
  16. info.tooltipTitle = "Player Control"
  17. info.hasArrow = true
  18. info.tooltipText = "This menu option allows you to take action against a player. Ban/Mute/Kick/Summon"
  19. info.func = Clicked
  20. info.notCheckable = 1
  21. UIDropDownMenu_AddButton(info, level)
  22.  
  23. info = UIDropDownMenu_CreateInfo()
  24. info.text = "|cff00ccffReload UI"
  25. info.value = "Reload UI"
  26. info.tooltipTitle = "Reload UI"
  27. info.tooltipText = "This menu option allows you to reload the User Interface."
  28. info.func = Clicked
  29. info.notCheckable = 1
  30. UIDropDownMenu_AddButton(info, level)
  31. elseif (level == 2) and (info.value == "Player Control") then
  32. for i,v in ipairs(mitems) do
  33. local info = UIDropDownMenu_CreateInfo()
  34. set.anchor = "cursor"
  35. info.value = mitems[i]
  36. info.menuTable = "mitems"
  37. info.owner = "Player Control"
  38. info.text = "|cff00ccff " ..mitems[i]
  39. info.tooltipTitle = mitems[i]
  40. --info.hasArrow = true
  41. info.tooltipText = "This menu option allows you to " ..mitems[i].. " a player."
  42. info.func = Clicked
  43. info.notCheckable = 1
  44. UIDropDownMenu_AddButton(info, level)
  45. end
  46. end
  47. end
  48. end
  49.  
  50. --handles the clicks
  51. function Clicked(self)
  52. if (info.text == "|cff00ccffReload UI") then
  53. ReloadUI()
  54. end
  55. end
  56. hooksecurefunc("UnitPopup_ShowMenu", MenuOnOpen)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement