The title is not set again to its own value. It is just got differenlty for the nametag (includeTitle true)

This commit is contained in:
Jannik Tappert 2024-05-18 18:27:59 +02:00
parent ae8add2f3c
commit 4cd365c382
2 changed files with 4 additions and 7 deletions

View File

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

View File

@ -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()));
});
};