adapt gender context logic to run-history (#3881)

This commit is contained in:
flx-sta 2024-08-29 09:25:45 -07:00 committed by GitHub
parent b781562553
commit af918975a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 128 additions and 122 deletions

View File

@ -1,15 +1,15 @@
{
"victory": "Sieg!",
"defeatedWildM": "Besiegt durch ",
"defeatedTrainerM": "Besiegt durch ",
"defeatedTrainerDoubleM": "Besiegt durch Doppelkampf",
"defeatedRivalM": "Besiegt durch Rivalin",
"defeatedM": "Besiegt",
"defeatedWildF": "Besiegt durch ",
"defeatedTrainerF": "Besiegt durch ",
"defeatedTrainerDoubleF": "Besiegt durch Doppelkampf",
"defeatedRivalF": "Besiegt durch Rivale",
"defeatedF": "Besiegt",
"defeatedWild": "Besiegt durch ",
"defeatedTrainer": "Besiegt durch ",
"defeatedTrainerDouble": "Besiegt durch Doppelkampf",
"defeatedRival": "Besiegt durch Rivalin",
"defeated": "Besiegt",
"defeatedWild_female": "Besiegt durch ",
"defeatedTrainer_female": "Besiegt durch ",
"defeatedTrainerDouble_female": "Besiegt durch Doppelkampf",
"defeatedRival_female": "Besiegt durch Rivale",
"defeated_female": "Besiegt",
"luck": "Glück",
"score": "Punkte",
"mode": "Modus",
@ -30,8 +30,8 @@
"money": "Geld",
"runLength": "Durchlauf Dauer",
"viewHeldItems": "Getragene Items",
"hallofFameTextM": "Willkommen in der Ruhmeshalle!",
"hallofFameTextF": "Willkommen in der Ruhmeshalle",
"hallofFameText": "Willkommen in der Ruhmeshalle!",
"hallofFameText_female": "Willkommen in der Ruhmeshalle",
"viewHallOfFame": "Ruhmeshalle ansehen!",
"viewEndingSplash": "Endgrafik anzeigen!"
}

View File

@ -1,15 +1,15 @@
{
"victory": "Victory!",
"defeatedWildM": "Defeated by ",
"defeatedTrainerM": "Defeated by ",
"defeatedTrainerDoubleM": "Defeated by Duo",
"defeatedRivalM": "Defeated by Rival",
"defeatedM": "Defeated",
"defeatedWildF": "Defeated by ",
"defeatedTrainerF": "Defeated by ",
"defeatedTrainerDoubleF": "Defeated by Duo",
"defeatedRivalF": "Defeated by Rival",
"defeatedF": "Defeated",
"defeatedWild": "Defeated by ",
"defeatedTrainer": "Defeated by ",
"defeatedTrainerDouble": "Defeated by Duo",
"defeatedRival": "Defeated by Rival",
"defeated": "Defeated",
"defeatedWild_female": "Defeated by ",
"defeatedTrainer_female": "Defeated by ",
"defeatedTrainerDouble_female": "Defeated by Duo",
"defeatedRival_female": "Defeated by Rival",
"defeated_female": "Defeated",
"luck": "Luck",
"score": "Score",
"mode": "Mode",
@ -30,8 +30,8 @@
"money": "Money",
"runLength": "Run Length",
"viewHeldItems": "Held Items",
"hallofFameTextM": "Welcome to the Hall of Fame!",
"hallofFameTextF": "Welcome to the Hall of Fame!",
"hallofFameText": "Welcome to the Hall of Fame!",
"hallofFameText_female": "Welcome to the Hall of Fame!",
"viewHallOfFame": "View Hall of Fame!",
"viewEndingSplash": "View ending art!"
}

View File

@ -1,15 +1,15 @@
{
"victory": "¡Victoria!",
"defeatedWildM": "Derrotado por ",
"defeatedTrainerM": "Derrotado por ",
"defeatedTrainerDoubleM": "Derrotado por un dúo",
"defeatedRivalM": "Derrotado por el rival",
"defeatedM": "Derrotado",
"defeatedWildF": "Derrotada por ",
"defeatedTrainerF": "Derrotada por ",
"defeatedTrainerDoubleF": "Derrotada por un dúo",
"defeatedRivalF": "Derrotada por el rival",
"defeatedF": "Derrotada",
"defeatedWild": "Derrotado por ",
"defeatedTrainer": "Derrotado por ",
"defeatedTrainerDouble": "Derrotado por un dúo",
"defeatedRival": "Derrotado por el rival",
"defeated": "Derrotado",
"defeatedWild_female": "Derrotada por ",
"defeatedTrainer_female": "Derrotada por ",
"defeatedTrainerDouble_female": "Derrotada por un dúo",
"defeatedRival_female": "Derrotada por el rival",
"defeated_female": "Derrotada",
"luck": "Suerte",
"score": "Puntuación",
"mode": "Modo",
@ -30,8 +30,8 @@
"money": "Dinero",
"runLength": "Duración de partida",
"viewHeldItems": "Objetos equipados",
"hallofFameTextM": "¡Bienvenido al Hall de la Fama!",
"hallofFameTextF": "¡Bienvenida al Hall de la Fama!",
"hallofFameText": "¡Bienvenido al Hall de la Fama!",
"hallofFameText_female": "¡Bienvenida al Hall de la Fama!",
"viewHallOfFame": "¡Ver Hall de la Fama!",
"viewEndingSplash": "¡Ver la imagen final!"
}

View File

@ -1,15 +1,15 @@
{
"victory": "Victoire !",
"defeatedWildM": "Battu par ",
"defeatedTrainerM": "Battu par ",
"defeatedTrainerDoubleM": "Battu par Duo",
"defeatedRivalM": "Battu par Rivale",
"defeatedM": "Vaincu",
"defeatedWildF": "Battue par ",
"defeatedTrainerF": "Battue par ",
"defeatedTrainerDoubleF": "Battue par Duo",
"defeatedRivalF": "Battue par Rival",
"defeatedF": "Vaincue",
"defeatedWild": "Battu par ",
"defeatedTrainer": "Battu par ",
"defeatedTrainerDouble": "Battu par Duo",
"defeatedRival": "Battu par Rivale",
"defeated": "Vaincu",
"defeatedWild_female": "Battue par ",
"defeatedTrainer_female": "Battue par ",
"defeatedTrainerDouble_female": "Battue par Duo",
"defeatedRival_female": "Battue par Rival",
"defeated_female": "Vaincue",
"luck": "Chance ",
"score": "Score",
"mode": "Mode ",
@ -30,8 +30,8 @@
"money": "Argent",
"runLength": "Durée session ",
"viewHeldItems": "Objets tenus",
"hallofFameTextM": "Bienvenue au Panthéon !",
"hallofFameTextF": "Bienvenue au Panthéon !",
"hallofFameText": "Bienvenue au Panthéon !",
"hallofFameText_female": "Bienvenue au Panthéon !",
"viewHallOfFame": "Voir le Panthéon",
"viewEndingSplash": "Voir lillustration\nde fin"
}

View File

@ -1,15 +1,15 @@
{
"victory": "Vittoria!",
"defeatedWildM": "Sconfitto da ",
"defeatedTrainerM": "Sconfitto da ",
"defeatedTrainerDoubleM": "Sconfitto dalla coppia ",
"defeatedRivalM": "Sconfitto dalla rivale",
"defeatedM": "Sconfitto",
"defeatedWildF": "Sconfitta da ",
"defeatedTrainerF": "Sconfitta da ",
"defeatedTrainerDoubleF": "Sconfitta dalla coppia ",
"defeatedRivalF": "Sconfitta dal rivale",
"defeatedF": "Sconfitta",
"defeatedWild": "Sconfitto da ",
"defeatedTrainer": "Sconfitto da ",
"defeatedTrainerDouble": "Sconfitto dalla coppia ",
"defeatedRival": "Sconfitto dalla rivale",
"defeated": "Sconfitto",
"defeatedWild_female": "Sconfitta da ",
"defeatedTrainer_female": "Sconfitta da ",
"defeatedTrainerDouble_female": "Sconfitta dalla coppia ",
"defeatedRival_female": "Sconfitta dal rivale",
"defeated_female": "Sconfitta",
"luck": "Fortuna",
"score": "Punteggio",
"mode": "Modalità",
@ -30,8 +30,8 @@
"money": "Patrimonio",
"runLength": "Durata Run",
"viewHeldItems": "Oggetti equip.",
"hallofFameTextM": "Benvenuto alla Sala d'Onore!",
"hallofFameTextF": "Benvenuto alla Sala d'Onore!",
"hallofFameText": "Benvenuto alla Sala d'Onore!",
"hallofFameText_female": "Benvenuto alla Sala d'Onore!",
"viewHallOfFame": "Vai alla Sala d'Onore!",
"viewEndingSplash": "Vai all'arte finale!"
}

View File

@ -5,11 +5,11 @@
"defeatedTrainerDouble": "倒された相手:",
"defeatedRival": "倒された相手:",
"defeated": "敗北",
"defeatedWildF": "倒された相手:",
"defeatedTrainerF": "倒された相手:",
"defeatedTrainerDoubleF": "倒された相手:",
"defeatedRivalF": "倒された相手:",
"defeatedF": "敗北",
"defeatedWild_female": "倒された相手:",
"defeatedTrainer_female": "倒された相手:",
"defeatedTrainerDouble_female": "倒された相手:",
"defeatedRival_female": "倒された相手:",
"defeated_female": "敗北",
"luck": "運",
"score": "スコア",
"mode": "モード",
@ -30,8 +30,8 @@
"money": "お金",
"runLength": "ラン最高ウェーブ",
"viewHeldItems": "手持ちアイテム",
"hallofFameTextM": "殿堂へようこそ!",
"hallofFameTextF": "殿堂へようこそ!",
"hallofFameText": "殿堂へようこそ!",
"hallofFameText_female": "殿堂へようこそ!",
"viewHallOfFame": "殿堂登録を見る!",
"viewEndingSplash": "クリア後のアートを見る!"
}

