Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mitems = {
- "Ban",
- "Kick",
- "Mute",
- "Summon"
- }
- SendChatMessage(".", "SAY", nil, nil)
- local function MenuOnOpen(self, ...)
- local level = UIDROPDOWNMENU_MENU_LEVEL
- local parent = UIDROPDOWNMENU_MENU_VALUE
- if (arg1 ~= true) then
- if (level == 1) and (string.match(arg1, "player:(.*):")) then
- info = UIDropDownMenu_CreateInfo()
- info.text = "|cff00ccffPlayer Control"
- info.value = "Player Control"
- info.tooltipTitle = "Player Control"
- info.hasArrow = true
- info.tooltipText = "This menu option allows you to take action against a player. Ban/Mute/Kick/Summon"
- info.func = Clicked
- info.notCheckable = 1
- UIDropDownMenu_AddButton(info, level)
- info = UIDropDownMenu_CreateInfo()
- info.text = "|cff00ccffReload UI"
- info.value = "Reload UI"
- info.tooltipTitle = "Reload UI"
- info.tooltipText = "This menu option allows you to reload the User Interface."
- info.func = Clicked
- info.notCheckable = 1
- UIDropDownMenu_AddButton(info, level)
- elseif (level == 2) and (info.value == "Player Control") then
- for i,v in ipairs(mitems) do
- local info = UIDropDownMenu_CreateInfo()
- set.anchor = "cursor"
- info.value = mitems[i]
- info.menuTable = "mitems"
- info.owner = "Player Control"
- info.text = "|cff00ccff " ..mitems[i]
- info.tooltipTitle = mitems[i]
- --info.hasArrow = true
- info.tooltipText = "This menu option allows you to " ..mitems[i].. " a player."
- info.func = Clicked
- info.notCheckable = 1
- UIDropDownMenu_AddButton(info, level)
- end
- end
- end
- end
- --handles the clicks
- function Clicked(self)
- if (info.text == "|cff00ccffReload UI") then
- ReloadUI()
- end
- end
- hooksecurefunc("UnitPopup_ShowMenu", MenuOnOpen)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement