Add: save openttd.cfg immediately on changing a setting (#8358)

Formally it was only done on exit. This means that if it crashes
changes in settings were not stored. This is often rather
frustrating. Additionally, targets (like emscripten) where people
are unlike to use "Exit Game", will never see their configuration
stored.

The drawback is that on every setting change there is some minor
I/O of writing the ini file to disk again.
This commit is contained in:
Patric Stout
2020-12-13 16:28:06 +01:00
committed by GitHub
parent 40edc2863c
commit c66bd18a10
3 changed files with 14 additions and 11 deletions

View File

@@ -51,6 +51,7 @@ enum DisplayOptions {
extern GameMode _game_mode;
extern SwitchMode _switch_mode;
extern bool _exit_game;
extern bool _save_config;
/** Modes of pausing we've got */
enum PauseMode : byte {