Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class color for AI units #686

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ read_globals = {
'UnitHealthMax',
'UnitHonorLevel',
'UnitInParty',
'UnitInPartyIsAI',
'UnitInRaid',
'UnitInRange',
'UnitIsConnected',
Expand Down
4 changes: 2 additions & 2 deletions elements/alternativepower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions elements/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down