From: Aleksi Blinnikka Date: Fri, 29 Dec 2017 22:07:09 +0000 (+0200) Subject: Remove safeties, possible tainting X-Git-Url: https://www.aleksib.fi/git/wowui.git/commitdiff_plain/625925f9e5095f719067ca840de5fd75bb1eb578?ds=inline Remove safeties, possible tainting --- diff --git a/RaidFrameCustomization/Indicators.lua b/RaidFrameCustomization/Indicators.lua index d90cd87..3a013e7 100644 --- a/RaidFrameCustomization/Indicators.lua +++ b/RaidFrameCustomization/Indicators.lua @@ -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 diff --git a/RaidFrameCustomization/LayoutFramesHook.lua b/RaidFrameCustomization/LayoutFramesHook.lua index b2a762a..fce9276 100644 --- a/RaidFrameCustomization/LayoutFramesHook.lua +++ b/RaidFrameCustomization/LayoutFramesHook.lua @@ -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); diff --git a/RaidFrameCustomization/UpdateDispellableDebuffsHook.lua b/RaidFrameCustomization/UpdateDispellableDebuffsHook.lua index bf95832..5ff9e0a 100644 --- a/RaidFrameCustomization/UpdateDispellableDebuffsHook.lua +++ b/RaidFrameCustomization/UpdateDispellableDebuffsHook.lua @@ -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; diff --git a/RaidFrameCustomization/UpdateNameHook.lua b/RaidFrameCustomization/UpdateNameHook.lua index f75dacb..cd17ca1 100644 --- a/RaidFrameCustomization/UpdateNameHook.lua +++ b/RaidFrameCustomization/UpdateNameHook.lua @@ -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 diff --git a/RaidFrameCustomization/UpdateStatusTextHook.lua b/RaidFrameCustomization/UpdateStatusTextHook.lua index 6fdf535..3df8d5b 100644 --- a/RaidFrameCustomization/UpdateStatusTextHook.lua +++ b/RaidFrameCustomization/UpdateStatusTextHook.lua @@ -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;