From 6b0f6a9b125b588f3142dcddcb884bd123f43417 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Fri, 7 Aug 2009 19:06:03 +0200 Subject: [PATCH] Add a more detailed owner string --- oUF_P3lim.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index dd24c3f..943c911 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -5,7 +5,7 @@ --]] -local format = string.format +local match, format, gsub = string.match, string.format, string.gsub local localized, class = UnitClass('player') local texture = [=[Interface\AddOns\oUF_P3lim\media\minimalist]=] @@ -86,7 +86,20 @@ local function castbarTime(self, duration) end local function hookTooltip(self) - GameTooltip:AddLine(format('Casted by %s', self.owner and UnitName(self.owner) or UNKNOWN)) + if(self.owner) then + if(self.owner == 'vehicle' or self.owner == 'pet') then + GameTooltip:AddLine(format('Cast by %s <%s>', UnitName(self.owner), UnitName('player'))) + elseif(self.owner:match('^partypet[1-4]$')) then + GameTooltip:AddLine(format('Cast by %s <%s>', UnitName(self.owner), UnitName(format('party%d', self.owner:gsub('^partypet(%d)$', '%1'))))) + elseif(self.owner:match('^raidpet[1-40]$')) then + GameTooltip:AddLine(format('Cast by %s <%s>', UnitName(self.owner), UnitName(format('raid%d', self.owner:gsub('^raidpet(%d)$', '%1'))))) + else + GameTooltip:AddLine(format('Cast by %s', UnitName(self.owner))) + end + else + GameTooltip:AddLine(format('Cast by %s', UNKNOWN)) + end + GameTooltip:Show() end -- 1.7.9.5