View File

@ -1,15 +1,15 @@
{
"victory": "승리!",
"defeatedWildM": "야생에서 패배: ",
"defeatedTrainerM": "트레이너에게 패배: ",
"defeatedTrainerDoubleM": "더블 배틀에서 패배",
"defeatedRivalM": "라이벌에게 패배",
"defeatedM": "패배",
"defeatedWildF": "야생에서 패배: ",
"defeatedTrainerF": "트레이너에게 패배: ",
"defeatedTrainerDoubleF": "더블 배틀에서 패배",
"defeatedRivalF": "라이벌에게 패배",
"defeatedF": "패배",
"defeatedWild": "야생에서 패배: ",
"defeatedTrainer": "트레이너에게 패배: ",
"defeatedTrainerDouble": "더블 배틀에서 패배",
"defeatedRival": "라이벌에게 패배",
"defeated": "패배",
"defeatedWild_female": "야생에서 패배: ",
"defeatedTrainer_female": "트레이너에게 패배: ",
"defeatedTrainerDouble_female": "더블 배틀에서 패배",
"defeatedRival_female": "라이벌에게 패배",
"defeated_female": "패배",
"luck": "행운",
"score": "점수",
"mode": "모드",
@ -30,8 +30,8 @@
"money": "소지금",
"runLength": "플레이 타임",
"viewHeldItems": "도구",
"hallofFameTextM": "전당 등록을 축하합니다!",
"hallofFameTextF": "전당 등록을 축하합니다!",
"hallofFameText": "전당 등록을 축하합니다!",
"hallofFameText_female": "전당 등록을 축하합니다!",
"viewHallOfFame": "전당 보기",
"viewEndingSplash": "엔딩 화면 보기"
}

