mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 08:18:18 +00:00
+ add random bot names
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user