mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
Merge c884de339a
into 19af9bdb8b
This commit is contained in:
commit
3359b76952
@ -3,7 +3,7 @@ import { EFFECTIVE_STATS, getShortenedStatKey, Stat } from "#enums/stat";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import { getBBCodeFrag } from "#ui/text";
|
||||
import { toTitleCase } from "#utils/strings";
|
||||
import { toCamelCase } from "#utils/strings";
|
||||
import i18next from "i18next";
|
||||
|
||||
export function getNatureName(
|
||||
@ -13,7 +13,7 @@ export function getNatureName(
|
||||
ignoreBBCode = false,
|
||||
uiTheme: UiTheme = UiTheme.DEFAULT,
|
||||
): string {
|
||||
let ret = toTitleCase(Nature[nature]);
|
||||
let ret = toCamelCase(Nature[nature]);
|
||||
//Translating nature
|
||||
if (i18next.exists(`nature:${ret}`)) {
|
||||
ret = i18next.t(`nature:${ret}` as any);
|
||||
|
@ -31,14 +31,14 @@ export class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
|
||||
const config: OptionSelectConfig = {
|
||||
options: [
|
||||
{
|
||||
label: i18next.t("partyUiHandler:SUMMARY"),
|
||||
label: i18next.t("partyUiHandler:summary"),
|
||||
handler: () => {
|
||||
args[0]();
|
||||
return true;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18next.t("partyUiHandler:POKEDEX"),
|
||||
label: i18next.t("partyUiHandler:pokedex"),
|
||||
handler: () => {
|
||||
args[1]();
|
||||
return true;
|
||||
|
@ -27,7 +27,7 @@ import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { applyChallenges } from "#utils/challenge-utils";
|
||||
import { BooleanHolder, getLocalizedSpriteKey, randInt } from "#utils/common";
|
||||
import { toTitleCase } from "#utils/strings";
|
||||
import { toCamelCase, toTitleCase } from "#utils/strings";
|
||||
import i18next from "i18next";
|
||||
import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||
|
||||
@ -1573,12 +1573,12 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
const formChangeItemModifiers = this.getFormChangeItemsModifiers(pokemon);
|
||||
if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) {
|
||||
const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM];
|
||||
optionName = `${modifier.active ? i18next.t("partyUiHandler:DEACTIVATE") : i18next.t("partyUiHandler:ACTIVATE")} ${modifier.type.name}`;
|
||||
optionName = `${modifier.active ? i18next.t("partyUiHandler:deactivate") : i18next.t("partyUiHandler:activate")} ${modifier.type.name}`;
|
||||
} else if (option === PartyOption.UNPAUSE_EVOLUTION) {
|
||||
optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:UNPAUSE_EVOLUTION") : i18next.t("partyUiHandler:PAUSE_EVOLUTION")}`;
|
||||
optionName = `${pokemon.pauseEvolutions ? i18next.t("partyUiHandler:unpausedEvolution") : i18next.t("partyUiHandler:pauseEvolution")}`;
|
||||
} else {
|
||||
if (this.localizedOptions.includes(option)) {
|
||||
optionName = i18next.t(`partyUiHandler:${PartyOption[option]}`);
|
||||
optionName = i18next.t(`partyUiHandler:${toCamelCase(PartyOption[option])}`);
|
||||
} else {
|
||||
optionName = toTitleCase(PartyOption[option]);
|
||||
}
|
||||
@ -1595,7 +1595,7 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
.getLevelMoves()
|
||||
.find(plm => plm[1] === move);
|
||||
} else if (option === PartyOption.ALL) {
|
||||
optionName = i18next.t("partyUiHandler:ALL");
|
||||
optionName = i18next.t("partyUiHandler:all");
|
||||
} else {
|
||||
const itemModifiers = this.getItemModifiers(pokemon);
|
||||
const itemModifier = itemModifiers[option];
|
||||
@ -2190,7 +2190,7 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
|
||||
setup(party: PartyUiHandler) {
|
||||
this.transferIcon = globalScene.add.sprite(0, 0, "party_transfer");
|
||||
this.discardIcon = globalScene.add.sprite(0, 0, "party_discard");
|
||||
this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:TRANSFER"), TextStyle.PARTY);
|
||||
this.textBox = addTextObject(-8, -7, i18next.t("partyUiHandler:transfer"), TextStyle.PARTY);
|
||||
this.party = party;
|
||||
|
||||
this.add(this.transferIcon);
|
||||
@ -2238,14 +2238,14 @@ class PartyDiscardModeButton extends Phaser.GameObjects.Container {
|
||||
this.transferIcon.setVisible(true);
|
||||
this.discardIcon.setVisible(false);
|
||||
this.textBox.setVisible(true);
|
||||
this.textBox.setText(i18next.t("partyUiHandler:TRANSFER"));
|
||||
this.textBox.setText(i18next.t("partyUiHandler:transfer"));
|
||||
this.transferIcon.displayWidth = this.textBox.text.length * 9 + 3;
|
||||
break;
|
||||
case PartyUiMode.DISCARD:
|
||||
this.transferIcon.setVisible(false);
|
||||
this.discardIcon.setVisible(true);
|
||||
this.textBox.setVisible(true);
|
||||
this.textBox.setText(i18next.t("partyUiHandler:DISCARD"));
|
||||
this.textBox.setText(i18next.t("partyUiHandler:discard"));
|
||||
this.discardIcon.displayWidth = this.textBox.text.length * 9 + 3;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user