From cd211d99010184db02f6826ba8c84564d76b4ad3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 17 Oct 2015 09:05:49 +0200 Subject: [PATCH] Added a mention of the use of caller.ndb._menutree in the docs to EvMenu. --- evennia/utils/evmenu.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 5fba5f6800..4bb600a496 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -45,6 +45,11 @@ entered to get to this node). The node function code will only be executed once per node-visit and the system will accept nodes with both one or two arguments interchangeably. +The menu tree itself is available on the caller as +`caller.ndb._menutree`. This makes it a convenient place to store +temporary state variables between nodes, since this NAttribute is +deleted when the menu is exited. + The return values must be given in the above order, but each can be returned as None as well. If the options are returned as None, the menu is immediately exited and the default "look" command is called. @@ -203,7 +208,6 @@ class CmdEvMenuNode(Command): cmd_on_quit = menu.cmd_on_quit default = menu.default - print "cmd, options:", cmd, options if cmd in options: # this will overload the other commands # if it has the same name!