View File

@ -1,15 +1,15 @@
{
"victory": "Vitória!",
"defeatedWildM": "Derrotado por ",
"defeatedTrainerM": "Derrotado por ",
"defeatedTrainerDoubleM": "Derrotado por Dupla",
"defeatedRivalM": "Derrotado por Rival",
"defeatedM": "Derrotado",
"defeatedWildF": "Derrotada por ",
"defeatedTrainerF": "Derrotada por ",
"defeatedTrainerDoubleF": "Derrotada por Dupla",
"defeatedRivalF": "Derrotada por Rival",
"defeatedF": "Derrotada",
"defeatedWild": "Derrotado por ",
"defeatedTrainer": "Derrotado por ",
"defeatedTrainerDouble": "Derrotado por Dupla",
"defeatedRival": "Derrotado por Rival",
"defeated": "Derrotado",
"defeatedWild_female": "Derrotada por ",
"defeatedTrainer_female": "Derrotada por ",
"defeatedTrainerDouble_female": "Derrotada por Dupla",
"defeatedRival_female": "Derrotada por Rival",
"defeated_female": "Derrotada",
"luck": "Sorte",
"score": "Pontuação",
"mode": "Modo",
@ -30,8 +30,8 @@
"money": "Dinheiro",
"runLength": "Duração do Jogo",
"viewHeldItems": "Itens Segurados",
"hallofFameTextM": "Bem-vindo ao Hall da Fama!",
"hallofFameTextF": "Bem-vinda ao Hall da Fama!",
"hallofFameText": "Bem-vindo ao Hall da Fama!",
"hallofFameText_female": "Bem-vinda ao Hall da Fama!",
"viewHallOfFame": "Veja o Hall da Fama!",
"viewEndingSplash": "Veja a arte final!"
}

