From 3a195005d886b20a7e14762b29ffb8afab7e6c86 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 10 Mar 2026 14:08:31 -0700 Subject: [PATCH] outgoing attacks (#3398) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Show outgoing attacks on the PlayerInfoPanel. Also update the AttacksDisplay so it uses the same icon for incoming & outgoing attacks Screenshot 2026-03-10 at 2 02 49 PM Screenshot 2026-03-10 at 2 03 02 PM Screenshot 2026-03-10 at 2 03 28 PM ## 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: evan --- src/client/graphics/layers/AttacksDisplay.ts | 50 +++++++++---------- .../graphics/layers/PlayerInfoOverlay.ts | 44 ++++++++++++---- 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/src/client/graphics/layers/AttacksDisplay.ts b/src/client/graphics/layers/AttacksDisplay.ts index 617c46af2..b76c435b7 100644 --- a/src/client/graphics/layers/AttacksDisplay.ts +++ b/src/client/graphics/layers/AttacksDisplay.ts @@ -22,6 +22,7 @@ import { GoToPositionEvent, GoToUnitEvent, } from "./Leaderboard"; +import soldierIcon from "/images/SoldierIcon.svg?url"; import swordIcon from "/images/SwordIcon.svg?url"; @customElement("attacks-display") @@ -224,14 +225,13 @@ export class AttacksDisplay extends LitElement implements Layer { class="flex items-center gap-0.5 w-full bg-gray-800/70 backdrop-blur-xs sm:rounded-lg px-1.5 py-0.5 overflow-hidden" > ${this.renderButton({ - content: html` - ${renderTroops(attack.troops)} + content: html`${renderTroops(attack.troops)} ${( this.game.playerBySmallID(attack.attackerID) as PlayerView @@ -272,14 +272,13 @@ export class AttacksDisplay extends LitElement implements Layer { class="flex items-center gap-0.5 w-full bg-gray-800/70 backdrop-blur-xs sm:rounded-lg px-1.5 py-0.5 overflow-hidden" > ${this.renderButton({ - content: html` - ${renderTroops(attack.troops)} + content: html`${renderTroops(attack.troops)} ${( this.game.playerBySmallID(attack.targetID) as PlayerView @@ -287,7 +286,7 @@ export class AttacksDisplay extends LitElement implements Layer { > `, onClick: async () => this.attackWarningOnClick(attack), className: - "text-left text-blue-400 inline-flex items-center gap-0.5 lg:gap-1 min-w-0", + "text-left text-sky-400 inline-flex items-center gap-0.5 lg:gap-1 min-w-0", translate: false, })} ${!attack.retreating @@ -314,17 +313,16 @@ export class AttacksDisplay extends LitElement implements Layer { class="flex items-center gap-0.5 w-full bg-gray-800/70 backdrop-blur-xs sm:rounded-lg px-1.5 py-0.5 overflow-hidden" > ${this.renderButton({ - content: html` - ${renderTroops(landAttack.troops)} + content: html`${renderTroops(landAttack.troops)} ${translateText("help_modal.ui_wilderness")}`, className: - "text-left text-gray-400 inline-flex items-center gap-0.5 lg:gap-1 min-w-0", + "text-left text-sky-400 inline-flex items-center gap-0.5 lg:gap-1 min-w-0", translate: false, })} ${!landAttack.retreating diff --git a/src/client/graphics/layers/PlayerInfoOverlay.ts b/src/client/graphics/layers/PlayerInfoOverlay.ts index 0a5f9768b..e7f885824 100644 --- a/src/client/graphics/layers/PlayerInfoOverlay.ts +++ b/src/client/graphics/layers/PlayerInfoOverlay.ts @@ -318,17 +318,39 @@ export class PlayerInfoOverlay extends LitElement implements Layer { const playerTeam = getTranslatedPlayerTeamLabel(player.team()); return html` -
+
-
-
- - ${renderNumber(player.gold())} +
+
+
+ + ${renderNumber(player.gold())} +
+
+ + ${renderTroops(attackingTroops)} +
-
+
${this.renderTroopBar(totalTroops, attackingTroops, maxTroops)}
@@ -418,7 +440,7 @@ export class PlayerInfoOverlay extends LitElement implements Layer { return html`
${greenPercent > 0 @@ -435,7 +457,7 @@ export class PlayerInfoOverlay extends LitElement implements Layer { : ""}