Skip to content

Commit

Permalink
Don't ClassColor names less than 3 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
eTzmNcbkrng committed May 7, 2021
1 parent ba0dc04 commit 779ebd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions ElvUI/Modules/Chat/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1440,9 +1440,11 @@ function CH:CheckKeyword(message, author)
local classMatch = CH.ClassNames[lowerCaseWord]
local wordMatch = classMatch and lowerCaseWord

if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
local classColorTable = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classMatch] or 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))
if string.len(lowerCaseWord) > 2 then
if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
local classColorTable = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classMatch] or 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
end
end
Expand Down
8 changes: 5 additions & 3 deletions ElvUI/Modules/Misc/ChatBubbles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ function M:UpdateBubbleBorder()
classMatch = CH.ClassNames[lowerCaseWord]
wordMatch = classMatch and lowerCaseWord

if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
classColorTable = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classMatch] or 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))
if string.len(lowerCaseWord) > 2 then
if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
classColorTable = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classMatch] or 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

if not isFirstWord then
Expand Down

0 comments on commit 779ebd4

Please sign in to comment.