Updated rename state management

Some variables that should've been set is not but now is set.
pull/558/head
Robert Antonius 2024-05-07 00:20:21 +07:00 committed by GitHub
parent efe35774fe
commit 106b252ef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 3 deletions

View File

@ -270,7 +270,6 @@ export default class SummaryUiHandler extends UiHandler {
this.pokemon.cry(); this.pokemon.cry();
this.nameText.setText(this.pokemon.name); this.nameText.setText(this.pokemon.name);
this.newName = this.pokemon.name;
const isFusion = this.pokemon.isFusion(); const isFusion = this.pokemon.isFusion();
@ -425,9 +424,10 @@ export default class SummaryUiHandler extends UiHandler {
if (button === Button.SUBMIT) { if (button === Button.SUBMIT) {
this.pokemon.name = this.newName; this.pokemon.name = this.newName;
this.hideRenamePokemon(); this.hideRenamePokemon();
success = true;
} else if (button === Button.CANCEL) { } else if (button === Button.CANCEL) {
this.newName = this.pokemon.name;
this.hideRenamePokemon(); this.hideRenamePokemon();
success = true;
} }
} else { } else {
if (button === Button.ACTION) { if (button === Button.ACTION) {
@ -924,9 +924,13 @@ export default class SummaryUiHandler extends UiHandler {
showRenamePokemon() { showRenamePokemon() {
this.renamePokemon = true; this.renamePokemon = true;
this.newName = this.pokemon.name;
this.isCapitalized = true;
} }
hideRenamePokemon() { hideRenamePokemon() {
this.renamePokemon = false; this.renamePokemon = false;
this.newName = this.pokemon.name;
this.isCapitalized = true;
} }
showMoveSelect() { showMoveSelect() {
@ -1013,6 +1017,11 @@ export default class SummaryUiHandler extends UiHandler {
} }
this.hideMoveEffect(true); this.hideMoveEffect(true);
} }
if (this.renamePokemon) {
this.renamePokemon = false;
this.newName = this.pokemon.name;
this.isCapitalized = true;
}
this.summaryContainer.setVisible(false); this.summaryContainer.setVisible(false);
this.summaryPageContainer.setVisible(false); this.summaryPageContainer.setVisible(false);
} }