You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I actually had a menu library I'd fiddled with myself. I'll see if I can dig it out. Personally, I stored the whole menu as structure where the values were functions that got executed when selected, something like:

    var myMenu2 = {
      "A Title":0,
      "Back":function() {set_menu(myMenu); },
    };
    var myMenu = {
      "Main Menu Title":0,
      "A Submenu":function() { set_menu(myMenu2); },
      "Run some code":function() { ... }
    };
    

    It made it relatively simple and easy to read. The menu code then just iterates over the object's fields and draws them, then when selected it runs the function.

About

Avatar for Gordon @Gordon started