Following rP26879, we can actually parse the autostart arguments in Javascript instead of C++.
This makes it easier for modders to support their own settings, and is generally rather easier to write, particularly since we can rely on the GameSettings abstraction.
Open Question:
I've implemented one way directly in the gamesettings Attributes, & one way centralised in a single function. I don't have a _strong_ opinion on which is preferable, but it might be easier to have eberything in the one place if we assume the 'autostart' feature is kind of a secondary, debug thing. In that case, the best option might well be to do the argument -> InitAttributes conversion in JS, then parse that directly instead of what I've done here.
The diff contains both ways, but we should choose one.
Other questions:
- Is it potentially bad to send the arguments to javascript? I'm not really anticipating security issues, but maybe somebody can find a scenario.
- Where should the documentation go?
- Should I just make this an even more general JS path? C++ wise, the various autostart paths could be the same now, just with some clever argument handling.
Further work:
- It's rather easy to extend autostart to other things, should we want to.
Relates to #3049 (general gamesetup cleanup ticket), #5075 (this removes the GameSetup.cpp case, the readme is an open question), #3438 (invalidated).