From 95a02a96a710d89b0cbc228f650c263c1a92d7ff Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Sun, 1 Sep 2024 13:11:23 -0700 Subject: [PATCH] Fixing banner error upon refresh (#3956) --- src/timed-event-manager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 7d9d71a8d68..13b4a85a2b8 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -91,15 +91,16 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container { setup() { const lang = i18next.resolvedLanguage; if (this.event && this.event.bannerKey) { + const key = this.event.bannerKey; if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) { if (this.event.availableLangs.includes(lang)) { - this.event.bannerKey += "-"+lang; + key += "-"+lang; } else { - this.event.bannerKey += "-en"; + key += "-en"; } } console.log(this.event.bannerKey); - this.banner = new Phaser.GameObjects.Image(this.scene, this.event.xPosition ?? 29, this.event.yPosition ?? 64, this.event.bannerKey); + this.banner = new Phaser.GameObjects.Image(this.scene, this.event.xPosition ?? 29, this.event.yPosition ?? 64, key); this.banner.setName("img-event-banner"); this.banner.setOrigin(0.08, -0.35); this.banner.setScale(this.event.scale ?? 0.18);