View Single Post
12-19-16, 09:45 PM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Should be fairly straightforward. Assuming you want to add the info to the game tooltip, you need to hook for example the OnTooltipSetItem script, parse all tooltip lines and edit the text accordingly.

Something like this:
Code:
GameTooltip:HookScript("OnTooltipSetItem", function(self)
	for i = 1, self:NumLines()
		local line = _G["GameTooltipTextLeft"..i]
		if line then
			local text = line:GetText()
			if textContainsRatingValues() then
				line:SetText("Replace text with this")
			end
		end
	end
end)
__________________
Grab your sword and fight the Horde!
  Reply With Quote