But I noticed something a little weird about the selected menu button behavior. For it to work, I have to have a set variables action for all buttons, and each jump_to string must be different. If I set both scenes and prefs as "other," for example, both buttons will show selected until I click save or load.
The jump_to variable is only used to toggle between frames on the save/load screens. So I have no idea why I need to use different strings under scenes and prefs because they are never referenced, but I do.
As I said, this menu works with the navigation code below but I was hoping someone might be able to explain the behavior? I'm a little rusty but this doesn't make sense to me.
Code: Select all
frame:
background Frame("images/textbox.png",5,5)
style_group "mmenu"
xalign 0.5
at drop_down
hbox:
spacing 75
null width 50
if not current_screen=="mm":
textbutton ("Return") action [SetVariable("jump_to","ret"), Return()]
else:
textbutton ("Start ") action [SetVariable("jump_to","start"), Start()]
#if main_menu:
textbutton ("Scenes") action [SetVariable("jump_to", "scenes"), ShowMenu("scenes")]
textbutton ("Options") action [SetVariable("jump_to", "prefs"), ShowMenu("preferences")]
if not main_menu:
if current_screen == "load" or current_screen == "save":
textbutton ("Save") action [SetVariable("jump_to","save"), ShowMenu("save")]
else:
textbutton ("Save") action [SetVariable("jump_to", "save"), ShowMenu("save")]
if main_menu:
textbutton ("Load") action [SetVariable("jump_to", "load2"), ShowMenu("load")]
else:
if current_screen == "load" or current_screen == "save":
textbutton ("Load") action [SetVariable("jump_to","load"), ShowMenu("load")]
else:
textbutton ("Load") action [SetVariable("jump_to", "load"), ShowMenu("load")]
if not main_menu:
textbutton ("Main") action MainMenu()
textbutton ("Quit") action Quit(confirm=True)