Lesteryoung |
09-30-15 08:03 PM |
Could someone add class colors to this addon for me?
I found a target of target tooltip addon a while back and it works fine, but I wish the ToT text showed class color as well as friendly/enemy npc color.
Could someone add that for me? I'd do it if I knew how, and I couldn't find any other ToT on tooltip addons that show class color.
Oh, and could you remove the fade out animation and just make the tooltip fade instantly instead of the default 2-3 seconds.
Lua Code:
local targetting = "" local TARGET_PREFIX = TARGET..":|cffffffff "; local ToTTT = {} GameTooltip:HookScript("OnUpdate", function(self, ...) ToTTT:AddTargetToTT() end) function ToTTT:AddTargetToTT() if ( not UnitExists('mouseovertarget')) then return end local targetLine local useExisting = false for i = 2, GameTooltip:NumLines() do targetLine = _G["GameTooltipTextLeft"..i]; if (targetLine:GetText():find(TARGET)) then useExisting = true break; end end targetting = UnitName("mouseovertarget") if (targetting ~= nil and targetting ~= "") then if useExisting then targetLine:SetText(string.format("%s %s |r", TARGET_PREFIX, targetting ) ) else GameTooltip:AddLine( string.format("%s %s |r", TARGET_PREFIX, targetting ) ) end GameTooltip:Show() end end
|