625925f - Remove safeties, possible tainting
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 29 Dec 2017 22:07:09 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Fri, 29 Dec 2017 22:07:09 +0000
RaidFrameCustomization/Indicators.lua
RaidFrameCustomization/LayoutFramesHook.lua
RaidFrameCustomization/UpdateDispellableDebuffsHook.lua
RaidFrameCustomization/UpdateNameHook.lua
RaidFrameCustomization/UpdateStatusTextHook.lua

index d90cd87..3a013e7 100644 (file)
@@ -91,7 +91,7 @@ local function updateIndicators(frame)
                 local config = RaidFrameCustomization.db.profile[pos];
                 if not config.mine or UnitIsPlayer(caster) then
                     if config.showIcon and not config.useDefaultIcon then
-                        -- show icon TODO coloring
+                        -- show icon
                         ind.icon:SetTexture(icon);
                     end
                     if config.showText then
index b2a762a..fce9276 100644 (file)
@@ -6,20 +6,17 @@ local CompactRaidFrameContainer_ApplyToFrames = CompactRaidFrameContainer_ApplyT
 
 -- TODO remove 1px border
 hooksecurefunc("CompactRaidFrameContainer_LayoutFrames", function(frame)
-    if not frame then return end
     CompactRaidFrameContainer_ApplyToFrames(frame, "normal", function(frame)
-        if frame then
-            -- Health bar color --
-            -- used in CompactUnitFrame_UpdateHealthColor, might not be set prior
-            frame.optionTable.healthBarColorOverride = normalBarColor;
-            frame.background:SetColorTexture(unpack(normalBackColor));
-            -- Power bar display --
-            local role = UnitGroupRolesAssigned(frame.unit);
-            local options = DefaultCompactUnitFrameSetupOptions;
-            if options.displayPowerBar and role ~= "HEALER" then
-                frame.healthBar:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -1, 1);
-                frame.powerBar:Hide();
-            end
+        -- Health bar color --
+        -- used in CompactUnitFrame_UpdateHealthColor, might not be set prior
+        frame.optionTable.healthBarColorOverride = normalBarColor;
+        frame.background:SetColorTexture(unpack(normalBackColor));
+        -- Power bar display --
+        local role = UnitGroupRolesAssigned(frame.unit);
+        local options = DefaultCompactUnitFrameSetupOptions;
+        if options.displayPowerBar and role ~= "HEALER" then
+            frame.healthBar:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -1, 1);
+            frame.powerBar:Hide();
         end
     end);
 end);
index bf95832..5ff9e0a 100644 (file)
@@ -6,7 +6,9 @@ local UnitDebuff = UnitDebuff;
 local CompactUnitFrame_UpdateHealthColor = CompactUnitFrame_UpdateHealthColor;
 
 hooksecurefunc("CompactUnitFrame_UpdateDispellableDebuffs", function(frame)
-    if frame and not frame:IsForbidden() and frame:GetName():match("^CompactRaidFrame%d") then
+    -- allowClassColorsForNPCs only in regular raid frames,
+    -- match only to them
+    if frame.optionTable.allowClassColorsForNPCs ~= nil then
         -- try to find dispellable debuff
         if UnitDebuff(frame.displayedUnit, 1, "RAID") ~= nil then
             frame.optionTable.healthBarColorOverride = dispelBarColor;
index f75dacb..cd17ca1 100644 (file)
@@ -1,7 +1,9 @@
 local UnitName = UnitName;
 
 hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
-    if frame and not frame:IsForbidden() and frame:GetName():match("^CompactRaidFrame%d") then
+    -- allowClassColorsForNPCs only in regular raid frames,
+    -- match only to them
+    if frame.optionTable.allowClassColorsForNPCs ~= nil then
         local name, _;
         name, _ = UnitName(frame.unit);
         if name then
index 6fdf535..3df8d5b 100644 (file)
@@ -5,7 +5,9 @@ local UnitHealth = UnitHealth;
 local format = string.format
 
 hooksecurefunc("CompactUnitFrame_UpdateStatusText", function(frame)
-    if frame and not frame:IsForbidden() and frame:GetName():match("^CompactRaidFrame%d") then
+    -- allowClassColorsForNPCs only in regular raid frames,
+    -- match only to them
+    if frame.optionTable.allowClassColorsForNPCs ~= nil then
         -- conditions taken from CompactUnitFrame.lua
         if not UnitIsConnected(frame.unit) or UnitIsDeadOrGhost(frame.displayedUnit) then
             return;