978ee00 - Different health text and more text space in config
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Tue, 9 Jan 2018 13:16:43 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Tue, 9 Jan 2018 13:16:43 +0000
OmaRF/Indicators.lua
OmaRF/UpdateStatusTextHook.lua
OmaRFConfig/IndicatorsConfig.lua

index f583eac..36d03cc 100644 (file)
@@ -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;
index 3df8d5b..76a677e 100644 (file)
@@ -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
index 8783860..8d051f3 100644 (file)
@@ -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");