From: Aleksi Blinnikka Date: Tue, 9 Jan 2018 13:16:43 +0000 (+0200) Subject: Different health text and more text space in config X-Git-Url: https://www.aleksib.fi/git/wowui.git/commitdiff_plain/978ee00b8c408d36f1724683428f196c9e1e48f2?ds=inline Different health text and more text space in config --- diff --git a/OmaRF/Indicators.lua b/OmaRF/Indicators.lua index f583eac..36d03cc 100644 --- a/OmaRF/Indicators.lua +++ b/OmaRF/Indicators.lua @@ -11,6 +11,7 @@ local paddings = { }; local watchedAuras; local majorAuras; +local majorMax; local auraFilters = {"HELPFUL", "HARMFUL"}; local DEFAULT_ICON = "Interface\\AddOns\\OmaRF\\images\\rhomb"; local _; @@ -114,16 +115,15 @@ local function updateIndicators(frame) return; end - local name, icon, count, debuff, expires, caster, id; + local name, icon, count, expires, caster, id; local current = GetTime(); local majorI = 1; - local majorMax = OmaRF.db.profile.majorAuras["max"]; for _, filter in ipairs(auraFilters) do local i = 1; while true do - name, _, icon, count, debuff, _, expires, caster, _, _, id = UnitAura(unit, i, filter); + name, _, icon, count, _, _, expires, caster, _, _, id = UnitAura(unit, i, filter); if not id then break end - local pos = watchedAuras[name] or watchedAuras[id] or watchedAuras[debuff]; + local pos = watchedAuras[id] or watchedAuras[name]; if pos then local ind = f[frameName][pos]; local config = OmaRF.db.profile.indicators[pos]; @@ -145,7 +145,7 @@ local function updateIndicators(frame) end end - if majorI <= majorMax and (majorAuras[id] or majorAuras[name]) then + if (majorAuras[id] or majorAuras[name]) and majorI <= majorMax then local ind = majorFrames[frameName][majorI]; ind.icon:SetTexture(icon); ind.icon:Show(); @@ -185,6 +185,7 @@ function OmaRF:RefreshConfig() for _, aura in ipairs(self.db.profile.majorAuras["auras"]) do majorAuras[aura] = true; end + majorMax = OmaRF.db.profile.majorAuras["max"]; if next(watchedAuras) ~= nil or next(majorAuras) ~= nil then self.running = true; diff --git a/OmaRF/UpdateStatusTextHook.lua b/OmaRF/UpdateStatusTextHook.lua index 3df8d5b..76a677e 100644 --- a/OmaRF/UpdateStatusTextHook.lua +++ b/OmaRF/UpdateStatusTextHook.lua @@ -18,11 +18,9 @@ hooksecurefunc("CompactUnitFrame_UpdateStatusText", function(frame) local prettyHealth; if healthLost > 1200000000 then -- 1.2B - local h1b = healthLost / 1000000000; - local h100m = (healthLost % 1000000000) / 100000000; - prettyHealth = format("-%d.%dB", h1b, h100m); + prettyHealth = format("-%.1fB", healthLost / 1000000000); elseif healthLost > 1200000 then -- 1.2M - prettyHealth = format("-%dM", healthLost / 1000000); + prettyHealth = format("-%.1fM", healthLost / 1000000); elseif healthLost > 1000 then -- 1K prettyHealth = format("-%dK", healthLost / 1000); else diff --git a/OmaRFConfig/IndicatorsConfig.lua b/OmaRFConfig/IndicatorsConfig.lua index 8783860..8d051f3 100644 --- a/OmaRFConfig/IndicatorsConfig.lua +++ b/OmaRFConfig/IndicatorsConfig.lua @@ -20,7 +20,7 @@ local function createOptionsTable(self) auras = { type = "input", name = "Auras", - multiline = true, + multiline = 10, width = "full", get = function(item) return table.concat(self.db.profile.majorAuras["auras"], "\n");