Moving edge case for release option into processReleaseOption

This commit is contained in:
Wlowscha 2025-05-13 22:13:49 +02:00
parent b58b633b6f
commit b3e6c20a35
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -440,6 +440,10 @@ export default class PartyUiHandler extends MessageUiHandler {
const ui = this.getUi(); const ui = this.getUi();
this.clearOptions(); this.clearOptions();
ui.playSelect(); ui.playSelect();
if (this.partyUiMode === PartyUiMode.RELEASE) {
this.doRelease(this.cursor);
return true;
}
if (this.cursor >= globalScene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) { if (this.cursor >= globalScene.currentBattle.getBattlerCount() || !pokemon.isAllowedInBattle()) {
this.blockInput = true; this.blockInput = true;
this.showText( this.showText(
@ -708,7 +712,7 @@ export default class PartyUiHandler extends MessageUiHandler {
return this.processRenameOption(pokemon); return this.processRenameOption(pokemon);
} }
// TODO: Figure out why we need this edge case // TODO: Figure out why we need this edge case
if (option === PartyOption.RELEASE && this.partyUiMode !== PartyUiMode.RELEASE) { if (option === PartyOption.RELEASE) {
return this.processReleaseOption(pokemon); return this.processReleaseOption(pokemon);
} }
if (option === PartyOption.SELECT) { if (option === PartyOption.SELECT) {
@ -764,10 +768,6 @@ export default class PartyUiHandler extends MessageUiHandler {
this.clearOptions(); this.clearOptions();
return true; return true;
} }
if (option === PartyOption.RELEASE) {
this.doRelease(this.cursor);
return true;
}
const selectCallback = this.selectCallback; const selectCallback = this.selectCallback;
this.selectCallback = null; this.selectCallback = null;
selectCallback(this.cursor, option); selectCallback(this.cursor, option);