Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ClassColor names less than 3 characters #798

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ElvUI/Modules/Chat/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ 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
if wordMatch and (E.db.chat.classColorMentionLetterThreshold == nil or strlen(lowerCaseWord) > E.db.chat.classColorMentionLetterThreshold) 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
Expand Down
2 changes: 1 addition & 1 deletion ElvUI/Modules/Misc/ChatBubbles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function M:UpdateBubbleBorder()
classMatch = CH.ClassNames[lowerCaseWord]
wordMatch = classMatch and lowerCaseWord

if wordMatch and not E.global.chat.classColorMentionExcludedNames[wordMatch] then
if wordMatch and (E.db.chat.classColorMentionLetterThreshold == nil or strlen(lowerCaseWord) > E.db.chat.classColorMentionLetterThreshold) 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
Expand Down
11 changes: 10 additions & 1 deletion ElvUI_OptionsUI/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,17 @@ E.Options.args.chat = {
E.global.chat.classColorMentionExcludedNames[strlower(value)] = value
end
},
classColorMentionExcludedNames = {
classColorMentionLetterThreshold = {
order = 4,
type = "range",
name = L["Minimum name length"],
desc = L["Only class color names longer than this many letters."],
min = 0, max = 12, step = 1,
get = function(info) return E.db.chat.classColorMentionLetterThreshold end,
set = function(info, value) E.db.chat.classColorMentionLetterThreshold = value end,
},
classColorMentionExcludedNames = {
order = 5,
type = "multiselect",
name = L["Excluded Names"],
values = function() return E.global.chat.classColorMentionExcludedNames end,
Expand Down