From 4cd365c3822fc6d28a973545a9cce0505aabf60b Mon Sep 17 00:00:00 2001 From: Jannik Tappert Date: Sat, 18 May 2024 18:27:59 +0200 Subject: [PATCH] The title is not set again to its own value. It is just got differenlty for the nametag (includeTitle true) --- src/data/trainer-config.ts | 9 +++------ src/phases.ts | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 9c3d3aabc1f..82aa8c1524e 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -417,8 +417,7 @@ export class TrainerConfig { // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); this.name = i18next.t(`trainerNames:${nameForCall}`); - this.name = `${i18next.t("titles:gym_leader")} ${this.name}`; - this.title = ""; + this.setTitle('gym_leader') this.setMoneyMultiplier(2.5); this.setBoss(); this.setStaticParty(); @@ -450,8 +449,7 @@ export class TrainerConfig { // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); this.name = i18next.t(`trainerNames:${nameForCall}`); - this.name = `${i18next.t("titles:elite_four")} ${this.name}`; - this.title = ""; + this.setTitle('elite_four'); this.setMoneyMultiplier(3.25); this.setBoss(); this.setStaticParty(); @@ -475,8 +473,7 @@ export class TrainerConfig { // Handle name by checking this.name - making it lowercase and replacing spaces with underscores and then calling i18next.t with the name const nameForCall = this.name.toLowerCase().replace(/\s/g, '_'); this.name = i18next.t(`trainerNames:${nameForCall}`); - this.name = `${i18next.t("titles:champion")} ${this.name}`; - this.title = ""; + this.setTitle('champion') this.setMoneyMultiplier(10); this.setBoss(); this.setStaticParty(); diff --git a/src/phases.ts b/src/phases.ts index 1137c85afa6..b308b3f22a6 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -906,7 +906,7 @@ export class EncounterPhase extends BattlePhase { const showDialogueAndSummon = () => { let message: string; this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(encounterMessages), this.scene.currentBattle.waveIndex); - this.scene.ui.showDialogue(message, trainer.getName(), null, () => { + this.scene.ui.showDialogue(message, trainer.getName(TrainerSlot.NONE,true), null, () => { this.scene.charSprite.hide().then(() => this.scene.hideFieldOverlay(250).then(() => doSummon())); }); };