- Jun 10, 2017
- 11,101
- 16,568
Ideally, when you use a menuset with your menu, you should have two entry points for the said menu, using inner labels at your advantage. Something that would looks like that :Edit: I've just seen you've fixed it withdefault
, and yeah... I can imagine that. Except as long as the$ menuset1 = []
type lines were immediately before the firstmenu:
statement, it should have been fine.
Python:
label whatever:
[...]
jump myMenu
# Entry point with initialization,
# intended for call/jump coming from the outside.
label myMenu:
# Ensure to have a clean /menuset/ variable.
$ menuset = set()
# Entry point without the initialization,
# intended for jump coming from the inside.
menu .inside:
set menuset
"choice 1":
[...]
jump .inside
"choice 2":
[...]
jump .inside
"take a shower":
# Once again, ensure to have a clean variable.
$ menuset1 = set()
menu .shower:
set menuset1
"Use soap":
[...]
# Jump on the inside menu
jump .shower
"Use shampoo":
[...]
# Jump on the inside menu
jump .shower
"I've finished":
[...]
# Return to the main menu
jump .inside
Python:
label whatever:
"In whatever label"
$ count = 0
label .inside:
$ count += 1
"whatever - iteration [count]"
if count < 3:
# Will sent you to /whatever.inside/
jump .inside
jump otherLabel
label otherLabel:
"In otherLabel label"
$ count = 0
label .inside:
$ count += 1
"otherLabel - iteration [count]"
if count < 3:
# Will sent you to /otherLabel.inside/
jump .inside
$ count = 0
# Will sent you to /whatever.inside/
jump whatever.inside
return
call
them if you don't feel at ease with that :
Python:
label start:
jump menuTest
label myMenu:
$ menuset = set()
menu .inside:
set menuset
"choice 1":
[...]
jump .inside
"choice 2":
[...]
jump .inside
"take a shower":
# Ensure that /menuset1/ is clean.
$ menuset1 = set()
# Jump to the deported inner menu.
jump menuShower
menu menuShower:
set menuset1
"Use soap":
[...]
# Here you can directly jump to the main label
# since the /menuset/ is initialized outside.
jump menuShower
"Use shampoo":
[...]
jump menuShower
"Finished":
[...]
# Return directly to the previous menu
# without passing by the /menuset/ initialization.
jump myMenu.inside