+ add random bot names

This commit is contained in:
Mittani
2024-12-22 18:51:05 +01:00
committed by evanpelle
parent eb261fe103
commit aa01ea7694
9 changed files with 172 additions and 63 deletions
+1 -1
View File
@@ -133,4 +133,4 @@ export function calculateFontSize(rectangle: Rectangle, name: string): number {
const widthConstrained = rectangle.width / name.length * 2;
const heightConstrained = rectangle.height / 3;
return Math.min(widthConstrained, heightConstrained);
}
}
+2 -2
View File
@@ -227,7 +227,7 @@ export class NameLayer implements Layer {
if (myPlayer != null) {
const emojis = render.player.outgoingEmojis().filter(e => e.recipient == AllPlayers || e.recipient == myPlayer)
const emojis = render.player.outgoingEmojis().filter(e => e.recipient == AllPlayers || e.recipient == myPlayer);
if (emojis.length > 0) {
context.font = `${render.fontSize * 4}px ${this.theme.font()}`;
context.fillStyle = this.theme.playerInfoColor(render.player.id()).toHex();
@@ -246,4 +246,4 @@ export class NameLayer implements Layer {
this.myPlayer = this.game.players().find(p => p.clientID() == this.clientID)
return this.myPlayer
}
}
}