Ingame options respect mods
This PR fixes #5697 by changing how in-game settings are saved and loaded. The key thing Wookie and I wanted here was to have these settings saved in a way that's specific to each mod but agnostic of mod versions (as far as Knossos/Nebula goes). The challenge there is that different mod versions are entirely unique mods to FSO even though Knossos knows better.
The solution this PR offers is a new ini file saved to %appdata/HardLightProductions\FreeSpaceOpen\data. This file is titled based on the Cmdline_mod parameter (retail_fs2_settings.ini if it's nullptr) by trimming a mod folder's version data off of it. For example, MPVS-4.7.2 becomes MVPS_settings.ini and will work for all version of the MediaVPs.
There's almost certainly room for improvement here but this needs to be solved sooner rather than later and a PR will get the discussion really going.
And then I hit the approve button by accident.
AFAICT, this is really well done. It is really hard to visualize string manipulation (at least for me, so I think I would like to know what kind of test cases you guys tried before I approve, in case I (or someone else) can think of some others that we can try.
Good question. I tried the following:
STRING-#.#.# (and multiple variations of number digits such as STRING-##.###.####) STRING-STRING-#.#.# -STRING-#.#.# STRING-#.#.#-STRING STRING-STRING-#.#.# STRING#.#.# STRING #.#.#
To make things easy for other people to test ideas I didn't think of I put the code in an online snippet. This runs the function unchanged from this PR on whatever the INPUT variable at the top of the code is set to. Feel free to run some other tests or list strings I didn't think to and I'll test them. https://onlinegdb.com/62TEvLJso
Sorry for the slow reply, I'm always missing updates on github.
I managed to get this result just by playing around with some semi-nonsense semver strings:
What do you think, as intended?
FWIW, I think your test cases will handle the vast majority of cases, and something like this will probably never be chosen.
Sorry for the slow reply, I'm always missing updates on github.
I managed to get this result just by playing around with some semi-nonsense semver strings:
What do you think, as intended?
FWIW, I think your test cases will handle the vast majority of cases, and something like this will probably never be chosen.
I tend to agree and even in the case of the -semver-string.semver it fellback gracefully to fs2_open.ini which is good. That's what I wanted; anything weird happens? Use fs2_open.ini.
This needs an xstr update before merge. Just because of xstr madness, I'd really like #5927 and #5924 merged before this PR gets merged.
XSTR has been handled. This is good to merge.
Bit more discussion incoming from Discord so will hold off on merging at this moment, but ideally can get all questions answered soon.
