From 24974e6142e74a02942738892b3a2e7d1c2d7a24 Mon Sep 17 00:00:00 2001 From: mike-s-zaugg Date: Tue, 5 May 2026 11:24:33 +0200 Subject: [PATCH 1/2] feat: make PlayerInfoPanel available in replays Show player info (resources, alliances, stats) when clicking on a player during replay playback. Action buttons are hidden as they are not applicable in replay mode. --- src/client/graphics/layers/PlayerPanel.ts | 30 ++++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index 6a60675d20..ddcab85fa4 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -867,7 +867,8 @@ export class PlayerPanel extends LitElement implements Layer { if (!this.isVisible) return html``; const my = this.g.myPlayer(); - if (!my) return html``; + const isReplay = this.g.config().isReplay(); + if (!my && !isReplay) return html``; if (!this.tile) return html``; const owner = this.g.owner(this.tile); @@ -877,8 +878,10 @@ export class PlayerPanel extends LitElement implements Layer { return html``; } const other = owner as PlayerView; - const myGoldNum = my.gold(); - const myTroopsNum = Number(my.troops()); + // In replay mode myPlayer() is null; use other as stand-in so read-only rendering works + const viewer = my ?? other; + const myGoldNum = viewer.gold(); + const myTroopsNum = Number(viewer.troops()); return html`