|
OpenTTD Source 20251116-master-g21329071df
|
Functions related to setting/changing the settings. More...
Go to the source code of this file.
Functions | |
| void | IConsoleSetSetting (std::string_view name, std::string_view value, bool force_newgame=false) |
| void | IConsoleSetSetting (std::string_view name, int32_t value) |
| void | IConsoleGetSetting (std::string_view name, bool force_newgame=false) |
| Output value of a specific setting to the console. | |
| void | IConsoleListSettings (std::string_view prefilter) |
| List all settings and their value to the console. | |
| void | LoadFromConfig (bool minimal=false) |
| Load the values from the configuration files. | |
| void | SaveToConfig () |
| Save the values to the configuration file. | |
| void | IniLoadWindowSettings (IniFile &ini, std::string_view grpname, WindowDesc *desc) |
| Load a WindowDesc from config. | |
| void | IniSaveWindowSettings (IniFile &ini, std::string_view grpname, WindowDesc *desc) |
| Save a WindowDesc to config. | |
| StringList | GetGRFPresetList () |
| Get the list of known NewGrf presets. | |
| GRFConfigList | LoadGRFPresetFromConfig (std::string_view config_name) |
| Load a NewGRF configuration by preset-name. | |
| void | SaveGRFPresetToConfig (std::string_view config_name, GRFConfigList &config) |
| Save a NewGRF configuration with a preset name. | |
| void | DeleteGRFPresetFromConfig (std::string_view config_name) |
| Delete a NewGRF configuration by preset name. | |
| 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 | ( | std::string_view | config_name | ) |
Delete a NewGRF configuration by preset name.
| config_name | Name of the preset. |
Definition at line 1595 of file settings.cpp.
References _config_file, IniLoadFile::RemoveGroup(), and IniFile::SaveToDisk().
Referenced by NewGRFWindow::OnClick().
| StringList GetGRFPresetList | ( | ) |
Get the list of known NewGrf presets.
Definition at line 1544 of file settings.cpp.
References _config_file, IniLoadFile::groups, and IniGroup::name.
Referenced by NewGRFWindow::OnClick(), NewGRFWindow::OnQueryTextFinished(), and SavePresetWindow::SavePresetWindow().
| void IConsoleGetSetting | ( | std::string_view | 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 1970 of file settings.cpp.
References _settings_game, _settings_newgame, SettingDesc::AsIntSetting(), SettingDesc::AsStringSetting(), CC_ERROR, CC_INFO, SettingDesc::flags, SettingDesc::FormatValue(), IntSettingDesc::GetDefaultValue(), SettingDesc::GetName(), IntSettingDesc::GetRange(), GetSettingFromName(), GuiZeroIsSpecial, IConsolePrint(), SettingDesc::IsIntSetting(), SettingDesc::IsStringSetting(), PerCompany, StringSettingDesc::Read(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
| void IConsoleListSettings | ( | std::string_view | 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 2008 of file settings.cpp.
References CC_HELP, GenericSettingTables(), IConsolePrint(), PrivateSettingTables(), and SecretSettingTables().
| void IConsoleSetSetting | ( | std::string_view | name, |
| std::string_view | value, | ||
| bool | force_newgame = false |
||
| ) |
Definition at line 1926 of file settings.cpp.
| void IniLoadWindowSettings | ( | IniFile & | ini, |
| std::string_view | grpname, | ||
| WindowDesc * | 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 873 of file settings.cpp.
References IniLoadSettings().
Referenced by WindowDesc::LoadFromConfig().
| void IniSaveWindowSettings | ( | IniFile & | ini, |
| std::string_view | grpname, | ||
| WindowDesc * | 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 884 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 1375 of file settings.cpp.
References _config_file, _favs_file, _grfconfig_newgame, _grfconfig_static, _private_file, _secrets_file, _settings_client, _settings_error_list, _settings_newgame, GUISettings::autosave_interval, BadgeClassLoadConfig(), DebugReconsiderSendRemoteMessages(), FindWindowById(), IniLoadFile::GetGroup(), IniGroup::GetItem(), GraphicsSetLoadConfig(), GRFLoadConfig(), ClientSettings::gui, HandleOldDiffCustom(), IFV_AUTOSAVE_RENAME, IFV_GAME_TYPE, IFV_LINKGRAPH_SECONDS, IFV_NETWORK_PRIVATE_SETTINGS, IFV_PRIVATE_SECRETS, IFV_RIGHT_CLICK_CLOSE, IniLoadSettingList(), IniLoadSettings(), IsConversionNeeded(), GameSettings::linkgraph, ClientSettings::network, BoolSettingDesc::ParseSingleValue(), OneOfManySettingDesc::ParseSingleValue(), PickerLoadConfig(), PrepareOldDiffCustom(), LinkGraphSettings::recalc_interval, LinkGraphSettings::recalc_time, ResetCurrencies(), GUISettings::right_click_wnd_close, ScheduleErrorMessage(), TimerGameConst< struct Calendar >::SECONDS_PER_DAY, NetworkSettings::server_game_type, ShowFirstError(), NetworkSettings::use_relay_service, ValidateSettings(), IniItem::value, and WC_ERRMSG.
Referenced by AfterNewGRFScan::OnNewGRFsScanned(), and openttd_main().
| GRFConfigList LoadGRFPresetFromConfig | ( | std::string_view | config_name | ) |
Load a NewGRF configuration by preset-name.
| config_name | Name of the preset. |
Definition at line 1564 of file settings.cpp.
References _config_file, and GRFLoadConfig().
Referenced by NewGRFWindow::OnDropdownSelect().
| void SaveGRFPresetToConfig | ( | std::string_view | config_name, |
| GRFConfigList & | config | ||
| ) |
Save a NewGRF configuration with a preset name.
| config_name | Name of the preset. |
| config | NewGRF configuration to save. |
Definition at line 1581 of file settings.cpp.
References _config_file, and IniFile::SaveToDisk().
Referenced by NewGRFWindow::OnQueryTextFinished().
| void SaveToConfig | ( | ) |
Save the values to the configuration file.
Definition at line 1469 of file settings.cpp.
References _config_file, _favs_file, _grfconfig_newgame, _grfconfig_static, _private_file, _secrets_file, BadgeClassSaveConfig(), IniGroup::comment, IniLoadFile::GetGroup(), GraphicsSetSaveConfig(), IFV_0, IFV_NETWORK_PRIVATE_SETTINGS, IFV_REMOVE_GENERATION_SEED, IniSaveSettingList(), IniSaveSettings(), PickerSaveConfig(), PrivateSettingTables(), RemoveEntriesFromIni(), IniLoadFile::RemoveGroup(), IniGroup::RemoveItem(), IniFile::SaveToDisk(), SaveVersionInConfig(), and SecretSettingTables().
Referenced by IntSettingDesc::ChangeValue(), StringSettingDesc::ChangeValue(), and ConSaveConfig().
| void SetDefaultCompanySettings | ( | CompanyID | cid | ) |
Set the company settings for a new company to their default values.
Definition at line 1857 of file settings.cpp.
References _current_company, SettingDesc::AsIntSetting(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), IntSettingDesc::GetDefaultValue(), GetSettingDesc(), IntSettingDesc::MakeValueValidAndWrite(), and CompanyProperties::settings.
Referenced by DoStartupNewCompany().
| void SyncCompanySettings | ( | ) |
Sync all company settings in a multiplayer game.
Definition at line 1870 of file settings.cpp.
References _current_company, _local_company, _settings_client, SettingDesc::AsIntSetting(), ClientSettings::company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), SettingDesc::GetName(), GetSettingDesc(), and IntSettingDesc::Read().
Referenced by CmdCompanyCtrl().