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
+38
View File
@@ -1924,6 +1924,44 @@ function CH:FCFTab_UpdateColors(tab, selected)
tab:GetFontString():SetTextColor(unpack(E.media.rgbvaluecolor))
end
function CH:GetPlayerInfoByGUID(guid)
local data = CH.GuidCache[guid]
if not data then
local ok, localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = pcall(GetPlayerInfoByGUID, guid)
if not (ok and englishClass) then return end
local nameWithRealm = name..'-'..GetRealmName()
-- move em into a table
data = {
localizedClass = localizedClass,
englishClass = englishClass,
localizedRace = localizedRace,
englishRace = englishRace,
sex = sex,
name = name,
realm = realm,
nameWithRealm = nameWithRealm -- we use this to correct mobile to link with the realm as well
}
-- add it to ClassNames
if name then
CH.ClassNames[strlower(name)] = englishClass
end
if nameWithRealm then
CH.ClassNames[strlower(nameWithRealm)] = englishClass
end
-- push into the cache
CH.GuidCache[guid] = data
end
-- we still need to recheck this each time because CUSTOM_CLASS_COLORS can change
if data then data.classColor = E:ClassColor(data.englishClass) end
return data
end
function CH:ResetEditboxHistory()
wipe(ElvCharacterDB.ChatEditHistory)
end
-25
View File
@@ -258,29 +258,4 @@ S:AddCallback("Skin_Misc", function()
_G["LanguageMenuButton"..i]:StyleButton()
_G["VoiceMacroMenuButton"..i]:StyleButton()
end
local locale = GetLocale()
if locale == "koKR" then
S:HandleButton(GameMenuButtonRatings)
RatingMenuFrame:SetTemplate("Transparent")
RatingMenuFrameHeader:Kill()
S:HandleButton(RatingMenuButtonOkay)
elseif locale == "ruRU" then
-- Declension Frame
DeclensionFrame:SetTemplate("Transparent")
S:HandleNextPrevButton(DeclensionFrameSetPrev)
S:HandleNextPrevButton(DeclensionFrameSetNext)
S:HandleButton(DeclensionFrameOkayButton)
S:HandleButton(DeclensionFrameCancelButton)
for i = 1, RUSSIAN_DECLENSION_PATTERNS do
local editBox = _G["DeclensionFrameDeclension"..i.."Edit"]
if editBox then
editBox:StripTextures()
S:HandleEditBox(editBox)
end
end
end
end)