mchlnix / SMB3-Foundry

SMB3 Level Editor in Python
GNU General Public License v3.0
93 stars 12 forks source link

Abstract out `MainWindow`'s Menus #63

Closed fortenbt closed 2 years ago

fortenbt commented 3 years ago

As seen partially implemented in https://github.com/TheJoeSmo/SMB3-Foundry/commit/398dd601c0bbac766cebcea007fed421e80d0667, there might be some benefit to abstracting out all the individual QMenus created in MainWindow.py.

This could clean up the creation of the Menus and might make it more straightforward to edit individual Menus.

I would like some feedback on this, however, since it doesn't really seem to enable any functionality. It might just be some low hanging fruit for someone to pick up and implement as more of a project cleanup issue. Would structuring the code this way really reduce clutter/copy+pasted code that much or facilitate anything like the plugin API?

mchlnix commented 3 years ago

So have a LevelMenu class, that has the actions for the level menu in it and then just get's instantiated into MainWindow? Sure. They could have a enable_actions function, based on if a ROM is loaded and/or if a level is loaded.

mchlnix commented 2 years ago

Partially done, where they could be mostly independent of the main window. Like the View menu.