FEATURE: improved the display of player names, with the font-family 'Press start 2P' and gray outlines

This commit is contained in:
kharhamel 2021-05-26 17:07:07 +02:00
parent 474323b95f
commit 12da6ddd6c
14 changed files with 63 additions and 14 deletions

View file

@ -9,9 +9,8 @@ export interface CharacterTexture {
export const maxUserNameLength: number = MAX_USERNAME_LENGTH;
export function isUserNameValid(value: string): boolean {
const regexp = new RegExp('^[A-Za-z0-9]{1,'+maxUserNameLength+'}$');
return regexp.test(value);
export function isUserNameValid(value: unknown): boolean {
return typeof value === "string" && value.length > 0 && value.length < maxUserNameLength && value.indexOf(' ') === -1;
}
export function areCharacterLayersValid(value: string[] | null): boolean {