Skip to content

Commit

Permalink
fix coloring only if relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
Jodsderechte committed Aug 6, 2024
1 parent 9cb5146 commit 9f5003d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CustomNames_Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ local function convertName(msg, name)
local customName = lib.Get(name)
if customName ~= name then
local color = msg:match("|c(%x%x%x%x%x%x%x%x)(.-)|r")
local colorCodedName = WrapTextInColorCode(customName, color)
return "|Hplayer:"..name.."|h["..colorCodedName.."]|h"
if color then
local colorCodedName = WrapTextInColorCode(customName, color)
return "|Hplayer:"..name.."|h["..colorCodedName.."]|h"
else
return "|Hplayer:"..name.."|h["..customName.."]|h"
end
end
end

Expand Down

0 comments on commit 9f5003d

Please sign in to comment.