Thread Tools Display Modes
10-23-10, 05:25 PM   #1
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Right-Click Unit Menu in raids bugged?

Just curious if something has changed with wow 4.0.1 to make the rightclick unit menu not work properly in raids using oUF?

I've gone through almost every single layout posted and they all pretty much read:

Code:
	local unit = self.unit:sub(1, -2)
	local cunit = self.unit:gsub("^%l", string.upper)

	if(cunit == "Vehicle") then
		cunit = "Pet"
	end

	if(unit == "party") then
		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
	elseif(_G[cunit.."FrameDropDown"]) then
		ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
	elseif unit == "raid" then
		FriendsDropDown.unit = self.unit
		FriendsDropDown.id = self.id
		FriendsDropDown.initialize = RaidFrameDropDown_Initialize
		ToggleDropDownMenu(1,nil,FriendsDropDown,"cursor")	
	end
That code works perfectly fine solo and in parties but the second you join a raid you lose pretty much all functionality of the right click menu. You can't set raid icons or roles from it anymore...etc.

Any ideas on getting the full raid menu to work?
  Reply With Quote
10-23-10, 06:43 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Try using CompactUnitFrameDropDown_Initialize instead of RaidFrameDropDown_Initialize? I don't think the old-style raid frames are still used, so Blizzard probably just didn't bother adding any of the new stuff (role checks, etc.) to them.
  Reply With Quote
10-23-10, 07:49 PM   #3
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Just tried CompactUnitFrameDropDown_Initialize and right click produces no menus at all.

If it helps tracking down the issue, if I change
Code:
if(unit == "party") then
		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
to

Code:
if(unit == "party") or (unit == "raid") then
		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
and commenting out the elseif unit == "raid" section

Produces the correct menu on raid frames, but only works on the first person in the first group. Every other raid member gives a "You have no target" error on right click and on the menu where the players name would be, shows Unknown.
  Reply With Quote
10-23-10, 08:02 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Try this:
Code:
	local unit = self.unit:sub(1, -2)
	if unit == "party" then
		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
	elseif unit == "raid" then
		local menu, id, name
		if UnitIsUnit(unit, "player") then
			menu = "SELF"
		elseif UnitIsUnit(unit, "vehicle") then
			menu = "VEHICLE"
		elseif UnitIsUnit(unit, "pet") then
			menu = "PET"
		elseif UnitIsPlayer(unit) then
			id = UnitInRaid(unit)
			if id then
				menu = "RAID_PLAYER"
				name = GetRaidRosterInfo(id)
			elseif UnitInParty(unit) then
				menu = "PARTY"
			else
				menu = "PLAYER"
			end
		else
			menu = "TARGET"
			name = RAID_TARGET_ICON
		end
		if menu then
			UnitPopup_ShowMenu(self, menu, self.unit, name, id)
		end
	else
		local cunit = self.unit:gsub("^%l", string.upper)
		if cunit == "Vehicle" then
			cunit = "Pet"
		end
		if _G[cunit.."FrameDropDown"] then
			ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
		end
	end
Basically copied the contents of CompactUnitFrameDropDown_Initialize, cleaned up Blizzard's legions of unnecessary parentheses and semicolons, and removed the parent.unit check that was most likely causing calling the original function to fail.

Last edited by Phanx : 10-23-10 at 08:58 PM.
  Reply With Quote
10-23-10, 08:33 PM   #5
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Works... sortof. The good news is that Player, Target, Focus and Party right click all still work with that code.

Raid frames sadly still do not.

Code:
Message: Interface\FrameXML\UnitPopup.lua:502: bad argument #1 to 'ipairs' (table expected, got nil)
Time: 10/23/10 22:30:42
Count: 2
Stack: [C]: in function `ipairs'
Interface\FrameXML\UnitPopup.lua:502: in function `UnitPopup_HideButtons'
Interface\FrameXML\UnitPopup.lua:219: in function `UnitPopup_ShowMenu'
Interface\AddOns\oUF_Drk\lib.lua:79: in function `handler'
Interface\FrameXML\SecureTemplates.lua:540: in function <Interface\FrameXML\SecureTemplates.lua:488>

Locals: (*temporary) = nil
(*temporary) = "table expected, got nil"
 = <function> defined =[C]:-1
Thanks for helping with this btw
  Reply With Quote
10-23-10, 08:40 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Try changing:
Code:
UnitPopup_ShowMenu(self, menu, unit, name, id)
To:
Code:
UnitPopup_ShowMenu(self, menu, self.unit, name, id)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Right-Click Unit Menu in raids bugged?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off