View Single Post
Old 12-14-12, 05:36 AM   #7
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,887
Well, you also need LibQTip, though I suppose you could actually do away with that, since you could just do two columns with "<npc> / <item>" for incomplete quests and "<npc> / Complete" for complete ones:

Code:
	OnTooltipShow = function(tooltip)
		if not TILLERS then
			TILLERS = GetFactionInfoByID(1272)
			for i = 1, #npcs do
				local npc = npcs[i]
				npc.name = GetFactionInfoByID(npc.factionID)
			end
			sort(npcs, sortByName)
		end

		tooltip:AddDoubleLine(TILLERS, ITEMS)
		for i = 1, #npcs do
			local npc = npcs[i]
			if not npc.item then
				npc.item = GetItemInfo(npc.itemID)
			end
			if not IsQuestFlaggedCompleted(npc.questID) then
				tooltip:AddDoubleLine(npc.name, npc.item, 1, 0.8, 0.8, 1, 0.8, 0.8)
			elseif not hideComplete then
				tooltip:AddDoubleLine(npc.name, COMPLETE, 0.6, 0.8, 0.6, 0.6, 0.8, 0.6)
			end
		end
		tooltip:Show()
	end
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote