Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/client/hud/layers/AttacksDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -47,7 +47,11 @@ export class AttacksDisplay extends LitElement implements Controller {
return this;
}

init() {}
init() {
loadAllSprites().catch((err) =>
console.error("Failed to preload attack display sprites:", err),
);
}
Comment on lines +50 to +54
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe instead we should move it to GameRenderer.initialize(), since multiple layers use sprites.


tick() {
this.active = true;
Expand Down
Loading