From 5130eddf1f552ec08f51c0e36119c7adce9e8b4c Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Mon, 3 Feb 2025 19:07:14 +0100 Subject: [PATCH] Simplified function to throw balls in tests --- src/test/utils/gameManager.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index d3dfc20d989..6d8bb67160a 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -459,19 +459,19 @@ export default class GameManager { }); } - doThrowPokeball(ballIndex: number) { + /** + * Select the BALL option from the command menu, then press Action; in the BALL + * menu, select a pokéball type and press Action again to throw it. + * @param ballIndex the index of the pokeball to throw + */ + public doThrowPokeball(ballIndex: number) { this.onNextPrompt("CommandPhase", Mode.COMMAND, () => { (this.scene.ui.getHandler() as CommandUiHandler).setCursor(1); (this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION); }); - this.doSelectPokeball(ballIndex); - } - - doSelectPokeball(ballIndex: number) { this.onNextPrompt("CommandPhase", Mode.BALL, () => { const ballHandler = this.scene.ui.getHandler() as BallUiHandler; - ballHandler.setCursor(ballIndex); ballHandler.processInput(Button.ACTION); // select ball and throw });