From 556299304278aec21ec51cf8d4ce8c0be2c44cda Mon Sep 17 00:00:00 2001 From: Mattia Migliorini Date: Thu, 19 Mar 2026 23:58:06 +0100 Subject: [PATCH] Highlight own player name and team in lobby modal (#3468) ## Description: > I always lose track of myself in lobbies, could our names be bolded or even our entire team bolded for ease of readability? This PR highlights own username and own team in lobby modal, to make it easy for players to track themselves. It's also useful when your username gets changed by the profanity filter. Based on [this Discord suggestion](https://discord.com/channels/1284581928254701718/1484056268355145778) ### Screenshots FFA (Public): image Teams (Public): image FFA (Private): image image Teams (Private): image image ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: deshack_82603 --- src/client/components/LobbyPlayerView.ts | 31 +++++++++++++++++++++--- src/client/styles.css | 6 +++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/client/components/LobbyPlayerView.ts b/src/client/components/LobbyPlayerView.ts index aeaff00b3..94652ba50 100644 --- a/src/client/components/LobbyPlayerView.ts +++ b/src/client/components/LobbyPlayerView.ts @@ -124,7 +124,10 @@ export class LobbyTeamView extends LitElement { (client) => { const displayName = this.getClientDisplayName(client); return html`
${displayName}
`; @@ -168,7 +171,11 @@ export class LobbyTeamView extends LitElement { (c) => c.clientID ?? c.username, (client) => { const displayName = this.getClientDisplayName(client); - return html` + return html` ${displayName} ${client.clientID === this.lobbyCreatorClientID ? html` +
@@ -228,7 +240,10 @@ export class LobbyTeamView extends LitElement { (p) => { const displayName = this.getClientDisplayName(p); return html`
${displayName} ${p.clientID === this.lobbyCreatorClientID @@ -365,6 +380,14 @@ export class LobbyTeamView extends LitElement { })); } + private isCurrentPlayer(client: ClientInfo): boolean { + return !!this.currentClientID && client.clientID === this.currentClientID; + } + + private teamContainsCurrentPlayer(preview: TeamPreviewData): boolean { + return preview.players.some((p) => this.isCurrentPlayer(p)); + } + private getClientDisplayName(client: ClientInfo): string { const full = formatPlayerDisplayName(client.username, client.clanTag); if (!this.userSettings.anonymousNames()) { diff --git a/src/client/styles.css b/src/client/styles.css index dd73aa6ac..255fed924 100644 --- a/src/client/styles.css +++ b/src/client/styles.css @@ -295,6 +295,7 @@ label.option-card:hover { align-items: center; gap: 8px; background: #2a2a2a; + border: 1px solid transparent; color: #fff; padding: 8px 12px; margin: 4px; @@ -302,6 +303,11 @@ label.option-card:hover { font-size: 14px; } +.player-tag.current-player { + background: rgba(14, 165, 233, 0.15); + border: 1px solid rgba(14, 165, 233, 0.4); +} + #bots-count, #private-lobby-bots-count { width: 80%;