Quote from: emabolo on Tue 08/06/2021 08:15:40
The idea is to avoid asking for some preferences (for example translation) if the user has already chosen it and saved it in the game config.
I might mention that player may as well edit default config by hand to change the language and other settings. I know that Linux users often do that, because there's no builtin setup program available on Linux and it's simply easier to edit a file in the game dir.
But if you really must do this, the latest version of AGS (3.5.1) provides direct means to access user config regardless of its location using new tag $CONFIGFILE$.
For example:
if (File.Exists("$CONFIGFILE$")) {
// do something
} else {
// do something else
}
You may also open it for reading or writing
File* f = File.Open("$CONFIGFILE$", eFileRead);
if returned "f" is null this means there's no user config yet.
For parsing config, there's a good module called IniFile that may be easily used to both read and write a config file:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=46631.0
Quote from: Crimson Wizard on Tue 08/06/2021 08:30:13
But if you really must do this, the latest version of AGS (3.5.1) provides direct means to access user config regardless of its location using new tag $CONFIGFILE$.
Fantastic! Exactly what I wanted. Thanks a lot!