From 106b252ef2572f6844283c6dde46ce5e0c129d6a Mon Sep 17 00:00:00 2001 From: Robert Antonius <40657895+roberika@users.noreply.github.com> Date: Tue, 7 May 2024 00:20:21 +0700 Subject: [PATCH] Updated rename state management Some variables that should've been set is not but now is set. --- src/ui/summary-ui-handler.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 8a1babe4b..3245a10ef 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -270,7 +270,6 @@ 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(); @@ -345,7 +344,7 @@ export default class SummaryUiHandler extends UiHandler { this.status.setFrame(this.pokemon.status ? StatusEffect[this.pokemon.status.effect].toLowerCase() : 'pokerus'); } else this.hideStatus(!fromSummary); - + return true; } @@ -425,9 +424,10 @@ export default class SummaryUiHandler extends UiHandler { if (button === Button.SUBMIT) { this.pokemon.name = this.newName; this.hideRenamePokemon(); + success = true; } else if (button === Button.CANCEL) { - this.newName = this.pokemon.name; this.hideRenamePokemon(); + success = true; } } else { if (button === Button.ACTION) { @@ -924,9 +924,13 @@ export default class SummaryUiHandler extends UiHandler { showRenamePokemon() { this.renamePokemon = true; + this.newName = this.pokemon.name; + this.isCapitalized = true; } hideRenamePokemon() { this.renamePokemon = false; + this.newName = this.pokemon.name; + this.isCapitalized = true; } showMoveSelect() { @@ -1013,6 +1017,11 @@ export default class SummaryUiHandler extends UiHandler { } this.hideMoveEffect(true); } + if (this.renamePokemon) { + this.renamePokemon = false; + this.newName = this.pokemon.name; + this.isCapitalized = true; + } this.summaryContainer.setVisible(false); this.summaryPageContainer.setVisible(false); }