Change all use of heroclass to use RAID_CLASS_COLORS instead. This can be changed to CUSTOM_CLASS_COLORS later with a color picker for each class, but to support CoA classes need to go back to being colored properly.

Fix remaining lua errors covered by ascension patches

Add Addon Skins
Add Enhanced Friends List
This commit is contained in:
Andrew6810
2022-10-28 07:12:13 -07:00
parent 60ef8a38af
commit df7cc26a64
205 changed files with 18480 additions and 35 deletions
+5 -2
View File
@@ -939,7 +939,10 @@ function CH:GetColoredName(event, _, arg2, _, _, _, _, _, arg8, _, _, _, arg12)
local _, englishClass = GetPlayerInfoByGUID(arg12)
if englishClass then
local classColorTable = E.media.herocolor
local classColorTable = RAID_CLASS_COLORS[englishClass]
if arg12 == UnitName("player") then
classColorTable = E.media.herocolor
end
if not classColorTable then
return arg2
end
@@ -1439,7 +1442,7 @@ function CH:CheckKeyword(message, author)
local wordMatch = classMatch and lowerCaseWord
if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
local classColorTable = E.media.herocolor
local classColorTable = RAID_CLASS_COLORS[classMatch]
word = gsub(word, gsub(tempWord, "%-", "%%-"), format("\124cff%.2x%.2x%.2x%s\124r", classColorTable.r*255, classColorTable.g*255, classColorTable.b*255, tempWord))
end
end
+1 -1
View File
@@ -57,7 +57,7 @@ function DT:BattlegroundStats()
for i = 1, GetNumBattlefieldScores() do
local name = GetBattlefieldScore(i)
if name and name == E.myname then
local classColor = E.media.herocolor
local classColor = RAID_CLASS_COLORS[E.myclass]
DT.tooltip:AddDoubleLine(L["Stats For:"], name, 1, 1, 1, classColor.r, classColor.g, classColor.b)
DT.tooltip:AddLine(" ")
+1 -1
View File
@@ -155,7 +155,7 @@ local function OnClick(_, btn)
end
if not shouldSkip then
classc = E.media.herocolor
classc = RAID_CLASS_COLORS[info[3]]
classc = classc or GetQuestDifficultyColor(info[2])
levelc = GetQuestDifficultyColor(info[2])
+2 -1
View File
@@ -30,7 +30,8 @@ local function BuildDataTable()
for charName in pairs(ElvDB.gold[E.myrealm]) do
if ElvDB.gold[E.myrealm][charName] then
local color = E.media.herocolor
local class = ElvDB.class[E.myrealm][charName]
local color = class and RAID_CLASS_COLORS[class] or E.media.herocolor
tinsert(dataTable,
{
+2 -2
View File
@@ -140,7 +140,7 @@ local function OnClick(_, btn)
info = dataTable[i]
if info[7] and info[1] ~= E.myname then
classc = E.media.herocolor
classc = RAID_CLASS_COLORS[info[9]]
levelc = GetQuestDifficultyColor(info[3])
if UnitInParty(info[1]) or UnitInRaid(info[1]) then
@@ -222,7 +222,7 @@ local function OnEnter(self, _, noUpdate)
zonec = inactivezone
end
classc = E.media.herocolor
classc = RAID_CLASS_COLORS[info[9]]
if shiftKeyDown then
DT.tooltip:AddDoubleLine(
+2 -2
View File
@@ -50,7 +50,7 @@ function M:UpdateBubbleBorder()
wordMatch = classMatch and lowerCaseWord
if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
classColorTable = E.media.herocolor
classColorTable = RAID_CLASS_COLORS[classMatch]
word = gsub(word, gsub(tempWord, "%-", "%%-"), format("\124cff%.2x%.2x%.2x%s\124r", classColorTable.r*255, classColorTable.g*255, classColorTable.b*255, tempWord))
end
@@ -76,7 +76,7 @@ function M:AddChatBubbleName(chatBubble, guid, name)
if guid and guid ~= "" then
local _, class = GetPlayerInfoByGUID(guid)
if class then
color = E:RGBToHex(E.media.herocolor.r, E.media.herocolor.g, E.media.herocolor.b)
color = RAID_CLASS_COLORS[class].hex
end
else
color = "|cffffffff"
+1 -1
View File
@@ -141,7 +141,7 @@ local function buttonOnEnter(self)
for playerName, rollData in pairs(self.parent.rollResults) do
if self.rollType == rollData[1] and rollData[2] then
local classColor = E.media.herocolor
local classColor = RAID_CLASS_COLORS[rollData[2]]
GameTooltip:AddLine(playerName, classColor.r, classColor.g, classColor.b)
end
end
+4 -3
View File
@@ -49,12 +49,13 @@ end
function THREAT:GetColor(unit)
if UnitIsPlayer(unit) then
local class = E.media.herocolor
if not class then
local _, class = UnitClass(unit)
local color = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
if not color then
return 194, 194, 194
end
return class.r*255, class.g*255, class.b*255
return color.r*255, color.g*255, color.b*255
end
local unitReaction = UnitReaction(unit, "player")
@@ -21,7 +21,8 @@ function NP:Update_HealthColor(frame)
local r, g, b
local scale = 1
local classColor = E.media.herocolor
local class = frame.UnitClass
local classColor = RAID_CLASS_COLORS[class]
local useClassColor = NP.db.units[frame.UnitType].health.useClassColor
if classColor and ((frame.UnitType == "FRIENDLY_PLAYER" and useClassColor) or (frame.UnitType == "ENEMY_PLAYER" and useClassColor)) then
r, g, b = classColor.r, classColor.g, classColor.b
+1 -1
View File
@@ -52,7 +52,7 @@ function NP:Update_Name(frame, triggered)
local classColor, useClassColor
if class then
classColor = E.media.herocolor
classColor = RAID_CLASS_COLORS[class]
useClassColor = self.db.units[frame.UnitType].name and self.db.units[frame.UnitType].name.useClassColor
end
+1 -1
View File
@@ -90,7 +90,7 @@ S:AddCallback("Skin_WorldStateScore", function()
name = format("%s|cffffffff - |r%s%s|r", name, color, realm)
end
classTextColor = E.media.herocolor
classTextColor = RAID_CLASS_COLORS[classToken]
nameText = _G["WorldStateScoreButton"..i.."NameText"]
nameText:SetText(name)
+3 -3
View File
@@ -199,7 +199,7 @@ S:AddCallback("Skin_Friends", function()
_, _, level, _, _, _, classFileName = GetWhoInfo(button.whoIndex)
if classFileName then
classTextColor = E.media.herocolor
classTextColor = RAID_CLASS_COLORS[classFileName]
button.icon:Show()
button.icon:SetTexCoord(unpack(CLASS_ICON_TCOORDS[classFileName]))
else
@@ -327,7 +327,7 @@ S:AddCallback("Skin_Friends", function()
_, _, _, level, _, _, _, _, online, _, classFileName = GetGuildRosterInfo(button.guildIndex)
if classFileName then
if online then
classTextColor = E.media.herocolor
classTextColor = RAID_CLASS_COLORS[classFileName]
levelTextColor = GetQuestDifficultyColor(level)
buttonText = _G["GuildFrameButton"..i.."Name"]
buttonText:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)
@@ -343,7 +343,7 @@ S:AddCallback("Skin_Friends", function()
_, _, _, _, _, _, _, _, online, _, classFileName = GetGuildRosterInfo(button.guildIndex)
if classFileName then
if online then
classTextColor = E.media.herocolor
classTextColor = RAID_CLASS_COLORS[classFileName]
_G["GuildFrameGuildStatusButton"..i.."Name"]:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)
_G["GuildFrameGuildStatusButton"..i.."Online"]:SetTextColor(1.0, 1.0, 1.0)
end
+10 -6
View File
@@ -222,7 +222,7 @@ function TT:SetUnitText(tt, unit, level, isShiftKeyDown)
local guildName, guildRankName = GetGuildInfo(unit)
local pvpName = UnitPVPName(unit)
color = E.media.herocolor
color = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
if self.db.playerTitles and pvpName then
name = pvpName
@@ -276,7 +276,7 @@ function TT:SetUnitText(tt, unit, level, isShiftKeyDown)
end
if not color then
color = E.media.herocolor
color = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
end
local levelLine = self:GetLevelLine(tt, 2)
@@ -379,13 +379,15 @@ function TT:GameTooltip_OnTooltipSetUnit(tt)
if unit ~= "player" and UnitExists(unitTarget) then
local targetColor
if UnitIsPlayer(unitTarget) and not UnitHasVehicleUI(unitTarget) then
targetColor = E.media.herocolor
local _, class = UnitClass(unitTarget)
targetColor = UnitIsUnit("player", unitTarget) and E.media.herocolor or RAID_CLASS_COLORS[class]
else
targetColor = E.db.tooltip.useCustomFactionColors and E.db.tooltip.factionColors[UnitReaction(unitTarget, "player")] or FACTION_BAR_COLORS[UnitReaction(unitTarget, "player")]
end
if not targetColor then
targetColor = E.media.herocolor
local _, class = UnitClass(unitTarget)
targetColor = UnitIsUnit("player", unitTarget) and E.media.herocolor or RAID_CLASS_COLORS[class]
end
tt:AddDoubleLine(format("%s:", TARGET), format("|cff%02x%02x%02x%s|r", targetColor.r * 255, targetColor.g * 255, targetColor.b * 255, UnitName(unitTarget)))
@@ -400,7 +402,8 @@ function TT:GameTooltip_OnTooltipSetUnit(tt)
local groupUnit = (inRaid and "raid"..i or "party"..i)
if not UnitIsUnit(groupUnit, "player") and UnitIsUnit(groupUnit.."target", unit) then
local classColor = E.media.herocolor
local _, class = UnitClass(groupUnit)
local classColor = RAID_CLASS_COLORS[class]
tinsert(targetList, format("%s%s", E:RGBToHex(classColor.r, classColor.g, classColor.b), UnitName(groupUnit)))
end
@@ -560,7 +563,8 @@ function TT:SetUnitAura(tt, ...)
if id and self.db.spellID then
if caster then
local name = UnitName(caster)
local color = E.media.herocolor
local _, class = UnitClass(caster)
local color = UnitIsUnit("player", caster) and E.media.herocolor or RAID_CLASS_COLORS[class]
tt:AddDoubleLine(format("|cFFCA3C3C%s|r %d", ID, id), format("%s%s", E:RGBToHex(color.r, color.g, color.b), name))
else
tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id))
@@ -384,7 +384,8 @@ function UF:PostCastStart(unit)
if (self.notInterruptible and unit ~= "player") and UnitCanAttack("player", unit) then
r, g, b = colors.castNoInterrupt[1], colors.castNoInterrupt[2], colors.castNoInterrupt[3]
elseif UF.db.colors.castClassColor and UnitIsPlayer(unit) then
local t = E.media.herocolor
local _, class = UnitClass(unit)
local t = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
if t then r, g, b = t[1], t[2], t[3] end
elseif UF.db.colors.castReactionColor then
local Reaction = UnitReaction(unit, "player")
@@ -411,7 +412,8 @@ function UF:PostCastInterruptible(unit)
if self.notInterruptible and UnitCanAttack("player", unit) then
r, g, b = colors.castNoInterrupt[1], colors.castNoInterrupt[2], colors.castNoInterrupt[3]
elseif UF.db.colors.castClassColor and UnitIsPlayer(unit) then
local t = E.media.herocolor
local _, class = UnitClass(unit)
local t = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
if t then r, g, b = t[1], t[2], t[3] end
elseif UF.db.colors.castReactionColor then
local Reaction = UnitReaction(unit, "player")
@@ -186,7 +186,7 @@ function UF:FrameGlow_SetGlowColor(glow, unit, which)
if isPlayer then
local _, class = UnitClass(unit)
if class then
local color = E.media.herocolor
local color = UnitIsUnit("player", unit) and E.media.herocolor or RAID_CLASS_COLORS[class]
if color then
r, g, b = color.r, color.g, color.b
end