mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-13 20:02:19 +02:00
Added rename pokemon hook
When Action is pressed on the Status tab, switch to Rename mode. For now, it just locks the menu until you press submit or cancel.
This commit is contained in:
parent
bde7620ac0
commit
efe35774fe
@ -29,7 +29,8 @@ enum Page {
|
||||
|
||||
export enum SummaryUiMode {
|
||||
DEFAULT,
|
||||
LEARN_MOVE
|
||||
LEARN_MOVE,
|
||||
RENAME,
|
||||
}
|
||||
|
||||
export default class SummaryUiHandler extends UiHandler {
|
||||
@ -79,6 +80,10 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
private moveCursor: integer;
|
||||
private selectedMoveIndex: integer;
|
||||
|
||||
private renamePokemon: boolean;
|
||||
private newName: string;
|
||||
private isCapitalized: boolean;
|
||||
|
||||
constructor(scene: BattleScene) {
|
||||
super(scene, Mode.SUMMARY);
|
||||
}
|
||||
@ -265,6 +270,7 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.pokemon.cry();
|
||||
|
||||
this.nameText.setText(this.pokemon.name);
|
||||
this.newName = this.pokemon.name;
|
||||
|
||||
const isFusion = this.pokemon.isFusion();
|
||||
|
||||
@ -415,17 +421,31 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.renamePokemon) {
|
||||
if (button === Button.SUBMIT) {
|
||||
this.pokemon.name = this.newName;
|
||||
this.hideRenamePokemon();
|
||||
} else if (button === Button.CANCEL) {
|
||||
this.newName = this.pokemon.name;
|
||||
this.hideRenamePokemon();
|
||||
}
|
||||
} else {
|
||||
if (button === Button.ACTION) {
|
||||
if (this.cursor === Page.MOVES) {
|
||||
this.showMoveSelect();
|
||||
success = true;
|
||||
} else if (this.cursor === Page.STATUS) {
|
||||
this.showRenamePokemon();
|
||||
success = true;
|
||||
}
|
||||
} else if (button === Button.CANCEL) {
|
||||
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE)
|
||||
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE) {
|
||||
this.hideMoveSelect();
|
||||
else
|
||||
} else if (this.summaryUiMode === SummaryUiMode.RENAME) {
|
||||
this.hideRenamePokemon();
|
||||
} else {
|
||||
ui.setMode(Mode.PARTY);
|
||||
}
|
||||
success = true;
|
||||
} else {
|
||||
const pages = Utils.getEnumValues(Page);
|
||||
@ -902,6 +922,13 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
showRenamePokemon() {
|
||||
this.renamePokemon = true;
|
||||
}
|
||||
hideRenamePokemon() {
|
||||
this.renamePokemon = false;
|
||||
}
|
||||
|
||||
showMoveSelect() {
|
||||
this.moveSelect = true;
|
||||
this.extraMoveRowContainer.setVisible(true);
|
||||
|
Loading…
Reference in New Issue
Block a user