diff --git a/resources/lang/en.json b/resources/lang/en.json index bbd229645f..35cfca52d0 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -961,7 +961,11 @@ "unit_captured_by_enemy": "Your {unit} was captured by {name}", "captured_enemy_unit": "Captured {unit} from {name}", "unit_destroyed": "Your {unit} was destroyed", - "no_boats_available": "No boats available, max {max}" + "no_boats_available": "No boats available, max {max}", + "atom_bomb_inbound": "{name} - atom bomb inbound", + "hydrogen_bomb_inbound": "{name} - hydrogen bomb inbound", + "naval_invasion_inbound": "Naval invasion incoming from {name} ({troops})", + "mirv_inbound": "⚠️⚠️⚠️ {name} - MIRV INBOUND ⚠️⚠️⚠️" }, "player_type": { "player": "Player", diff --git a/src/client/graphics/layers/EventsDisplay.ts b/src/client/graphics/layers/EventsDisplay.ts index cb6eb6211e..c8e8bd3344 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -733,8 +733,13 @@ export class EventsDisplay extends LitElement implements Layer { const unitView = this.game.unit(event.unitID); + let description = event.message; + if (event.message.startsWith("events_display.")) { + description = translateText(event.message, event.params ?? {}); + } + this.addEvent({ - description: event.message, + description: description, type: event.messageType, unsafeDescription: false, highlight: true, 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`