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
+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