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);