luciasoftware / lucia

An audio game engine written in python
GNU Lesser General Public License v3.0
33 stars 15 forks source link

Improved menus in ui #61

Open skluttrell opened 3 years ago

skluttrell commented 3 years ago

I was poking around the Menu classes. It seems there could be some improvements in the modularity. I re-wrote the class on my own fork so that the base Menu class can be plugged into any custom menu object, and moved all the interface functions into their own methods that can be overrided with any custom code. I then wrote menus for MenuExtended (same as menu2), a SimpleQuestion (same as YesNoMenu, but the lables can be changed from yes/no to anything), FileMenu (a basic file/directory selector), and PopDialog (a message box with a confirm button) all using the base Menu class. I added some more functionality to the MenuItem object too. You can now add an optional audio file to the item to be played instead of just the TTS name. There's also a new function parameter so the user can change the behavior of the item: my use case for this is adding sliders for something like audio volume.