misc fixes post patch

This commit is contained in:
andrew6180
2024-09-09 14:11:43 -07:00
parent 4a4f38c2a5
commit f9fc015d0e
3 changed files with 70 additions and 25 deletions
+32
View File
@@ -15,6 +15,37 @@ local IsInInstance = IsInInstance
E.Role = "Melee" -- TODO: Save per specialization?
function E:ClassColor(class, usePriestColor)
if not class then return end
local color = (_G.CUSTOM_CLASS_COLORS and _G.CUSTOM_CLASS_COLORS[class]) or _G.RAID_CLASS_COLORS[class]
if type(color) ~= 'table' then return end
if not color.colorStr then
color.colorStr = E:RGBToHex(color.r, color.g, color.b, 'ff')
elseif strlen(color.colorStr) == 6 then
color.colorStr = 'ff'..color.colorStr
end
if usePriestColor and class == 'PRIEST' and tonumber(color.colorStr, 16) > tonumber(E.PriestColors.colorStr, 16) then
return E.PriestColors
else
return color
end
end
function E:InverseClassColor(class, usePriestColor, forceCap)
local color = E:CopyTable({}, E:ClassColor(class, usePriestColor))
local capColor = class == 'PRIEST' or forceCap
color.r = capColor and max(1-color.r,0.35) or (1-color.r)
color.g = capColor and max(1-color.g,0.35) or (1-color.g)
color.b = capColor and max(1-color.b,0.35) or (1-color.b)
color.colorStr = E:RGBToHex(color.r, color.g, color.b, 'ff')
return color
end
do -- other non-english locales require this
E.UnlocalizedClasses = {}
for k, v in pairs(_G.LOCALIZED_CLASS_NAMES_MALE) do E.UnlocalizedClasses[v] = k end
@@ -25,6 +56,7 @@ do -- other non-english locales require this
end
end
function E:ScanTooltipTextures(clean, grabTextures)
local textures
for i = 1, 10 do