diff --git a/libs/oUF/elements/alternativepower.lua b/libs/oUF/elements/alternativepower.lua index bb76358f..c0ca6bc1 100644 --- a/libs/oUF/elements/alternativepower.lua +++ b/libs/oUF/elements/alternativepower.lua @@ -88,8 +88,8 @@ local function UpdateColor(self, event, unit, powerType) color = self.colors.threat[UnitThreatSituation('player', unit)] elseif(element.colorPower) then color = self.colors.power[ALTERNATE_POWER_INDEX] - elseif(element.colorClass and UnitIsPlayer(unit)) - or (element.colorClassNPC and not UnitIsPlayer(unit)) then + elseif(element.colorClass and (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) + or (element.colorClassNPC and not (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) then local _, class = UnitClass(unit) color = self.colors.class[class] elseif(element.colorSelection and unitSelectionType(unit, element.considerSelectionInCombatHostile)) then diff --git a/libs/oUF/elements/health.lua b/libs/oUF/elements/health.lua index 081b9275..5aca4418 100644 --- a/libs/oUF/elements/health.lua +++ b/libs/oUF/elements/health.lua @@ -127,8 +127,8 @@ local function UpdateColor(self, event, unit) color = self.colors.tapped elseif(element.colorThreat and not UnitPlayerControlled(unit) and UnitThreatSituation('player', unit)) then color = self.colors.threat[UnitThreatSituation('player', unit)] - elseif(element.colorClass and UnitIsPlayer(unit)) - or (element.colorClassNPC and not UnitIsPlayer(unit)) + elseif(element.colorClass and (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) + or (element.colorClassNPC and not (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) or (element.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then local _, class = UnitClass(unit) color = self.colors.class[class] diff --git a/libs/oUF/elements/power.lua b/libs/oUF/elements/power.lua index 72a3dd6a..bab26240 100644 --- a/libs/oUF/elements/power.lua +++ b/libs/oUF/elements/power.lua @@ -146,8 +146,8 @@ local function UpdateColor(self, event, unit) else color = self.colors.power[ALTERNATE_POWER_INDEX] end - elseif(element.colorClass and UnitIsPlayer(unit)) - or (element.colorClassNPC and not UnitIsPlayer(unit)) + elseif(element.colorClass and (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) + or (element.colorClassNPC and not (UnitIsPlayer(unit) or UnitInPartyIsAI(unit))) or (element.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then local _, class = UnitClass(unit) color = self.colors.class[class] diff --git a/libs/oUF/elements/range.lua b/libs/oUF/elements/range.lua index 892bf84c..ff662ffa 100644 --- a/libs/oUF/elements/range.lua +++ b/libs/oUF/elements/range.lua @@ -100,4 +100,4 @@ local function Disable(self) end end -oUF:AddElement('Range', nil, Enable, Disable) +oUF:AddElement('Range', Path, Enable, Disable) diff --git a/libs/oUF/oUF.lua b/libs/oUF/oUF.lua index 879165c8..e1e59317 100644 --- a/libs/oUF/oUF.lua +++ b/libs/oUF/oUF.lua @@ -621,7 +621,7 @@ do (string?) * visibility - macro conditional(s) which define when to display the header (string). * ... - further argument pairs. Consult [Group Headers](https://warcraft.wiki.gg/wiki/SecureGroupHeaderTemplate) - for possible values. + for possible values. If preferred, the attributes can be an associative table. In addition to the standard group headers, oUF implements some of its own attributes. These can be supplied by the layout, but are optional. PingableUnitFrameTemplate is inherited for Ping support. @@ -640,10 +640,19 @@ do local header = CreateFrame('Frame', name, PetBattleFrameHider, template) header:SetAttribute('template', 'SecureUnitButtonTemplate, SecureHandlerStateTemplate, SecureHandlerEnterLeaveTemplate, PingableUnitFrameTemplate') - for i = 1, select('#', ...), 2 do - local att, val = select(i, ...) - if(not att) then break end - header:SetAttribute(att, val) + + if(...) then + if(type(...) == 'table') then + for att, val in next, (...) do + header:SetAttribute(att, val) + end + else + for i = 1, select('#', ...), 2 do + local att, val = select(i, ...) + if(not att) then break end + header:SetAttribute(att, val) + end + end end header.style = style