(Feature Request) Add ability to change shop name color
Relakin opened this issue · 2 comments
It'd be nice to be able to change the color of the label for the shops. The same green for every shop gets old fast.
You can enable color codes for shopkeeper names inside the config. See the description of the name-regex
setting inside the default config:
# A regular expression used to validate shopkeeper names. For detailed
# information on regular expressions the following documentations are helpful:
# * https://docs.oracle.com/javase/9/docs/api/java/util/regex/Pattern.html
# * http://www.regular-expressions.info/tutorial.html
# Here are a few examples:
# * "[A-Za-z0-9 ]{3,25}": The default. Allows the letters A to Z, in both upper
# and lower case, and the digits 0 to 9. The name has to consist of at least 3
# characters and can be maximal 25 characters long.
# * "[A-Za-z0-9&§ ]{3,25}": Same as the default, but allows using color codes.
# * "[\p{L}0-9 ]{3,25}": Same as the default, but allows any letter to be used,
# regardless of the language. If you encounter errors when the config is
# loaded, make sure that your config file is encoded as UTF-8.
# * ".*": Matches everything.
# * Adding "(?i)" at the front enables case insensitive matching.
# * "(?=X)": The name has to match "X" (X can be another embedded expression),
# but the name is not consumed and has to also match the following expressions.
# * "(?!.*X).*": The name is not allowed to contain anything that matches "X".
# * "(?i)(?=[a-z0-9 ]{3,25})(?!.*bitch|dick|ass).*": Filters bad words.
name-regex: "[A-Za-z0-9 ]{3,25}"
Basically, set name-regex: "[A-Za-z0-9&§ ]{3,25}"
and you can then use color codes for shopkeeper names, like &cBla
to make it red, etc.
To change the default color from green to something else, you will need to create a custom language file and change the message that is responsible for this nameplate prefix to use a different color.