OpenTTD Source
20241108-master-g80f628063a
|
Functions related to setting/changing the settings. More...
Go to the source code of this file.
Functions | |
void | IConsoleSetSetting (const char *name, const char *value, bool force_newgame=false) |
void | IConsoleSetSetting (const char *name, int32_t value) |
void | IConsoleGetSetting (const char *name, bool force_newgame=false) |
Output value of a specific setting to the console. More... | |
void | IConsoleListSettings (const char *prefilter) |
List all settings and their value to the console. More... | |
void | LoadFromConfig (bool minimal=false) |
Load the values from the configuration files. More... | |
void | SaveToConfig () |
Save the values to the configuration file. | |
void | IniLoadWindowSettings (IniFile &ini, const char *grpname, void *desc) |
Load a WindowDesc from config. More... | |
void | IniSaveWindowSettings (IniFile &ini, const char *grpname, void *desc) |
Save a WindowDesc to config. More... | |
StringList | GetGRFPresetList () |
Get the list of known NewGrf presets. More... | |
struct GRFConfig * | LoadGRFPresetFromConfig (const char *config_name) |
Load a NewGRF configuration by preset-name. More... | |
void | SaveGRFPresetToConfig (const char *config_name, struct GRFConfig *config) |
Save a NewGRF configuration with a preset name. More... | |
void | DeleteGRFPresetFromConfig (const char *config_name) |
Delete a NewGRF configuration by preset name. More... | |
void | SetDefaultCompanySettings (CompanyID cid) |
Set the company settings for a new company to their default values. | |
void | SyncCompanySettings () |
Sync all company settings in a multiplayer game. | |
Functions related to setting/changing the settings.
Definition in file settings_func.h.
void DeleteGRFPresetFromConfig | ( | const char * | config_name | ) |
Delete a NewGRF configuration by preset name.
config_name | Name of the preset. |
Definition at line 1572 of file settings.cpp.
References _config_file, IniLoadFile::RemoveGroup(), and IniFile::SaveToDisk().
StringList GetGRFPresetList | ( | ) |
Get the list of known NewGrf presets.
Definition at line 1521 of file settings.cpp.
References _config_file, IniLoadFile::groups, and IniGroup::name.
Referenced by SavePresetWindow::SavePresetWindow().
void IConsoleGetSetting | ( | const char * | name, |
bool | force_newgame | ||
) |
Output value of a specific setting to the console.
name | Name of the setting to output its value |
force_newgame | force the newgame settings |
Definition at line 1894 of file settings.cpp.
References CC_ERROR, GetSettingFromName(), and IConsolePrint().
void IConsoleListSettings | ( | const char * | prefilter | ) |
List all settings and their value to the console.
prefilter | If not nullptr , only list settings with names that begin with prefilter prefix |
Definition at line 1929 of file settings.cpp.
References CC_HELP, GenericSettingTables(), and IConsolePrint().
void IniLoadWindowSettings | ( | IniFile & | ini, |
const char * | grpname, | ||
void * | desc | ||
) |
Load a WindowDesc from config.
ini | IniFile handle to the ini file with the source data |
grpname | character string identifying the section-header of the ini file that will be parsed |
desc | Destination WindowDesc |
Definition at line 862 of file settings.cpp.
References IniLoadSettings().
Referenced by WindowDesc::LoadFromConfig().
void IniSaveWindowSettings | ( | IniFile & | ini, |
const char * | grpname, | ||
void * | desc | ||
) |
Save a WindowDesc to config.
ini | IniFile handle to the ini file where the destination data is saved |
grpname | character string identifying the section-header of the ini file |
desc | Source WindowDesc |
Definition at line 873 of file settings.cpp.
References IniSaveSettings().
Referenced by WindowDesc::SaveToConfig().
void LoadFromConfig | ( | bool | startup | ) |
Load the values from the configuration files.
startup | Load the minimal amount of the configuration to "bootstrap" the blitter and such. |
Definition at line 1354 of file settings.cpp.
References _config_file, _favs_file, _private_file, _secrets_file, and ResetCurrencies().
Referenced by AfterNewGRFScan::OnNewGRFsScanned().
struct GRFConfig* LoadGRFPresetFromConfig | ( | const char * | config_name | ) |
Load a NewGRF configuration by preset-name.
config_name | Name of the preset. |
Definition at line 1541 of file settings.cpp.
References _config_file, and GRFLoadConfig().
void SaveGRFPresetToConfig | ( | const char * | config_name, |
GRFConfig * | config | ||
) |
Save a NewGRF configuration with a preset name.
config_name | Name of the preset. |
config | NewGRF configuration to save. |
Definition at line 1558 of file settings.cpp.
References _config_file.