View Single Post
06-17-09, 06:21 AM   #4
Katae
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 208
Oops, guess there's an addon for it. That'll teach me for not researching . In any case, here's what I had written up:
Code:
--[[ sets line in tooltip ]]
local otips = {}
for _, tip in pairs({ GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2 }) do
	otips[tip] = tip:GetScript("OnTooltipSetItem")
	tip:SetScript("OnTooltipSetItem", function(tip, ...)
		local first = true
		local _, link = tip:GetItem()
		if link then
			local setslist, sets = "|cffffd700Sets:|r ", GetNumEquipmentSets()
			for s = 1, sets do
				local setname = GetEquipmentSetInfo(s)
				local items = GetEquipmentSetItemIDs(setname)
				for i = 1, #items do
					local id = tonumber(link:match("item:(%d+):"))
					if id == items[i] then
						setslist = setslist..(not first and ", " or "")..setname
						first = false
					end
				end
			end
			if not first then tip:AddLine(setslist,1,1,1) end
		end
		if otips[tip] then return otips[tip](tip, ...) end
	end)
end
  Reply With Quote