Functions related to setting/changing the settings. More...
#include "core/smallvec_type.hpp"
#include "company_type.h"
Go to the source code of this file.
Typedefs | |
typedef AutoFreeSmallVector < char *, 4 > | GRFPresetList |
Functions | |
void | IConsoleSetSetting (const char *name, const char *value, bool force_newgame=false) |
void | IConsoleSetSetting (const char *name, int32 value) |
void | IConsoleGetSetting (const char *name, bool force_newgame=false) |
Output value of a specific setting to the console. | |
void | IConsoleListSettings (const char *prefilter) |
List all settings and their value to the console. | |
void | LoadFromConfig () |
Load the values from the configuration files. | |
void | SaveToConfig () |
Save the values to the configuration file. | |
void | CheckConfig () |
void | GetGRFPresetList (GRFPresetList *list) |
Get the list of known NewGrf presets. | |
struct GRFConfig * | LoadGRFPresetFromConfig (const char *config_name) |
Load a NewGRF configuration by preset-name. | |
void | SaveGRFPresetToConfig (const char *config_name, struct GRFConfig *config) |
Save a NewGRF configuration with a preset name. | |
void | DeleteGRFPresetFromConfig (const char *config_name) |
Delete a NewGRF configuration by preset name. | |
uint | GetCompanySettingIndex (const char *name) |
Get the index in the _company_settings array of a setting. | |
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 1605 of file settings.cpp.
References _config_file, IniFile::RemoveGroup(), and IniFile::SaveToDisk().
Referenced by NewGRFWindow::OnClick().
uint GetCompanySettingIndex | ( | const char * | name | ) |
Get the index in the _company_settings array of a setting.
name | The name of the setting |
Definition at line 1807 of file settings.cpp.
References SettingDesc::desc, SettingDescBase::flags, GetSettingFromName(), and SGF_PER_COMPANY.
Referenced by AIGroup::EnableWagonRemoval(), ReplaceVehicleWindow::OnClick(), AICompany::SetAutoRenewMoney(), AICompany::SetAutoRenewMonths(), and AICompany::SetAutoRenewStatus().
void GetGRFPresetList | ( | GRFPresetList * | list | ) |
Get the list of known NewGrf presets.
list[inout] | Pointer to list for storing the preset names. |
Definition at line 1551 of file settings.cpp.
References SmallVector< T, S >::Append(), AutoFreeSmallVector< T, S >::Clear(), IniFile::group, IniGroup::name, and IniGroup::next.
Referenced by NewGRFWindow::OnClick(), and NewGRFWindow::OnQueryTextFinished().
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 1926 of file settings.cpp.
References CC_WARNING, SettingDescBase::cmd, SaveLoad::conv, SettingDesc::desc, SettingDescBase::flags, GetSettingFromName(), GetVariableAddress(), GetVarMemType(), IConsolePrintF(), SettingDescBase::max, SettingDescBase::min, ReadValue(), SettingDesc::save, SDT_BOOLX, SDT_STRING, SGF_0ISDISABLED, and SLE_VAR_STRQ.
void IConsoleListSettings | ( | const char * | prefilter | ) |
List all settings and their value to the console.
prefilter | If not NULL , only list settings with names that begin with prefilter prefix |
Definition at line 1959 of file settings.cpp.
References CC_DEFAULT, CC_WARNING, SettingDescBase::cmd, SaveLoad::cmd, SaveLoad::conv, SettingDesc::desc, GetGameSettings(), GetVariableAddress(), GetVarMemType(), IConsolePrintF(), lengthof, SettingDescBase::min, SettingDescBase::name, ReadValue(), SettingDesc::save, SDT_BOOLX, SDT_STRING, SLE_VAR_STRQ, SlIsObjectCurrentlyValid(), SaveLoad::version_from, and SaveLoad::version_to.
struct GRFConfig* LoadGRFPresetFromConfig | ( | const char * | config_name | ) | [read] |
Load a NewGRF configuration by preset-name.
config_name | Name of the preset. |
Definition at line 1572 of file settings.cpp.
References GRFLoadConfig().
Referenced by NewGRFWindow::OnDropdownSelect().
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 1590 of file settings.cpp.
References _config_file, and IniFile::SaveToDisk().
Referenced by NewGRFWindow::OnQueryTextFinished().