From 24ae58b3a58833afa5684dea2e06534ec04207b0 Mon Sep 17 00:00:00 2001 From: Cameron Clark Date: Wed, 3 Jun 2026 18:46:07 +1000 Subject: [PATCH 1/2] Fix missing boat sprite icon in attacks panel Call loadAllSprites() from AttacksDisplay.init() so the sprite map is populated at startup. It was previously loaded by a deleted canvas layer, leaving the map empty and causing boat row icons to render blank. Fixes #4100 --- src/client/hud/layers/AttacksDisplay.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/hud/layers/AttacksDisplay.ts b/src/client/hud/layers/AttacksDisplay.ts index 04f736d834..b6f815d23a 100644 --- a/src/client/hud/layers/AttacksDisplay.ts +++ b/src/client/hud/layers/AttacksDisplay.ts @@ -23,7 +23,7 @@ import { } from "../../Transport"; import { UIState } from "../../UIState"; import { renderTroops, translateText } from "../../Utils"; -import { getColoredSprite } from "../SpriteLoader"; +import { getColoredSprite, loadAllSprites } from "../SpriteLoader"; const soldierIcon = assetUrl("images/SoldierIcon.svg"); const swordIcon = assetUrl("images/SwordIcon.svg"); @@ -47,7 +47,14 @@ export class AttacksDisplay extends LitElement implements Controller { return this; } - init() {} + init() { + // Preload the unit sprites so boat rows can render their tinted icon. + // This previously ran from a deleted canvas layer, leaving the sprite + // map empty (see issue #4100). + loadAllSprites().catch((err) => + console.error("Failed to preload attack display sprites:", err), + ); + } tick() { this.active = true; From 72e519c0ee1067ebbc8bebf5741b3a78ab752eb0 Mon Sep 17 00:00:00 2001 From: Cameron Clark Date: Wed, 3 Jun 2026 18:49:30 +1000 Subject: [PATCH 2/2] Remove redundant comments --- src/client/hud/layers/AttacksDisplay.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/client/hud/layers/AttacksDisplay.ts b/src/client/hud/layers/AttacksDisplay.ts index b6f815d23a..9080eabaa8 100644 --- a/src/client/hud/layers/AttacksDisplay.ts +++ b/src/client/hud/layers/AttacksDisplay.ts @@ -48,9 +48,6 @@ export class AttacksDisplay extends LitElement implements Controller { } init() { - // Preload the unit sprites so boat rows can render their tinted icon. - // This previously ran from a deleted canvas layer, leaving the sprite - // map empty (see issue #4100). loadAllSprites().catch((err) => console.error("Failed to preload attack display sprites:", err), );