Thread Tools Display Modes
10-30-14, 02:51 AM   #1
scrable
A Murloc Raider
 
scrable's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 9
Can't change legacy raid with oUF Slim

As you can see here, I can't change the legacy difficulty, as it is greyed out and unclickable. I've narrowed this down to oUF Slim, but I'm unsure of how to fix it. I know this addon has been out of date for a while but I've managed to keep it alive for myself. Naturally, this probably has to do with how the drop down menu is created, but I don't know enough lua to fix it myself. This is the current code which I assume handles the menu:
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
Any help with this would be greatly appreciated
  Reply With Quote
10-30-14, 03:01 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You don't need any of that code anymore. Just delete it. Also, find where the layout sets the frame's type2 attribute to "menu" and delete that too. oUF already handles menus for you, by setting the type2 attribute to "togglemenu", which tells the default UI to select and show the proper menu for the frame's unit for you.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-30-14, 03:15 AM   #3
scrable
A Murloc Raider
 
scrable's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 9
Thank you for such a fast response and explanation. Got rid of the code mentioned and it works perfectly, thank you.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Can't change legacy raid with oUF Slim

Thread Tools
Display Modes

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