diff --git a/resources/lang/en.json b/resources/lang/en.json index fbf709405..cbe8d2537 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -432,9 +432,7 @@ "team": "Team", "owned": "Owned", "gold": "Gold", - "troops": "Troops", - "show_top_5": "Show Top 5", - "show_all": "Show All" + "troops": "Troops" }, "player_info_overlay": { "type": "Type", diff --git a/src/client/graphics/layers/GameLeftSidebar.ts b/src/client/graphics/layers/GameLeftSidebar.ts index f0dfae3bb..15a3f8706 100644 --- a/src/client/graphics/layers/GameLeftSidebar.ts +++ b/src/client/graphics/layers/GameLeftSidebar.ts @@ -22,6 +22,7 @@ export class GameLeftSidebar extends LitElement implements Layer { private playerColor: Colord = new Colord("#FFFFFF"); public game: GameView; + private _shownOnInit = false; createRenderRoot() { return this; @@ -32,6 +33,11 @@ export class GameLeftSidebar extends LitElement implements Layer { if (this.isTeamGame) { this.isPlayerTeamLabelVisible = true; } + // Make it visible by default on large screens + if (window.innerWidth >= 1024) { + // lg breakpoint + this._shownOnInit = true; + } this.requestUpdate(); } @@ -49,6 +55,12 @@ export class GameLeftSidebar extends LitElement implements Layer { } } + if (this._shownOnInit && !this.game.inSpawnPhase()) { + this._shownOnInit = false; + this.isLeaderboardShow = true; + this.requestUpdate(); + } + if (!this.game.inSpawnPhase()) { this.isPlayerTeamLabelVisible = false; this.requestUpdate(); diff --git a/src/client/graphics/layers/Leaderboard.ts b/src/client/graphics/layers/Leaderboard.ts index 33f025994..1a1fe641b 100644 --- a/src/client/graphics/layers/Leaderboard.ts +++ b/src/client/graphics/layers/Leaderboard.ts @@ -40,7 +40,6 @@ export class Leaderboard extends LitElement implements Layer { players: Entry[] = []; @property({ type: Boolean }) visible = false; - private _shownOnInit = false; private showTopFive = true; @state() @@ -57,10 +56,6 @@ export class Leaderboard extends LitElement implements Layer { tick() { if (this.game === null) throw new Error("Not initialized"); - if (!this._shownOnInit && !this.game.inSpawnPhase()) { - this._shownOnInit = true; - this.updateLeaderboard(); - } if (!this.visible) return; if (this.game.ticks() % 10 === 0) { this.updateLeaderboard(); @@ -174,37 +169,25 @@ export class Leaderboard extends LitElement implements Layer { } return html`