diff --git a/src/client/graphics/layers/EventsDisplay.ts b/src/client/graphics/layers/EventsDisplay.ts index bd0cbb9aa..0d5725e7c 100644 --- a/src/client/graphics/layers/EventsDisplay.ts +++ b/src/client/graphics/layers/EventsDisplay.ts @@ -724,8 +724,20 @@ export class EventsDisplay extends LitElement implements Layer { const unitView = this.game.unit(event.unitID); + // Format the message for NAVAL_INVASION_INBOUND to display formatted troop count + let description = event.message; + if (event.messageType === MessageType.NAVAL_INVASION_INBOUND && unitView) { + // Replace raw troop count with formatted version + // Message format: "Boat: {troops} {attackerName}" + const formattedTroops = renderTroops(unitView.troops()); + description = event.message.replace( + /Boat: \d+/, + `Boat: ${formattedTroops}`, + ); + } + this.addEvent({ - description: event.message, + description: description, type: event.messageType, unsafeDescription: false, highlight: true, diff --git a/src/core/execution/TransportShipExecution.ts b/src/core/execution/TransportShipExecution.ts index 3028374f9..64045ba8e 100644 --- a/src/core/execution/TransportShipExecution.ts +++ b/src/core/execution/TransportShipExecution.ts @@ -1,4 +1,3 @@ -import { renderTroops } from "../../client/Utils"; import { Execution, Game, @@ -145,7 +144,7 @@ export class TransportShipExecution implements Execution { mg.displayIncomingUnit( this.boat.id(), // TODO TranslateText - `Boat: ${renderTroops(this.boat.troops())} ${this.attacker.displayName()}`, + `Boat: ${this.boat.troops()} ${this.attacker.displayName()}`, MessageType.NAVAL_INVASION_INBOUND, this.targetID, );