From df91dbc0ef716d9fbdf51a7a469e584ed8ab5294 Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Sun, 21 Nov 2010 16:30:21 +0000 Subject: [PATCH] Add a Recount line and make other DPS/Damage lines so they update every second. --- Modules/UnitTooltip/UnitTooltip.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Modules/UnitTooltip/UnitTooltip.lua b/Modules/UnitTooltip/UnitTooltip.lua index 4a2ce85..a0b0af0 100644 --- a/Modules/UnitTooltip/UnitTooltip.lua +++ b/Modules/UnitTooltip/UnitTooltip.lua @@ -503,9 +503,10 @@ return mod.db.realm[name] return "Recount:" ]], right = [[ -local val, perc, persec, maxvalue = RecountUnitData(unit) -if val then - local r, g, b = Gradient(perc / 100) +local val, perc, persec, maxvalue, maxvalue, total = RecountUnitData(unit) +if val and val ~= 0 then + local p = maxvalue ~= 0 and (val / maxvalue) or 1 + local r, g, b = Gradient(p) local prefix="" if persec then prefix = persec .. ", " @@ -513,7 +514,9 @@ if val then return Colorize(string.format("%d (%s%d%%)", val, prefix, perc), r, g, b) end ]], - enabled = true + enabled = true, + rightUpdating = true, + update = 1000 }, [28] = { name = "DPS", @@ -523,9 +526,11 @@ return "DPS:" right = [[ return UnitDPS(unit) ]], - enabled = true + enabled = true, + rightUpdating = true, + update = 1000 }, - [28] = { + [29] = { name = "Skada DPS", left = [[ return "Skada DPS:" @@ -536,7 +541,9 @@ if dps then return format("%d", dps) end ]], - enabled = true + enabled = true, + rightUpdating = true, + update = 1000 } } @@ -570,6 +577,7 @@ end function mod:OnInitialize() self.db = StarTip.db:RegisterNamespace(self:GetName(), defaults) + self.db.profile.lines = {} self:ReInit() self.leftLines = StarTip.leftLines -- 1.7.9.5