View File

@ -4,12 +4,12 @@
"defeatedTrainer": "被打败",
"defeatedTrainerDouble": "被组合打败",
"defeatedRival": "被劲敌打败",
"defeatedM": "被打败",
"defeatedWildF": "被打败",
"defeatedTrainerF": "被打败",
"defeatedTrainerDoubleF": "被组合打败",
"defeatedRivalF": "被劲敌打败",
"defeatedF": "被打败",
"defeated": "被打败",
"defeatedWild_female": "被打败",
"defeatedTrainer_female": "被打败",
"defeatedTrainerDouble_female": "被组合打败",
"defeatedRival_female": "被劲敌打败",
"defeated_female": "被打败",
"luck": "幸运",
"score": "分数",
"mode": "模式",
@ -30,8 +30,8 @@
"money": "金钱",
"runLength": "游戏时长",
"viewHeldItems": "持有道具",
"hallofFameTextM": "欢迎来到名人堂!",
"hallofFameTextF": "欢迎来到名人堂!",
"hallofFameText": "欢迎来到名人堂!",
"hallofFameText_female": "欢迎来到名人堂!",
"viewHallOfFame": "浏览名人堂!",
"viewEndingSplash": "浏览结算画面"
}

View File

@ -1,15 +1,15 @@
{
"victory": "勝利!",
"defeatedWildM": "被打敗",
"defeatedTrainerM": "被打敗",
"defeatedTrainerDoubleM": "被組合打敗",
"defeatedRivalM": "被勁敵打敗",
"defeatedM": "被打敗",
"defeatedWildF": "被打敗",
"defeatedTrainerF": "被打敗",
"defeatedTrainerDoubleF": "被組合打敗",
"defeatedRivalF": "被勁敵打敗",
"defeatedF": "被打敗",
"defeatedWild": "被打敗",
"defeatedTrainer": "被打敗",
"defeatedTrainerDouble": "被組合打敗",
"defeatedRival": "被勁敵打敗",
"defeated": "被打敗",
"defeatedWild_female": "被打敗",
"defeatedTrainer_female": "被打敗",
"defeatedTrainerDouble_female": "被組合打敗",
"defeatedRival_female": "被勁敵打敗",
"defeated_female": "被打敗",
"luck": "幸運",
"score": "分數",
"mode": "模式",
@ -30,8 +30,8 @@
"money": "金錢",
"runLength": "遊戲時長",
"viewHeldItems": "持有道具",
"hallofFameTextM": "歡迎來到名人堂!",
"hallofFameTextF": "歡迎來到名人堂!",
"hallofFameText": "歡迎來到名人堂!",
"hallofFameText_female": "歡迎來到名人堂!",
"viewHallOfFame": "浏覽名人堂!",
"viewEndingSplash": "浏覽結算畫面"
}

