Quantcast

Bug fixes. This may fix the bug in the Threat line. And also it fixes where "<YOU>" was shown for all player types.

Scott Sibley [07-29-11 - 21:44]
Bug fixes. This may fix the bug in the Threat line. And also it fixes where "<YOU>" was shown for all player types.
Filename
Localization/enUS.lua
Modules/UnitTooltip/UnitTooltip.lua
diff --git a/Localization/enUS.lua b/Localization/enUS.lua
index f630d16..08c02a4 100644
--- a/Localization/enUS.lua
+++ b/Localization/enUS.lua
@@ -217,6 +217,8 @@ L["Clip Length"] = true
 L["Whether to clip the string's length when it is longer than the value of Columns."] = true
 L["Dog Tags"] = true
 L["Whether to parse the return values as DogTags or not."] = true
+L["Unit Override"] = true
+L["There's a default unit provided to each run environment, and you access it with 'unit' in your script. These \"units\" include 'mouseover', 'target', 'party1', etc... Here you can override that unit specifier."] = true

 -- Mouse Gestures
 L["Left Button"] = true
diff --git a/Modules/UnitTooltip/UnitTooltip.lua b/Modules/UnitTooltip/UnitTooltip.lua
index 1bd46c8..8f2d0cc 100644
--- a/Modules/UnitTooltip/UnitTooltip.lua
+++ b/Modules/UnitTooltip/UnitTooltip.lua
@@ -117,7 +117,7 @@ return texture .. Colorize((Name(unit, true) or Name(unit)) .. afk , r, g, b)
 if not UnitExists(unit) then return L["None"] end

 local dt = '\
-[IsPlayer and "<YOU>":ClassColor or Color(Name, %f, %f, %f)  \
+[IsUnit("player") and "<YOU>":ClassColor or Color(Name, %f, %f, %f ) \
 (if PvP then \
  "++":Red \
 end)]'
@@ -960,6 +960,7 @@ function mod:CreateLines()
             local update = v.update or 0
             v.update = 0
             if v.left and v.leftUpdating then v.update = update end
+            mod.core.environment.unit = StarTip.unit or "player"
             llines[j].leftObj = v.left and WidgetText:New(mod.core, "StarTip.UnitTooltip:" .. v.name .. ":left:", copy(v), 0, 0, v.layer or 0, StarTip.db.profile.errorLevel, widgetUpdate)

             v.value = v.right