mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-17 22:40:59 +00:00
[Bug] Run History Day 1 patch (#3715)
* Money Display Fix + Partially localized import data * Fixed Japanese text. --------- Co-authored-by: frutescens <info@laptop>
This commit is contained in:
parent
9bcbc66db0
commit
f6551efc36
@ -1411,6 +1411,7 @@ export class GameData {
|
|||||||
case GameDataType.RUN_HISTORY:
|
case GameDataType.RUN_HISTORY:
|
||||||
const data = JSON.parse(dataStr);
|
const data = JSON.parse(dataStr);
|
||||||
const keys = Object.keys(data);
|
const keys = Object.keys(data);
|
||||||
|
dataName = i18next.t("menuUiHandler:RUN_HISTORY").toLowerCase();
|
||||||
keys.forEach((key) => {
|
keys.forEach((key) => {
|
||||||
const entryKeys = Object.keys(data[key]);
|
const entryKeys = Object.keys(data[key]);
|
||||||
valid = ["isFavorite", "isVictory", "entry"].every(v => entryKeys.includes(v)) && entryKeys.length === 3;
|
valid = ["isFavorite", "isVictory", "entry"].every(v => entryKeys.includes(v)) && entryKeys.length === 3;
|
||||||
|
@ -409,10 +409,12 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
|
|
||||||
// Duration + Money
|
// Duration + Money
|
||||||
const runInfoTextContainer = this.scene.add.container(0, 0);
|
const runInfoTextContainer = this.scene.add.container(0, 0);
|
||||||
const runInfoText = addBBCodeTextObject(this.scene, 7, 0, "", TextStyle.WINDOW, {fontSize : "50px", lineSpacing:3});
|
// Japanese is set to a greater line spacing of 35px in addBBCodeTextObject() if lineSpacing < 12.
|
||||||
|
const lineSpacing = (i18next.resolvedLanguage === "ja") ? 12 : 3;
|
||||||
|
const runInfoText = addBBCodeTextObject(this.scene, 7, 0, "", TextStyle.WINDOW, {fontSize: "50px", lineSpacing: lineSpacing});
|
||||||
const runTime = Utils.getPlayTimeString(this.runInfo.playTime);
|
const runTime = Utils.getPlayTimeString(this.runInfo.playTime);
|
||||||
runInfoText.appendText(`${i18next.t("runHistory:runLength")}: ${runTime}`, false);
|
runInfoText.appendText(`${i18next.t("runHistory:runLength")}: ${runTime}`, false);
|
||||||
const runMoney = Utils.formatMoney(this.runInfo.money, 1000);
|
const runMoney = Utils.formatMoney(this.scene.moneyFormat, this.runInfo.money);
|
||||||
runInfoText.appendText(`[color=${getTextColor(TextStyle.MONEY)}]${i18next.t("battleScene:moneyOwned", {formattedMoney : runMoney})}[/color]`);
|
runInfoText.appendText(`[color=${getTextColor(TextStyle.MONEY)}]${i18next.t("battleScene:moneyOwned", {formattedMoney : runMoney})}[/color]`);
|
||||||
runInfoText.setPosition(7, 70);
|
runInfoText.setPosition(7, 70);
|
||||||
runInfoTextContainer.add(runInfoText);
|
runInfoTextContainer.add(runInfoText);
|
||||||
@ -513,7 +515,9 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
}
|
}
|
||||||
const pPassiveInfo = pokemon.passive ? passiveLabel+": "+pokemon.getPassiveAbility().name : "";
|
const pPassiveInfo = pokemon.passive ? passiveLabel+": "+pokemon.getPassiveAbility().name : "";
|
||||||
const pAbilityInfo = abilityLabel + ": " + pokemon.getAbility().name;
|
const pAbilityInfo = abilityLabel + ": " + pokemon.getAbility().name;
|
||||||
const pokeInfoText = addBBCodeTextObject(this.scene, 0, 0, pName, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing:3});
|
// Japanese is set to a greater line spacing of 35px in addBBCodeTextObject() if lineSpacing < 12.
|
||||||
|
const lineSpacing = (i18next.resolvedLanguage === "ja") ? 12 : 3;
|
||||||
|
const pokeInfoText = addBBCodeTextObject(this.scene, 0, 0, pName, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing: lineSpacing});
|
||||||
pokeInfoText.appendText(`${i18next.t("saveSlotSelectUiHandler:lv")}${Utils.formatFancyLargeNumber(pokemon.level, 1)} - ${pNature}`);
|
pokeInfoText.appendText(`${i18next.t("saveSlotSelectUiHandler:lv")}${Utils.formatFancyLargeNumber(pokemon.level, 1)} - ${pNature}`);
|
||||||
pokeInfoText.appendText(pAbilityInfo);
|
pokeInfoText.appendText(pAbilityInfo);
|
||||||
pokeInfoText.appendText(pPassiveInfo);
|
pokeInfoText.appendText(pPassiveInfo);
|
||||||
@ -537,12 +541,12 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
const speedLabel = (currentLanguage==="es"||currentLanguage==="pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened");
|
const speedLabel = (currentLanguage==="es"||currentLanguage==="pt_BR") ? i18next.t("runHistory:SPDshortened") : i18next.t("pokemonInfo:Stat.SPDshortened");
|
||||||
const speed = speedLabel+": "+pStats[5];
|
const speed = speedLabel+": "+pStats[5];
|
||||||
// Column 1: HP Atk Def
|
// Column 1: HP Atk Def
|
||||||
const pokeStatText1 = addBBCodeTextObject(this.scene, -5, 0, hp, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing:3});
|
const pokeStatText1 = addBBCodeTextObject(this.scene, -5, 0, hp, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing: lineSpacing});
|
||||||
pokeStatText1.appendText(atk);
|
pokeStatText1.appendText(atk);
|
||||||
pokeStatText1.appendText(def);
|
pokeStatText1.appendText(def);
|
||||||
pokeStatTextContainer.add(pokeStatText1);
|
pokeStatTextContainer.add(pokeStatText1);
|
||||||
// Column 2: SpAtk SpDef Speed
|
// Column 2: SpAtk SpDef Speed
|
||||||
const pokeStatText2 = addBBCodeTextObject(this.scene, 25, 0, spatk, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing:3});
|
const pokeStatText2 = addBBCodeTextObject(this.scene, 25, 0, spatk, TextStyle.SUMMARY, {fontSize: textContainerFontSize, lineSpacing: lineSpacing});
|
||||||
pokeStatText2.appendText(spdef);
|
pokeStatText2.appendText(spdef);
|
||||||
pokeStatText2.appendText(speed);
|
pokeStatText2.appendText(speed);
|
||||||
pokeStatTextContainer.add(pokeStatText2);
|
pokeStatTextContainer.add(pokeStatText2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user