mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-24 05:55:56 +02:00
* Extract Mode enum out of UI and into its own file Reduces circular imports from 909 to 773 * Move around utility files Reduces cyclical dependencies from 773 to 765 * Remove starterColors and bypassLogin from battle-scene Reduces cyclical dependencies from 765 to 623 * Fix test runner error * Update import for bypassLogin in test * Update mocks for utils in tests * Fix broken tests * Update selectWithTera override * Update path for utils in ab-attr.ts * Update path for utils in ability-class.ts * Fix utils import path in healer.test.ts
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { PlayerGender } from "#app/enums/player-gender";
|
|
import { Phase } from "#app/phase";
|
|
import { SettingKeys } from "#app/system/settings/settings";
|
|
import { UiMode } from "#enums/ui-mode";
|
|
import i18next from "i18next";
|
|
|
|
export class SelectGenderPhase extends Phase {
|
|
start(): void {
|
|
super.start();
|
|
|
|
globalScene.ui.showText(i18next.t("menu:boyOrGirl"), null, () => {
|
|
globalScene.ui.setMode(UiMode.OPTION_SELECT, {
|
|
options: [
|
|
{
|
|
label: i18next.t("settings:boy"),
|
|
handler: () => {
|
|
globalScene.gameData.gender = PlayerGender.MALE;
|
|
globalScene.gameData.saveSetting(SettingKeys.Player_Gender, 0);
|
|
globalScene.gameData.saveSystem().then(() => this.end());
|
|
return true;
|
|
},
|
|
},
|
|
{
|
|
label: i18next.t("settings:girl"),
|
|
handler: () => {
|
|
globalScene.gameData.gender = PlayerGender.FEMALE;
|
|
globalScene.gameData.saveSetting(SettingKeys.Player_Gender, 1);
|
|
globalScene.gameData.saveSystem().then(() => this.end());
|
|
return true;
|
|
},
|
|
},
|
|
],
|
|
});
|
|
});
|
|
}
|
|
|
|
end(): void {
|
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
|
super.end();
|
|
}
|
|
}
|