View File

@ -278,11 +278,12 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
const gameOutcomeLabel = addTextObject(this.scene, 8, 5, `${i18next.t("runHistory:victory")}`, TextStyle.WINDOW);
this.add(gameOutcomeLabel);
} else { // Run Result: Defeats
const genderLabel = (this.scene.gameData.gender === PlayerGender.FEMALE) ? "F" : "M";
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase();
// Defeats from wild Pokemon battles will show the Pokemon responsible by the text of the run result.
if (data.battleType === BattleType.WILD) {
const enemyContainer = this.scene.add.container(8, 5);
const gameOutcomeLabel = addTextObject(this.scene, 0, 0, `${i18next.t("runHistory:defeatedWild"+genderLabel)}`, TextStyle.WINDOW);
const gameOutcomeLabel = addTextObject(this.scene, 0, 0, `${i18next.t("runHistory:defeatedWild", { context: genderStr })}`, TextStyle.WINDOW);
enemyContainer.add(gameOutcomeLabel);
data.enemyParty.forEach((enemyData, e) => {
const enemyIconContainer = this.scene.add.container(65+(e*25), -8);
@ -307,10 +308,10 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
const RIVAL_TRAINER_ID_THRESHOLD = 375;
if (data.trainer.trainerType >= RIVAL_TRAINER_ID_THRESHOLD) {
const rivalName = (tObj.variant === TrainerVariant.FEMALE) ? "trainerNames:rival_female" : "trainerNames:rival";
const gameOutcomeLabel = addTextObject(this.scene, 8, 5, `${i18next.t("runHistory:defeatedRival"+genderLabel)} ${i18next.t(rivalName)}`, TextStyle.WINDOW);
const gameOutcomeLabel = addTextObject(this.scene, 8, 5, `${i18next.t("runHistory:defeatedRival", { context: genderStr })} ${i18next.t(rivalName)}`, TextStyle.WINDOW);
this.add(gameOutcomeLabel);
} else {
const gameOutcomeLabel = addTextObject(this.scene, 8, 5, `${i18next.t("runHistory:defeatedTrainer"+genderLabel)}${tObj.getName(0, true)}`, TextStyle.WINDOW);
const gameOutcomeLabel = addTextObject(this.scene, 8, 5, `${i18next.t("runHistory:defeatedTrainer", { context: genderStr })}${tObj.getName(0, true)}`, TextStyle.WINDOW);
this.add(gameOutcomeLabel);
}
}

View File

@ -42,7 +42,6 @@ enum RunInfoUiMode {
export default class RunInfoUiHandler extends UiHandler {
protected runInfo: SessionSaveData;
protected isVictory: boolean;
protected isPGF: boolean;
protected pageMode: RunInfoUiMode;
protected runContainer: Phaser.GameObjects.Container;
@ -94,7 +93,6 @@ export default class RunInfoUiHandler extends UiHandler {
// Assigning information necessary for the UI's creation
this.runInfo = this.scene.gameData.parseSessionData(JSON.stringify(run.entry));
this.isVictory = run.isVictory;
this.isPGF = this.scene.gameData.gender === PlayerGender.FEMALE;
this.pageMode = RunInfoUiMode.MAIN;
// Creates Header and adds to this.runContainer
@ -173,8 +171,10 @@ export default class RunInfoUiHandler extends UiHandler {
*
*/
private async parseRunResult() {
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex];
const runResultTextStyle = this.isVictory ? TextStyle.SUMMARY : TextStyle.SUMMARY_RED;
const runResultTitle = this.isVictory ? i18next.t("runHistory:victory") : (this.isPGF ? i18next.t("runHistory:defeatedF") : i18next.t("runHistory:defeatedM"));
const runResultTitle = this.isVictory ? i18next.t("runHistory:victory") : i18next.t("runHistory:defeated", { context: genderStr });
const runResultText = addBBCodeTextObject(this.scene, 6, 5, `${runResultTitle} - ${i18next.t("saveSlotSelectUiHandler:wave")} ${this.runInfo.waveIndex}`, runResultTextStyle, {fontSize : "65px", lineSpacing: 0.1});
if (this.isVictory) {
@ -684,7 +684,9 @@ export default class RunInfoUiHandler extends UiHandler {
*/
private createVictorySplash(): void {
this.endCardContainer = this.scene.add.container(0, 0);
const endCard = this.scene.add.image(0, 0, `end_${this.isPGF ? "f" : "m"}`);
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const isFemale = genderIndex === PlayerGender.FEMALE;
const endCard = this.scene.add.image(0, 0, `end_${isFemale ? "f" : "m"}`);
endCard.setOrigin(0);
endCard.setScale(0.5);
const text = addTextObject(this.scene, this.scene.game.canvas.width / 12, (this.scene.game.canvas.height / 6) - 16, i18next.t("battle:congratulations"), TextStyle.SUMMARY, { fontSize: "128px" });
@ -698,16 +700,19 @@ export default class RunInfoUiHandler extends UiHandler {
* This could be adapted into a public-facing method for victory screens. Perhaps.
*/
private createHallofFame(): void {
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const isFemale = genderIndex === PlayerGender.FEMALE;
const genderStr = PlayerGender[genderIndex].toLowerCase();
// Issue Note (08-05-2024): It seems as if fused pokemon do not appear with the averaged color b/c pokemonData's loadAsset requires there to be some active battle?
// As an alternative, the icons of the second/bottom fused Pokemon have been placed next to their fellow fused Pokemon in Hall of Fame
this.hallofFameContainer = this.scene.add.container(0, 0);
// Thank you Hayuna for the code
const endCard = this.scene.add.image(0, 0, `end_${this.isPGF ? "f" : "m"}`);
const endCard = this.scene.add.image(0, 0, `end_${isFemale ? "f" : "m"}`);
endCard.setOrigin(0);
endCard.setPosition(-1, -1);
endCard.setScale(0.5);
const endCardCoords = endCard.getBottomCenter();
const overlayColor = this.isPGF ? "red" : "blue";
const overlayColor = isFemale ? "red" : "blue";
const hallofFameBg = this.scene.add.image(0, 0, "hall_of_fame_"+overlayColor);
hallofFameBg.setPosition(159, 89);
hallofFameBg.setSize(this.scene.game.canvas.width, this.scene.game.canvas.height+10);
@ -715,7 +720,7 @@ export default class RunInfoUiHandler extends UiHandler {
this.hallofFameContainer.add(endCard);
this.hallofFameContainer.add(hallofFameBg);
const hallofFameText = addTextObject(this.scene, 0, 0, i18next.t("runHistory:hallofFameText"+(this.isPGF ? "F" : "M")), TextStyle.WINDOW);
const hallofFameText = addTextObject(this.scene, 0, 0, i18next.t("runHistory:hallofFameText", { context: genderStr }), TextStyle.WINDOW);
hallofFameText.setPosition(endCardCoords.x-(hallofFameText.displayWidth/2), 164);
this.hallofFameContainer.add(hallofFameText);
this.runInfo.party.forEach((p, i) => {