Closed SalsaGal closed 1 year ago
Oh wow, great work! I did notice a couple things testing this PR though:
The menu music commit (https://github.com/open-manifold/Open-Manifold/pull/23/commits/f85cba70fc01c7ffd63a5b7956a99a2ed8006b1b) now results in the main menu music restarting if you exit any other menu (options, level select, etc.); this was my initial reason for putting the load command at the end of WARNING
(forgot to comment that being the case, my bad!) A rather minor issue, and one I'm willing to overlook for now since it probably doesn't bother anyone besides myself. :P
Loading the level here requires specifying a folder, not a level.json file itself (and in fact will actually crash if you try to load a .json file). This might be confusing from a UX perspective; I would suggest tweaking the help message to specify a 'folder/path' rather than a 'file name', or even using a dummy example:
"-i [folder/path] - Load a level on start\n"); AND/OR... "-i P:/ath/to/lvl - Load a level on start\n");
- Or alternatively, figuring out a way to detect and strip a given input string of a specified file, giving us just its parent folder (so e.g. stripping
Z:/Path/To/Level/level.json
to justZ:/Path/To/Level/
); a regex like([^\/]*)$
could probably help with that (it matches with thelevel.json
part).
Ah ight I'll try getting these sorted out and let you know how it goes
Alright that should be everything done!
Using the
-i [FILEPATH]
argument you can choose a level to load directly on game launch. Fixes https://github.com/open-manifold/Open-Manifold/issues/7.