From 135342ed59a4baf5e86c573c6680658bfbf91571 Mon Sep 17 00:00:00 2001 From: Black Ram <67595890+BlackRam-oss@users.noreply.github.com> Date: Sun, 19 May 2024 22:49:47 +0200 Subject: [PATCH] refactor: Add exitToChoiceMenu method to GameStepManager --- src/managers/StepManager.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/managers/StepManager.ts b/src/managers/StepManager.ts index 91f620db..f790f375 100644 --- a/src/managers/StepManager.ts +++ b/src/managers/StepManager.ts @@ -369,6 +369,22 @@ export default class GameStepManager { } return await GameStepManager.runCurrentStep(props) } + /** + * When the player is in a choice menu, can use this function to exit to the choice menu. + * @param props The props to pass to the step. + * @returns StepLabelResultType or undefined. + * @example + * ```typescript + * GameStepManager.exitToChoiceMenu(yourParams).then((result) => { + * if (result) { + * // your code + * } + * }) + * ``` + */ + public static async exitToChoiceMenu(props?: StepLabelPropsType): Promise { + return GameStepManager.runNextStep(props) + } /* After Update Methods */