omf2097 / openomf

One Must Fall 2097 Remake
http://www.openomf.org
MIT License
362 stars 35 forks source link

New menu API proposal #227

Closed animehunter closed 10 years ago

animehunter commented 10 years ago

The current menu api is just too difficault to work with and it is also too damn hard to read. Adding, updating or removing an item requires fiddling with mutiple lines located at different places in a massive ~1500 lines file.

The aim for this proposal is to reduce the number of lines one needs to tinker with and also improve the readability.

See https://gist.github.com/animehunter/59c923dab4adb04b7582 for the propsed changes

katajakasa commented 10 years ago

We might want to somehow split the menu system to separate files, eg. submenus could be in another file. It would be awesome if we could eg. bind a submenu create function to a button as an event, or something.

Also, we need somekind of proper menu layering, like the base main menu at the bottom layer, then if you open up a submenu, it will be layer 2, then a popup on top of that at layer 3, etc. We currently have some custom stack or something everywhere.

katajakasa commented 10 years ago

Done in master. Ref: 8c5dfa6978bebc9ce30f2d180aa122a200dcad24

Closing as done.