All pastes #92877 Raw Edit

Anonymous

public text v1 · immutable
#92877 ·published 2006-07-20 00:31 UTC
rendered paste body
function aUF.aUFunit.prototype:DropDownUnit(unit)
	local type

	if unit == "player" then
		type = PlayerFrameDropDown
	elseif unit == "target" then     
		type = TargetFrameDropDown
	elseif unit == "pet" then
		type = PetFrameDropDown   
	end
	
	if self.number then
		this:SetID(1)
	end
	
	if type then
		HideDropDownMenu(1);
		type.unit = unit
		type.name = UnitName(self.unit)			
		ToggleDropDownMenu(1, nil, type, "cursor")
	elseif string.find(unit,"party") then
		HideDropDownMenu(1);
		this.unit = unit
		FriendsDropDown.initialize = function() UnitPopup_ShowMenu(getglobal(UIDROPDOWNMENU_OPEN_MENU), "PARTY", unit, UnitName(unit)) end
		FriendsDropDown.displayMode = "MENU";
		ToggleDropDownMenu(1, nil, FriendsDropDown, "cursor");
	elseif string.find(self.unit,"raid") then
		HideDropDownMenu(1);
		FriendsDropDown.initialize = function() UnitPopup_ShowMenu(getglobal(UIDROPDOWNMENU_OPEN_MENU), "RAID", unit, UnitName(unit), this:GetID) end
		FriendsDropDown.displayMode = "MENU";
		ToggleDropDownMenu(1, nil, FriendsDropDown, "cursor");
	end
end