View Single Post
02-09-09, 08:31 AM   #683
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Caellian View Post
Now a question, a stupid one, i can't figure out the syntax for this, must have had a brainwash or something.
I've mentioned it before and even though it shouldn't happen, it does to me, when i login sometime or when i zone in a battleground often.
How do i get my stoopid pet renamed to Pet instead of Unknown ?

Code:
oUF.Tags['[shortmedium]']  = function(unit)
	local name = UnitName(unit)
	if(unit == 'pet' and name == 'Unknown') then
		return name == 'Pet'
	elseif (name:len() > 12) then
		return (name:sub(1, 12)..'...')
	else
		return name
	end
end
Code:
if(unit == 'pet' and name == 'Unknown') then
	return 'Pet'