From c513ceac2c8f2140f68168b1f37a438c8163b56a Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Sun, 3 Jul 2011 03:47:22 +0000 Subject: [PATCH] The Targeting module should now work in parties, and it'll also scan pets now. --- Modules/Targeting/Targeting.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Modules/Targeting/Targeting.lua b/Modules/Targeting/Targeting.lua index ca2a80c..406eb5f 100644 --- a/Modules/Targeting/Targeting.lua +++ b/Modules/Targeting/Targeting.lua @@ -18,14 +18,34 @@ function mod:OnDisable() end function mod:SetUnit() - if UnitInRaid("player") then + if UnitInRaid("player") or UnitInParty("player") and UnitExists(StarTip.unit) then local txt = '' + local guid = UnitGUID(StarTip.unit) for i=1, GetNumRaidMembers() do - if UnitExists("mouseover") and UnitGUID("mouseover") == UnitGUID("raid" .. i .. "target") then + if guid == UnitGUID("raid" .. i .. "target") then local c = RAID_CLASS_COLORS[select(2, UnitClass("raid" .. i))] local name = UnitName("raid" .. i) txt = txt .. ("|cFF%02x%02x%02x%s|r "):format(c.r*255, c.g*255, c.b*255, name) end + if guid == UnitGUID("raid" .. i .. "pettarget") then + local c = RAID_CLASS_COLORS[select(2, UnitClass("raid" .. i))] + local name = UnitName("raid"..i.."pet") + txt = txt .. ("|cFF%02x%02x%02x%s (pet)|r "):format(c.r*255, c.g*255, c.b*255, name) + end + end + if not UnitInRaid("player") then + for i = 1, GetNumPartyMembers() do + if UnitGUID(StarTip.unit) == UnitGUID("party" .. i .. "target") then + local c = RAID_CLASS_COLORS[select(2, UnitClass("party" .. i))] + local name = UnitName("party" .. i) + txt = txt .. ("|cFF%02x%02x%02x%s|r "):format(c.r*255, c.g*255, c.b*255, name) + end + if UnitGUID(StarTip.unit) == UnitGUID("party" .. i .. "pettarget") then + local c = RAID_CLASS_COLORS[select(2, UnitClass("party" .. i))] + local name = UnitName("party" .. i .. "pettarget") + txt = txt .. ("|cFF%02x%02x%02x%s (pet)|r "):format(c.r*255, c.g*255, c.b*255, name) + end + end end if txt ~= '' then GameTooltip:AddLine("Targeting: " .. txt, .5, .5, 1, 1) -- 1.7.9.5