tooltip:GetUnit apparently does return what I need. Commented out unit conversion code for now.
Scott Sibley [10-02-10 - 21:07]
tooltip:GetUnit apparently does return what I need. Commented out unit conversion code for now.
diff --git a/Modules/Portrait/Portrait.lua b/Modules/Portrait/Portrait.lua
index b2ca40e..faaff3a 100644
--- a/Modules/Portrait/Portrait.lua
+++ b/Modules/Portrait/Portrait.lua
@@ -98,7 +98,7 @@ function mod:GetOptions()
end
function mod:SetUnit()
- if not self.text or luaTexts.Race(StarTip.unit) == UNKNOWN then return end
+ if not self.text then return end
SetPortraitTexture(self.texture, StarTip.unit)
if self.db.profile.animated then
model:SetUnit(StarTip.unit)
diff --git a/StarTip.lua b/StarTip.lua
index d0d8eec..41e6894 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -650,7 +650,7 @@ end
function StarTip.OnTooltipSetUnit(...)
- local unit = GameTooltip:GetUnit()
+ local _, unit = GameTooltip:GetUnit()
hideTimer = hideTimer or LibTimer:New("StarTip.Hide", 100, false, hideTooltip, nil, StarTip.db.profile.errorLevel)
hideTimer:Start()
@@ -664,7 +664,8 @@ function StarTip.OnTooltipSetUnit(...)
lastTime = GetTime()
StarTip.fading = false
- StarTip.unit = "mouseover"
+ StarTip.unit = unit
+ --[[
if not UnitExists("mouseover") then
if UnitInRaid("player") then
for i=1, GetNumRaidMembers() do
@@ -693,7 +694,7 @@ function StarTip.OnTooltipSetUnit(...)
end
end
end
-
+ ]]
if not UnitExists(StarTip.unit) then GameTooltip:Hide(); return end
--[[if StarTip.unit ~= "mouseover" then