This should fix the summaryOption feature without bugging confirm-ui-handler in other cases

This commit is contained in:
Frutescens 2024-07-06 13:12:53 -07:00
parent fcb43b0f2c
commit c1ad4e121d
2 changed files with 8 additions and 8 deletions

View File

@ -5014,7 +5014,7 @@ export class AttemptCapturePhase extends PokemonPhase {
removePokemon();
end();
});
});
}, pokemon);
});
};
promptRelease();

View File

@ -4,6 +4,7 @@ import { Mode } from "./ui";
import i18next from "i18next";
import {Button} from "#enums/buttons";
export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
public static readonly windowWidth: integer = 48;
@ -20,7 +21,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
}
show(args: any[]): boolean {
if (args.length === 3 && args[0].toString().includes("newPokemon")) {
if (args.length === 4 && args[0] instanceof Function && args[1] instanceof Function && args[2] instanceof Function && args[3]) {
const config: OptionSelectConfig = {
options: [
{
@ -43,22 +44,21 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
}
}
],
delay: args.length >= 7 && args[6] !== null ? args[6] as integer : 0
delay: args.length >= 8 && args[7] !== null ? args[7] as integer : 0
};
super.show([ config ]);
this.switchCheck = args.length >= 4 && args[3] !== null && args[3] as boolean;
this.switchCheck = args.length >= 5 && args[4] !== null && args[4] as boolean;
const xOffset = (args.length >= 5 && args[4] !== null ? args[4] as number : 0);
const yOffset = (args.length >= 6 && args[5] !== null ? args[5] as number : 0);
const xOffset = (args.length >= 6 && args[5] !== null ? args[5] as number : 0);
const yOffset = (args.length >= 7 && args[6] !== null ? args[6] as number : 0);
this.optionSelectContainer.setPosition((this.scene.game.canvas.width / 6) - 1 + xOffset, -48 + yOffset);
this.setCursor(this.switchCheck ? this.switchCheckCursor : 0);
return true;
} else if (args.length === 2 && args[0] instanceof Function && args[1] instanceof Function) {
} else if (args.length >= 2 && args[0] instanceof Function && args[1] instanceof Function) {
const config: OptionSelectConfig = {
options: [
{