From 596a081a64cdd3a745b1e4d525c890b09abf8fe8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 17 Mar 2023 22:19:00 +0100 Subject: [PATCH] Fix evmenu doc example --- docs/source/Components/EvMenu.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/Components/EvMenu.md b/docs/source/Components/EvMenu.md index 44c2f5e6d1..ba3f8f9eaa 100644 --- a/docs/source/Components/EvMenu.md +++ b/docs/source/Components/EvMenu.md @@ -645,9 +645,6 @@ def _gamble(caller, raw_string, **kwargs): else: return "win" -def _try_again(caller, raw_string, **kwargs): - return None # reruns the same node - template_string = """ ## node start @@ -660,8 +657,8 @@ he says. ## options -1. Roll the dice -> gamble() -2. Try to talk yourself out of rolling -> ask_again() +1: Roll the dice -> gamble() +2: Try to talk yourself out of rolling -> start ## node win @@ -687,7 +684,9 @@ says Death. """ -goto_callables = {"gamble": _gamble, "ask_again": _ask_again} +# map the in-template callable-name to real python code +goto_callables = {"gamble": _gamble} +# this starts the evmenu for the caller evmenu.template2menu(caller, template_string, goto_callables) ```