All pastes #57330 Raw Edit

Something

public text v1 · immutable
#57330 ·published 2006-05-20 18:19 UTC
rendered paste body
function CC_GetItemStats(link)
	if (not link) then
		return;
	end
	local _,_,color,id,modifier=string.find(link,"|cff([^|]+)|H[^:]+:([^:]+):([^:]+):[^:]+:[^|]+|h.+|h");
	local _,_,link=string.find(link,"|cff[^|]+|H([^:]+:[^:]+:[^:]+:[^:]+:[^|]+)|h.+|h");
	ShowUIPanel(ItemRefTooltip);
	if (not ItemRefTooltip:IsVisible() ) then 
		ItemRefTooltip:SetOwner(UIParent,"ANCHOR_PRESERVE");
	end
	ItemRefTooltip:SetHyperlink(link);
	
	local txt="";
	if (ItemRefTooltip:IsVisible()) then
		for y=1,20,1 do
			if (getglobal("ItemRefTooltipTextLeft"..y):IsVisible()) then
				txt=txt.."|"..getglobal("ItemRefTooltipTextLeft"..y):GetText();
			end
		end
		txt=txt.."@";
		for y=1,20,1 do
			if (getglobal("ItemRefTooltipTextRight"..y):IsVisible()) then
				txt=txt.."|"..y..getglobal("ItemRefTooltipTextRight"..y):GetText();
			end
		end
	end
	HideUIPanel(ItemRefTooltip);
	return txt,CC_ColorQuality[color],id..":"..modifier;
end