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
10-23-10, 08:43 PM   #7
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
changed and got the same exact error. Line 79 in lib.lua is the line that you just had me change for reference

Last edited by maltese : 10-23-10 at 08:46 PM.
  Reply With Quote
10-23-10, 09:59 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Hmm, I found another problem. I'm at work, so I can't actually test anything. Try this:
Code:
	local unit = self.unit
	local unitType = unit:sub(1, -2)
	if unitType == "party" then
		ToggleDropDownMenu(1, nil, _G["PartyMemberFrame" .. self.id .. "DropDown"], "cursor", 0, 0)
	elseif unitType == "raid" then
		local which, name, id
		if UnitIsUnit(unit, "player") then
			which = "SELF"
		elseif UnitIsUnit(unit, "vehicle") then
			which = "VEHICLE"
		elseif UnitIsUnit(unit, "pet") then
			which = "PET"
		elseif UnitIsPlayer(unit) then
			id = UnitInRaid(unit)
			if id then
				which = "RAID_PLAYER"
				name = GetRaidRosterInfo(id)
			elseif UnitInParty(unit) then
				which = "PARTY"
			else
				which = "PLAYER"
			end
		else
			which = "TARGET"
			name = RAID_TARGET_ICON
		end
		if menu then
			UnitPopup_ShowMenu(self, which, unit, name, id)
		end
	else
		local cunit = unit:gsub("^%l", string.upper)
		if cunit == "Vehicle" then
			cunit = "Pet"
		end
		local dropdown = _G[cunit .. "FrameDropDown"]
		if dropdown then
			ToggleDropDownMenu(1, nil, dropdown, "cursor", 0, 0)
		end
	end
  Reply With Quote
10-24-10, 04:56 AM   #9
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Changed to that and it produces no menu or errors in a raid. I was in a hurry and no guildmates were online at the time so I just joined a battleground. Not sure if that would make a difference but I'll check again when I'm off work myself.
  Reply With Quote
10-25-10, 08:08 PM   #10
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
confirmed, there is no menu in BG's or in a raid on right click.
  Reply With Quote
11-04-10, 01:23 PM   #11
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
I hate to bump posts, but I'm curious if anyone has figured out the right click raid frames issue.
  Reply With Quote
11-05-10, 07:45 AM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
In the main chunk:
Code:
local dropdown = CreateFrame("Frame", "MyAddOnUnitDropDownMenu", UIParent, "UIDropDownMenuTemplate")

UIDropDownMenu_Initialize(dropdown, function(self)
	local unit = self:GetParent().unit
	if not unit then return end

	local menu, name, id
	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, unit, name, id)
	end
end, "MENU")

local menu = function(self)
	dropdown:SetParent(self)
	ToggleDropDownMenu(1, nil, dropdown, "cursor", 0, 0)
end
And in the function where your frame is created/configured (your layout's spawn function if you're using oUF):
Code:
	frame.menu = menu
	frame:SetAttribute("*type2", "menu")
  Reply With Quote
11-05-10, 08:36 AM   #13
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
This is definitely producing the menu I need, the only issue is when I right click on raid frames the menu pops up and almost instantly disappears. That issue does not affect any other frame (target, ToT, self, etc)

I inserted the first section of code like you said and then had to modify the second set slightly to get it to work, is this where the problem is? Its strange because the menu is popping up, but milliseconds later disappears.

Code:
-- The Shared Style Function
local GlobalStyle = function(self, unit, isSingle)

	self.menu = menu
	self:SetAttribute("*type2", "menu")
	self:RegisterForClicks('AnyDown')
	
	-- Call Unit Specific Styles
	if(UnitSpecific[unit]) then
		return UnitSpecific[unit](self)
	end
end

-- The Shared Style Function for Party and Raid
local GroupGlobalStyle = function(self, unit)

	self.menu = menu
	self:SetAttribute("*type2", "menu")
	self:RegisterForClicks('AnyDown')
	
	-- Call Unit Specific Styles
	if(UnitSpecific[unit]) then
		return UnitSpecific[unit](self)
	end
end

Last edited by maltese : 11-05-10 at 09:15 AM.
  Reply With Quote
11-05-10, 09:42 AM   #14
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Any frames created by header in oUF will reset many times per second. This is due to a bug in Blizzards handling of the headers.
This is the same bug that causes portraits to constantly flicker and reset on header units, and other weird stuff to occur (e.g. clicks can be lost).

This issue is fixed on the Beta and will, eventually, be fixed on the live servers.
  Reply With Quote
11-06-10, 06:04 AM   #15
Zúl
A Defias Bandit
 
Zúl's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 3
Originally Posted by yj589794 View Post
Any frames created by header in oUF will reset many times per second. This is due to a bug in Blizzards handling of the headers.
This is the same bug that causes portraits to constantly flicker and reset on header units, and other weird stuff to occur (e.g. clicks can be lost).

This issue is fixed on the Beta and will, eventually, be fixed on the live servers.
Is there anything one can do, to fix this for live servers? Because i want to develop my addon but i dont have beta access. And it sucks not being able to use OnShow and OnHide.
  Reply With Quote
11-06-10, 07:35 AM   #16
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Zúl View Post
Is there anything one can do, to fix this for live servers? Because i want to develop my addon but i dont have beta access. And it sucks not being able to use OnShow and OnHide.
You can test it on PTR, the changes are applied there. Another solution is to not use the visibility system on live (third argument to :SpawnHeader).
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-06-10, 09:33 AM   #17
Zúl
A Defias Bandit
 
Zúl's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 3
Originally Posted by haste View Post
You can test it on PTR
Cool just downloading the PTR client
  Reply With Quote
11-19-10, 06:32 PM   #18
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Has anyone a working raid menu that allows setting of roles?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-19-10, 07:03 PM   #19
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Does the code from my last post not work to set roles? I'm not actually using it, but when I tested it, the "Set Role" submenu definitely showed up.
  Reply With Quote
11-19-10, 08:42 PM   #20
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Thx phanx. Works perfect.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  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