View Single Post
10-30-19, 12:03 AM   #1
Rykkan
A Defias Bandit
Join Date: Oct 2019
Posts: 3
Right-click on target menu

I have fixed the BlackList addon to work with WoW Classic. But I cannot get the drop down item when right clicking a player to not be grayed out. Looking for help. It correctly places the menu item under Other Options and names it correctly. But I am not sure why it is grayed out and not usable.

This is the code for the menu:

function BlackList:AddMenuItems()
UnitPopupButtons["AddtoBlacklist"] = { text = "BlackList", dist = 0 }

--Insert it to the end -1
tinsert(UnitPopupMenus["PARTY"], (#UnitPopupMenus["PARTY"])-1, "AddtoBlacklist")
tinsert(UnitPopupMenus["RAID_PLAYER"], (#UnitPopupMenus["RAID_PLAYER"])-1, "AddtoBlacklist")
tinsert(UnitPopupMenus["PLAYER"], (#UnitPopupMenus["PLAYER"])-1, "AddtoBlacklist")
tinsert(UnitPopupMenus["CHAT_ROSTER"], (#UnitPopupMenus["CHAT_ROSTER"])-1, "AddtoBlacklist")
tinsert(UnitPopupMenus["FRIEND"], (#UnitPopupMenus["FRIEND"])-1, "AddtoBlacklist")

hooksecurefunc("UnitPopup_OnClick", function()
if (self.value == "AddtoBlacklist") then
local dropdownMenu = _G["UIDROPDOWNMENU_INIT_MENU"]
if(dropdownMenu.name ~= UnitName("player")) then
BlackList:AddPlayer(dropdownMenu.name)
end
end
end)

end

Last edited by Rykkan : 10-30-19 at 12:52 PM.
  Reply With Quote