mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-24 14:05:50 +02:00
* Move phase types out of phase interceptor * Create isXPhase method and add properties to each phase * Replace instanceof phase with isXPhase * Fix missing union types for phaseName * Update doc comment in phase.ts * Fix incomplete comment in encounter-phase * Make phaseName as public and fix more uses * Move phaseName property declaration before constructor in move anim phase Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Rename isXPhase to is --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 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 {
|
|
public readonly phaseName = "SelectGenderPhase";
|
|
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();
|
|
}
|
|
}
|