mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: strip Colors (#469)
This commit is contained in:
parent
0a3338320e
commit
5ae12dd494
11 changed files with 47 additions and 38 deletions
|
|
@ -16,9 +16,12 @@ export default class quake3 extends quake2 {
|
|||
for (const player of state.players) {
|
||||
player.name = this.stripColors(player.name)
|
||||
}
|
||||
for (const bot of state.bots) {
|
||||
bot.name = this.stripColors(bot.name)
|
||||
}
|
||||
}
|
||||
|
||||
stripColors (str) {
|
||||
return str.replace(/\^(X.{6}|.)/g, '')
|
||||
return this.options.stripColors ? str.replace(/\^(X.{6}|.)/g, '') : str
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue