From c1ad4e121df0f210be28f0d406029ce12a55dc96 Mon Sep 17 00:00:00 2001 From: Frutescens Date: Sat, 6 Jul 2024 13:12:53 -0700 Subject: [PATCH] This should fix the summaryOption feature without bugging confirm-ui-handler in other cases --- src/phases.ts | 2 +- src/ui/confirm-ui-handler.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 40a2683b09d..6013dd41f3d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -5014,7 +5014,7 @@ export class AttemptCapturePhase extends PokemonPhase { removePokemon(); end(); }); - }); + }, pokemon); }); }; promptRelease(); diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index d6dadee15cb..95b8cbc29e5 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -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: [ {