OpenTTD Source 20250428-master-g68ba2735ea
|
All actions handling saving and loading of the settings/configuration goes on in this file. More...
#include "stdafx.h"
#include <charconv>
#include "core/string_consumer.hpp"
#include "settings_table.h"
#include "debug.h"
#include "currency.h"
#include "network/network.h"
#include "network/network_func.h"
#include "network/core/config.h"
#include "command_func.h"
#include "console_func.h"
#include "genworld.h"
#include "string_func.h"
#include "strings_func.h"
#include "window_func.h"
#include "company_func.h"
#include "rev.h"
#include "error.h"
#include "gamelog.h"
#include "settings_func.h"
#include "ini_type.h"
#include "ai/ai_config.hpp"
#include "game/game_config.hpp"
#include "newgrf_config.h"
#include "picker_func.h"
#include "base_media_base.h"
#include "base_media_graphics.h"
#include "fios.h"
#include "fileio_func.h"
#include "settings_cmd.h"
#include "table/strings.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
class | ConfigIniFile |
IniFile to store a configuration. More... | |
Typedefs | |
using | SettingDescProc = void(IniFile &ini, const SettingTable &desc, std::string_view grpname, void *object, bool only_startup) |
using | SettingDescProcList = void(IniFile &ini, std::string_view grpname, StringList &list) |
Enumerations | |
enum | IniFileVersion : uint32_t { IFV_0 , IFV_PRIVATE_SECRETS , IFV_GAME_TYPE , IFV_LINKGRAPH_SECONDS , IFV_NETWORK_PRIVATE_SETTINGS , IFV_AUTOSAVE_RENAME , IFV_RIGHT_CLICK_CLOSE , IFV_REMOVE_GENERATION_SEED , IFV_MAX_VERSION } |
Ini-file versions. More... | |
Functions | |
static auto & | GenericSettingTables () |
List of all the generic setting tables. | |
static auto & | PrivateSettingTables () |
List of all the private setting tables. | |
static auto & | SecretSettingTables () |
List of all the secrets setting tables. | |
static bool | IsSignedVarMemType (VarType vt) |
static std::optional< uint32_t > | LookupManyOfMany (const std::vector< std::string > &many, std::string_view str) |
Find the set-integer value MANYofMANY type in a string. | |
static std::optional< std::vector< uint32_t > > | ParseIntList (const char *p) |
Parse a string into a vector of uint32s. | |
static bool | LoadIntList (const char *str, void *array, int nelems, VarType type) |
Load parsed string-values into an integer-array (intlist) | |
static void | IniLoadSettings (IniFile &ini, const SettingTable &settings_table, std::string_view grpname, void *object, bool only_startup) |
Load values from a group of an IniFile structure into the internal representation. | |
static void | IniSaveSettings (IniFile &ini, const SettingTable &settings_table, std::string_view grpname, void *object, bool) |
Save the values of settings to the inifile. | |
static void | IniLoadSettingList (IniFile &ini, std::string_view grpname, StringList &list) |
Loads all items from a 'grpname' section into a list The list parameter can be a nullptr pointer, in this case nothing will be saved and a callback function should be defined that will take over the list-handling and store the data itself somewhere. | |
static void | IniSaveSettingList (IniFile &ini, std::string_view grpname, StringList &list) |
Saves all items from a list into the 'grpname' section The list parameter can be a nullptr pointer, in this case a callback function should be defined that will provide the source data to be saved. | |
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. | |
void | PrepareOldDiffCustom () |
Prepare for reading and old diff_custom by zero-ing the memory. | |
void | HandleOldDiffCustom (bool savegame) |
Reading of the old diff_custom array and transforming it to the new format. | |
static void | ValidateSettings () |
Checks if any settings are set to incorrect values, and sets them to correct values in that case. | |
static void | AILoadConfig (const IniFile &ini, std::string_view grpname) |
static void | GameLoadConfig (const IniFile &ini, std::string_view grpname) |
static void | GraphicsSetLoadConfig (IniFile &ini) |
Load BaseGraphics set selection and configuration. | |
static GRFConfigList | GRFLoadConfig (const IniFile &ini, std::string_view grpname, bool is_static) |
Load a GRF configuration. | |
static IniFileVersion | LoadVersionFromConfig (const IniFile &ini) |
static void | AISaveConfig (IniFile &ini, std::string_view grpname) |
static void | GameSaveConfig (IniFile &ini, std::string_view grpname) |
static void | SaveVersionInConfig (IniFile &ini) |
Save the version of OpenTTD to the ini file. | |
static void | GraphicsSetSaveConfig (IniFile &ini) |
Save BaseGraphics set selection and configuration. | |
static void | GRFSaveConfig (IniFile &ini, std::string_view grpname, const GRFConfigList &list) |
static void | HandleSettingDescs (IniFile &generic_ini, IniFile &private_ini, IniFile &secrets_ini, SettingDescProc *proc, SettingDescProcList *proc_list, bool only_startup=false) |
static void | RemoveEntriesFromIni (IniFile &ini, const SettingTable &table) |
Remove all entries from a settings table from an ini-file. | |
bool | IsConversionNeeded (const ConfigIniFile &ini, const std::string &group, const std::string &old_var, const std::string &new_var, const IniItem **old_item) |
Check whether a conversion should be done, and based on what old setting information. | |
void | LoadFromConfig (bool startup) |
Load the values from the configuration files. | |
void | SaveToConfig () |
Save the values to the configuration file. | |
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. | |
static const SettingDesc * | GetSettingFromName (const std::string_view name, const SettingTable &settings) |
Given a name of setting, return a setting description from the table. | |
void | GetSaveLoadFromSettingTable (SettingTable settings, std::vector< SaveLoad > &saveloads) |
Get the SaveLoad for all settings in the settings table. | |
SettingTable | GetSaveLoadSettingTable () |
Create a single table with all settings that should be stored/loaded in the savegame. | |
static const SettingDesc * | GetCompanySettingFromName (std::string_view name) |
Given a name of setting, return a company setting description of it. | |
const SettingDesc * | GetSettingFromName (const std::string_view name) |
Given a name of any setting, return any setting description of it. | |
std::vector< const SettingDesc * > | GetFilteredSettingCollection (std::function< bool(const SettingDesc &desc)> func) |
Get a collection of settings matching a custom filter. | |
CommandCost | CmdChangeSetting (DoCommandFlags flags, const std::string &name, int32_t value) |
Network-safe changing of settings (server-only). | |
CommandCost | CmdChangeCompanySetting (DoCommandFlags flags, const std::string &name, int32_t value) |
Change one of the per-company settings. | |
bool | SetSettingValue (const IntSettingDesc *sd, int32_t value, bool force_newgame) |
Top function to save the new value of an element of the Settings struct. | |
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. | |
bool | SetSettingValue (const StringSettingDesc *sd, std::string_view value, bool force_newgame) |
Set a setting value with a string. | |
void | IConsoleSetSetting (std::string_view name, std::string_view value, bool force_newgame) |
void | IConsoleSetSetting (std::string_view name, int value) |
void | IConsoleGetSetting (std::string_view name, bool force_newgame) |
Output value of a specific setting to the console. | |
static void | IConsoleListSettingsTable (const SettingTable &table, std::string_view prefilter) |
void | IConsoleListSettings (std::string_view prefilter) |
List all settings and their value to the console. | |
Variables | |
ClientSettings | _settings_client |
The current settings for this game. | |
GameSettings | _settings_game |
Game settings of a running game or the scenario editor. | |
GameSettings | _settings_newgame |
Game settings for new games (updated from the intro screen). | |
VehicleDefaultSettings | _old_vds |
Used for loading default vehicles settings from old savegames. | |
std::string | _config_file |
Configuration file of OpenTTD. | |
std::string | _private_file |
Private configuration file of OpenTTD. | |
std::string | _secrets_file |
Secrets configuration file of OpenTTD. | |
std::string | _favs_file |
Picker favourites configuration file of OpenTTD. | |
static ErrorList | _settings_error_list |
Errors while loading minimal settings. | |
const uint16_t | INIFILE_VERSION = (IniFileVersion)(IFV_MAX_VERSION - 1) |
Current ini-file version of OpenTTD. | |
All actions handling saving and loading of the settings/configuration goes on in this file.
The file consists of three parts:
Definition in file settings.cpp.
using SettingDescProc = void(IniFile &ini, const SettingTable &desc, std::string_view grpname, void *object, bool only_startup) |
Definition at line 121 of file settings.cpp.
using SettingDescProcList = void(IniFile &ini, std::string_view grpname, StringList &list) |
Definition at line 122 of file settings.cpp.
enum IniFileVersion : uint32_t |
Ini-file versions.
Sometimes we move settings between different ini-files, as we need to know when we have to load/remove it from the old versus reading it from the new location. These versions assist with situations like that.
Definition at line 165 of file settings.cpp.
|
static |
Definition at line 955 of file settings.cpp.
|
static |
Definition at line 1168 of file settings.cpp.
CommandCost CmdChangeCompanySetting | ( | DoCommandFlags | flags, |
const std::string & | name, | ||
int32_t | value | ||
) |
Change one of the per-company settings.
flags | operation to perform |
name | the name of the company setting to change |
value | the new value for the setting The new value is properly clamped to its minimum/maximum when setting |
Definition at line 1782 of file settings.cpp.
References _current_company, SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), GetCompanySettingFromName(), SettingDesc::IsIntSetting(), settings, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
CommandCost CmdChangeSetting | ( | DoCommandFlags | flags, |
const std::string & | name, | ||
int32_t | value | ||
) |
Network-safe changing of settings (server-only).
flags | operation to perform |
name | the name of the setting to change |
value | the new value for the setting The new value is properly clamped to its minimum/maximum when setting |
Definition at line 1756 of file settings.cpp.
References SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, Execute, GetGameSettings(), GetSettingFromName(), SettingDesc::IsEditable(), SettingDesc::IsIntSetting(), SettingDesc::save, SlIsObjectCurrentlyValid(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), SaveLoad::version_from, and SaveLoad::version_to.
void DeleteGRFPresetFromConfig | ( | std::string_view | config_name | ) |
Delete a NewGRF configuration by preset name.
config_name | Name of the preset. |
Definition at line 1581 of file settings.cpp.
References _config_file, IniLoadFile::RemoveGroup(), and IniFile::SaveToDisk().
Referenced by NewGRFWindow::OnClick().
|
static |
Definition at line 984 of file settings.cpp.
|
static |
Definition at line 1188 of file settings.cpp.
|
static |
List of all the generic setting tables.
There are a few tables that are special and not processed like the rest:
Definition at line 80 of file settings.cpp.
Referenced by GetFilteredSettingCollection(), GetSettingFromName(), and IConsoleListSettings().
|
static |
Given a name of setting, return a company setting description of it.
name | Name of the company setting to return a setting description of. |
nullptr
indicates failure to obtain the description. Definition at line 1695 of file settings.cpp.
References GetSettingFromName().
Referenced by CmdChangeCompanySetting(), and GetSettingFromName().
std::vector< const SettingDesc * > GetFilteredSettingCollection | ( | std::function< bool(const SettingDesc &desc)> | func | ) |
Get a collection of settings matching a custom filter.
func | Function to filter each setting. |
Definition at line 1731 of file settings.cpp.
References GenericSettingTables(), and GetSettingDesc().
StringList GetGRFPresetList | ( | ) |
Get the list of known NewGrf presets.
Definition at line 1530 of file settings.cpp.
References _config_file, IniLoadFile::groups, and IniGroup::name.
Referenced by NewGRFWindow::OnClick(), NewGRFWindow::OnQueryTextFinished(), and SavePresetWindow::SavePresetWindow().
void GetSaveLoadFromSettingTable | ( | SettingTable | settings, |
std::vector< SaveLoad > & | saveloads | ||
) |
Get the SaveLoad for all settings in the settings table.
settings | The settings table to get the SaveLoad objects from. |
saveloads | A vector to store the result in. |
Definition at line 1651 of file settings.cpp.
References GetSettingDesc(), SettingDesc::save, settings, SlIsObjectCurrentlyValid(), SaveLoad::version_from, and SaveLoad::version_to.
SettingTable GetSaveLoadSettingTable | ( | ) |
Create a single table with all settings that should be stored/loaded in the savegame.
Definition at line 1664 of file settings.cpp.
Referenced by PATSChunkHandler::Load(), PATSChunkHandler::LoadCheck(), ResetSettings(), and PATSChunkHandler::Save().
const SettingDesc * GetSettingFromName | ( | const std::string_view | name | ) |
Given a name of any setting, return any setting description of it.
name | Name of the setting to return a setting description of. |
nullptr
indicates failure to obtain the description. Definition at line 1708 of file settings.cpp.
References GenericSettingTables(), GetCompanySettingFromName(), GetSettingFromName(), PrivateSettingTables(), and SecretSettingTables().
|
static |
Given a name of setting, return a setting description from the table.
name | Name of the setting to return a setting description of. |
settings | Table to look in for the setting. |
nullptr
indicates failure to obtain the description. Definition at line 1626 of file settings.cpp.
References SettingDesc::GetName(), GetSettingDesc(), SettingDesc::save, settings, SlIsObjectCurrentlyValid(), SaveLoad::version_from, and SaveLoad::version_to.
Referenced by CmdChangeSetting(), GetCompanySettingFromName(), NewsTypeData::GetDisplay(), GetSettingFromName(), HandleOldDiffCustom(), IConsoleGetSetting(), SettingEntry::Init(), and NetworkClientListWindow::OnQueryTextFinished().
|
static |
Load BaseGraphics set selection and configuration.
Definition at line 1011 of file settings.cpp.
References BaseGraphics::Ini::extra_params, GetEncodedString(), IniLoadFile::GetGroup(), IniGroup::GetItem(), ParseIntList(), BaseGraphics::Ini::shortname, ShowErrorMessage(), IniItem::value, and WL_CRITICAL.
Referenced by LoadFromConfig().
|
static |
Save BaseGraphics set selection and configuration.
Definition at line 1221 of file settings.cpp.
References IniGroup::Clear(), IniLoadFile::GetOrCreateGroup(), IniGroup::GetOrCreateItem(), BaseMedia< GraphicsSet >::GetUsedSet(), GRFBuildParamList(), BaseSet< T >::name, GRFConfig::param, IniItem::SetValue(), BaseSet< T >::shortname, and GRFConfig::version.
Referenced by SaveToConfig().
|
static |
Load a GRF configuration.
ini | The configuration to read from. |
grpname | Group name containing the configuration of the GRF. |
is_static | GRF is static. |
Definition at line 1047 of file settings.cpp.
References ConvertHexToBytes(), FGCM_EXACT, FGCM_NEWEST_VALID, FillGRFDetails(), FindGRFConfig(), FioCheckFileExists(), GCS_NOT_FOUND, GetEncodedString(), IniLoadFile::GetGroup(), Invalid, IniGroup::items, IniItem::name, NETWORK_MAX_GRF_COUNT, NEWGRF_DIR, ParseIntList(), ShowErrorMessage(), Static, System, Unsafe, IniItem::value, and WL_CRITICAL.
Referenced by LoadFromConfig(), and LoadGRFPresetFromConfig().
|
static |
Definition at line 1240 of file settings.cpp.
void HandleOldDiffCustom | ( | bool | savegame | ) |
Reading of the old diff_custom array and transforming it to the new format.
savegame | is it read from the config or savegame. In the latter case we are sure there is an array; in the former case we have to check that. |
Definition at line 37 of file settings_sl.cpp.
References _settings_game, _settings_newgame, SettingDesc::AsIntSetting(), GetSettingFromName(), IsSavegameVersionBefore(), IntSettingDesc::MakeValueValidAndWrite(), and SLV_4.
Referenced by OPTSChunkHandler::Load(), and LoadFromConfig().
|
static |
Definition at line 1253 of file settings.cpp.
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 1956 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 1994 of file settings.cpp.
References CC_HELP, GenericSettingTables(), IConsolePrint(), PrivateSettingTables(), and SecretSettingTables().
|
static |
Definition at line 1979 of file settings.cpp.
void IConsoleSetSetting | ( | std::string_view | name, |
int | value | ||
) |
Definition at line 1944 of file settings.cpp.
void IConsoleSetSetting | ( | std::string_view | name, |
std::string_view | value, | ||
bool | force_newgame | ||
) |
Definition at line 1912 of file settings.cpp.
|
static |
Loads all items from a 'grpname' section into a list The list parameter can be a nullptr pointer, in this case nothing will be saved and a callback function should be defined that will take over the list-handling and store the data itself somewhere.
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 |
list | new list with entries of the given section |
Definition at line 839 of file settings.cpp.
References IniLoadFile::GetGroup(), and IniGroup::items.
Referenced by LoadFromConfig().
|
static |
Load values from a group of an IniFile structure into the internal representation.
ini | pointer to IniFile structure that holds administrative information |
settings_table | table with SettingDesc structures whose internally pointed variables will be given values |
grpname | the group of the IniFile to search in for the new values |
object | pointer to the object been loaded |
only_startup | load only the startup settings set |
Definition at line 629 of file settings.cpp.
References IniLoadFile::GetGroup(), IniGroup::GetItem(), SettingDesc::GetName(), GetSettingDesc(), SettingDesc::ParseValue(), SettingDesc::save, SlIsObjectCurrentlyValid(), SettingDesc::startup, SaveLoad::version_from, and SaveLoad::version_to.
Referenced by IniLoadWindowSettings(), and LoadFromConfig().
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 877 of file settings.cpp.
References IniLoadSettings().
Referenced by WindowDesc::LoadFromConfig().
|
static |
Saves all items from a list into the 'grpname' section The list parameter can be a nullptr pointer, in this case a callback function should be defined that will provide the source data to be saved.
ini | IniFile handle to the ini file where the destination data is saved |
grpname | character string identifying the section-header of the ini file |
list | pointer to an string(pointer) array that will be used as the source to be saved into the relevant ini section |
Definition at line 861 of file settings.cpp.
References IniGroup::Clear(), IniLoadFile::GetOrCreateGroup(), IniGroup::GetOrCreateItem(), and IniItem::SetValue().
Referenced by SaveToConfig().
|
static |
Save the values of settings to the inifile.
ini | pointer to IniFile structure |
sd | read-only SettingDesc structure which contains the unmodified, loaded values of the configuration file and various information about it |
grpname | holds the name of the group (eg. [network]) where these will be saved |
object | pointer to the object been saved The function works as follows: for each item in the SettingDesc structure we have a look if the value has changed since we started the game (the original values are reloaded when saving). If settings indeed have changed, we get these and save them. |
Definition at line 709 of file settings.cpp.
References SettingDesc::flags, SettingDesc::FormatValue(), SettingDesc::GetName(), IniLoadFile::GetOrCreateGroup(), GetSettingDesc(), SettingDesc::IsSameValue(), NotInConfig, SettingDesc::save, SlIsObjectCurrentlyValid(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), IniItem::value, SaveLoad::version_from, and SaveLoad::version_to.
Referenced by IniSaveWindowSettings(), and SaveToConfig().
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 888 of file settings.cpp.
References IniSaveSettings().
Referenced by WindowDesc::SaveToConfig().
bool IsConversionNeeded | ( | const ConfigIniFile & | ini, |
const std::string & | group, | ||
const std::string & | old_var, | ||
const std::string & | new_var, | ||
const IniItem ** | old_item | ||
) |
Check whether a conversion should be done, and based on what old setting information.
To prevent errors when switching back and forth between older and newer version of OpenTTD, the type of a setting is never changed. Instead, the setting is renamed, and this function is used to check whether a conversion between the old and new setting is required.
This checks if the new setting doesn't exist, and if the old does.
Doing it this way means that if you switch to an older client, the old setting is used, and only on the first time starting a new client, the old setting is converted to the new. After that, they are independent of each other. And you can safely, without errors on either, switch between old and new client.
ini | The ini-file to use. | |
group | The group the setting is in. | |
old_var | The old name of the setting. | |
new_var | The new name of the setting. | |
[out] | old_item | The old item to base upgrading on. |
Definition at line 1335 of file settings.cpp.
References IniLoadFile::GetGroup(), and IniGroup::GetItem().
Referenced by LoadFromConfig().
|
static |
Definition at line 124 of file settings.cpp.
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 1363 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, 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 1550 of file settings.cpp.
References _config_file, and GRFLoadConfig().
Referenced by NewGRFWindow::OnDropdownSelect().
|
static |
Load parsed string-values into an integer-array (intlist)
str | the string that contains the values (and will be parsed) |
array | pointer to the integer-arrays that will be filled |
nelems | the number of elements the array holds. |
type | the type of elements the array holds (eg INT8, UINT16, etc.) |
Definition at line 291 of file settings.cpp.
References ParseIntList(), SlVarSize(), and WriteValue().
Referenced by ListSettingDesc::ParseValue().
|
static |
Definition at line 1153 of file settings.cpp.
|
static |
Find the set-integer value MANYofMANY type in a string.
many | full domain of values the MANYofMANY setting can have |
str | the current string value of the setting, each individual of separated by a whitespace, tab or | character |
Definition at line 220 of file settings.cpp.
References OneOfManySettingDesc::ParseSingleValue(), SetBit(), and StringConsumer::SkipUntilCharNotIn().
Referenced by ManyOfManySettingDesc::ParseValue().
|
static |
Parse a string into a vector of uint32s.
p | the string to be parsed. Each element in the list is separated by a comma or a space character |
Definition at line 246 of file settings.cpp.
Referenced by GraphicsSetLoadConfig(), GRFLoadConfig(), and LoadIntList().
void PrepareOldDiffCustom | ( | ) |
Prepare for reading and old diff_custom by zero-ing the memory.
Definition at line 26 of file settings_sl.cpp.
Referenced by OPTSChunkHandler::Load(), and LoadFromConfig().
|
static |
List of all the private setting tables.
Definition at line 102 of file settings.cpp.
Referenced by GetSettingFromName(), IConsoleListSettings(), and SaveToConfig().
|
static |
Remove all entries from a settings table from an ini-file.
This is only useful if those entries are moved to another file, and you want to clean up what is left behind.
ini | The ini file to remove the entries from. |
table | The table to look for entries to remove. |
Definition at line 1294 of file settings.cpp.
References IniLoadFile::GetGroup(), SettingDesc::GetName(), GetSettingDesc(), and IniGroup::RemoveItem().
Referenced by SaveToConfig().
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 1567 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 1456 of file settings.cpp.
References _config_file, _favs_file, _grfconfig_newgame, _grfconfig_static, _private_file, _secrets_file, 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().
|
static |
Save the version of OpenTTD to the ini file.
ini | the ini to write to |
Definition at line 1210 of file settings.cpp.
References IniLoadFile::GetOrCreateGroup(), IniGroup::GetOrCreateItem(), INIFILE_VERSION, and IniItem::SetValue().
Referenced by SaveToConfig().
|
static |
List of all the secrets setting tables.
Definition at line 113 of file settings.cpp.
Referenced by GetSettingFromName(), IConsoleListSettings(), and SaveToConfig().
void SetDefaultCompanySettings | ( | CompanyID | cid | ) |
Set the company settings for a new company to their default values.
Definition at line 1843 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().
bool SetSettingValue | ( | const IntSettingDesc * | sd, |
int32_t | value, | ||
bool | force_newgame | ||
) |
Top function to save the new value of an element of the Settings struct.
index | offset in the SettingDesc array of the Settings struct which identifies the setting member we want to change |
value | new value of the setting |
force_newgame | force the newgame settings |
Definition at line 1804 of file settings.cpp.
References _local_company, _network_server, _networking, _settings_client, _settings_newgame, SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), ClientSettings::company, SettingDesc::flags, GetGameSettings(), SettingDesc::GetName(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), NoNetworkSync, PerCompany, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by GameOptionsWindow::OnDropdownSelect(), CheatWindow::OnQueryTextFinished(), NetworkClientListWindow::OnQueryTextFinished(), and GameOptionsWindow::OnQueryTextFinished().
bool SetSettingValue | ( | const StringSettingDesc * | sd, |
std::string_view | value, | ||
bool | force_newgame | ||
) |
Set a setting value with a string.
sd | the setting to change. |
value | the value to write |
force_newgame | force the newgame settings |
Definition at line 1880 of file settings.cpp.
References _settings_game, _settings_newgame, SettingDesc::AsStringSetting(), StringSettingDesc::ChangeValue(), SaveLoad::conv, SettingDesc::flags, GetVarMemType(), NoNetworkSync, SettingDesc::save, SLE_VAR_STRQ, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
void SyncCompanySettings | ( | ) |
Sync all company settings in a multiplayer game.
Definition at line 1856 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().
|
static |
Checks if any settings are set to incorrect values, and sets them to correct values in that case.
Definition at line 946 of file settings.cpp.
References _settings_newgame, CUSTOM_SEA_LEVEL_MIN_PERCENTAGE, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameSettings::difficulty, GameSettings::game_creation, GameCreationSettings::land_generator, LG_ORIGINAL, and DifficultySettings::quantity_sea_lakes.
Referenced by LoadFromConfig().
std::string _config_file |
Configuration file of OpenTTD.
Definition at line 63 of file settings.cpp.
Referenced by DeleteGRFPresetFromConfig(), DetermineBasePaths(), DeterminePaths(), GetGRFPresetList(), LoadFromConfig(), LoadGRFPresetFromConfig(), openttd_main(), SaveGRFPresetToConfig(), and SaveToConfig().
std::string _favs_file |
Picker favourites configuration file of OpenTTD.
Definition at line 66 of file settings.cpp.
Referenced by DeterminePaths(), LoadFromConfig(), and SaveToConfig().
VehicleDefaultSettings _old_vds |
Used for loading default vehicles settings from old savegames.
Old vehicle settings, which were game settings before, and are company settings now.
Definition at line 62 of file settings.cpp.
Referenced by AfterLoadGame().
std::string _private_file |
Private configuration file of OpenTTD.
Definition at line 64 of file settings.cpp.
Referenced by DeterminePaths(), LoadFromConfig(), and SaveToConfig().
std::string _secrets_file |
Secrets configuration file of OpenTTD.
Definition at line 65 of file settings.cpp.
Referenced by DeterminePaths(), LoadFromConfig(), and SaveToConfig().
ClientSettings _settings_client |
The current settings for this game.
Definition at line 59 of file settings.cpp.
Referenced by AddCustomRefreshRates(), AdjustGUIZoom(), AfterLoadGame(), AgeVehicle(), ServerNetworkAdminSocketHandler::AllowConnection(), AmbientSoundEffectCallback(), AnimationBase< Tbase, Tspec, Tobj, Textra, GetCallback, Tframehelper >::AnimateTile(), TimetableWindow::BuildArrivalDepartureList(), GameOptionsWindow::BuildDropDownList(), BuildLandLegend(), BuildLinkStatsLegend(), BuildOwnerLegend(), MusicSystem::BuildPlaylists(), BuildRailClick_Remove(), CalcRaildirsDrawstyle(), CcBuildBridge(), CcBuildRailTunnel(), CcBuildRoadTunnel(), CcRoadStop(), AnimationBase< Tbase, Tspec, Tobj, Textra, GetCallback, Tframehelper >::ChangeAnimationFrame(), ChangeAutosaveFrequency(), ChangeNetworkRestartTime(), MusicSystem::ChangePlaylist(), ChangePopulation(), ChangeTimekeepingUnits(), CheckClientAndServerName(), CheckMinActiveClients(), CheckOrders(), CheckPauseOnJoin(), CheckRedrawStationCoverage(), BuildRailStationWindow::CheckSelectedSize(), CheckSoftLimit(), MusicSystem::CheckStatus(), CheckTrainCollision(), CheckTrainStayInDepot(), ChopLumberMillTrees(), ClearPathReservation(), BuildAirToolbarWindow::Close(), BuildDocksToolbarWindow::Close(), BuildRailToolbarWindow::Close(), BuildRoadToolbarWindow::Close(), CommonRaiseLowerBigLand(), CompanyServiceInterval(), Order::ConvertFromOldSavegame(), ConZoomToLevel(), CrashAirplane(), DebugReconsiderSendRemoteMessages(), DebugSendRemoteMessages(), DisasterTick_Aircraft(), DisasterTick_Big_Ufo_Destroyer(), DisasterTick_Ufo(), DisasterTick_Zeppeliner(), DispatchRightClickEvent(), DistributeQueue(), DoAutoOrNetsave(), GRFFileScanner::DoScan(), DoZoomInOutWindow(), TimetableWindow::DrawArrivalDeparturePanel(), DrawBridgeMiddle(), LinkGraphOverlay::DrawContent(), BaseGraphWindow::DrawGraph(), DrawOrderString(), DrawSpriteToRgbaBuffer(), TimetableWindow::DrawSummaryPanel(), DrawTile_Road(), DrawTile_TunnelBridge(), DrawTrackBits(), BaseVehicleListWindow::DrawVehicleListItems(), DrawVehiclePurchaseInfo(), LinkGraphLegendWindow::DrawWidget(), MusicWindow::DrawWidget(), NetworkStartServerWindow::DrawWidget(), ScanProgressWindow::DrawWidget(), GameOptionsWindow::DrawWidget(), Blitter_8bppOptimized::Encode(), FiosNumberedSaveName::Filename(), FloodVehicle(), GenerateDefaultSaveName(), GenerateRockyArea(), GenericPlaceSignals(), GetDefaultServiceInterval(), GetLogPrefix(), GetOrderCmdFromTile(), GetSmallMapContoursPixels(), GetSmallMapIndustriesPixels(), GetSmallMapOwnerPixels(), GetSmallMapRoutesPixels(), GetSmallMapVehiclesPixels(), GetTimetableParameters(), MusicTrackSelectionWindow::GetWidgetString(), NetworkStartServerWindow::GetWidgetString(), NetworkClientListWindow::GetWidgetString(), BuildSignalWindow::GetWidgetString(), GameOptionsWindow::GetWidgetString(), HandleAutoscroll(), HandleAutoSignalPlacement(), HandleMouseEvents(), Vehicle::HandlePathfindingResult(), HandlePlacePushButton(), HandleViewportScroll(), HandleWindowDragging(), HandleZoomMessage(), InitializeRailGUI(), InitializeWindowViewport(), MusicSystem::IsPlaying(), MusicSystem::IsShuffle(), LoadFromConfig(), LoadUnloadVehicle(), VideoDriver_Null::MainLoop(), MenuClickSettings(), NetworkAutoCleanCompanies(), NetworkCheckRestartMapYear(), NetworkClientJoinGame(), NetworkClientPreferTeamChat(), NetworkInitChatMessage(), NetworkMaxCompaniesAllowed(), NetworkServer_Tick(), NetworkServerSendChat(), NetworkUDPInitialize(), NetworkUpdateServerGameType(), NetworkValidateOurClientName(), NewsItem::NewsItem(), MusicSystem::Next(), BuildAirportWindow::OnClick(), BuildDocksStationWindow::OnClick(), BuildDocksDepotWindow::OnClick(), SaveLoadWindow::OnClick(), IndustryCargoesWindow::OnClick(), MusicWindow::OnClick(), NetworkGameWindow::OnClick(), NetworkStartServerWindow::OnClick(), NetworkClientListWindow::OnClick(), NetworkAskRelayWindow::OnClick(), NetworkAskSurveyWindow::OnClick(), BuildObjectWindow::OnClick(), PickerWindow::OnClick(), BuildRailStationWindow::OnClick(), BuildSignalWindow::OnClick(), BuildRailDepotWindow::OnClick(), BuildRoadToolbarWindow::OnClick(), BuildRoadDepotWindow::OnClick(), BuildRoadStationWindow::OnClick(), GameOptionsWindow::OnClick(), SmallMapWindow::OnClick(), ScenarioEditorLandscapeGenerationWindow::OnClick(), TimetableWindow::OnClick(), BuildHouseWindow::OnClick(), TransparenciesWindow::OnClick(), BuildTreesWindow::OnClick(), NetworkStartServerWindow::OnDropdownSelect(), NetworkClientListWindow::OnDropdownSelect(), GameOptionsWindow::OnDropdownSelect(), ScenarioEditorToolbarWindow::OnDropdownSelect(), NetworkGameWindow::OnEditboxChanged(), MainWindow::OnHotkey(), SelectGameWindow::OnInit(), BuildRailStationWindow::OnInit(), ScriptDebugWindow::OnInit(), SelectCompanyLiveryWindow::OnInvalidateData(), SaveLoadWindow::OnInvalidateData(), MusicTrackSelectionWindow::OnInvalidateData(), MusicWindow::OnInvalidateData(), SpriteAlignerWindow::OnInvalidateData(), NewGRFWindow::OnInvalidateData(), BuildSignalWindow::OnInvalidateData(), ScriptDebugWindow::OnInvalidateData(), GameOptionsWindow::OnInvalidateData(), IndustryViewWindow::OnMouseWheel(), MainWindow::OnMouseWheel(), SmallMapWindow::OnMouseWheel(), TownViewWindow::OnMouseWheel(), VehicleViewWindow::OnMouseWheel(), ExtraViewportWindow::OnMouseWheel(), AfterNewGRFScan::OnNewGRFsScanned(), BuildDocksStationWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), BuildRailToolbarWindow::OnPlaceMouseUp(), BuildRoadToolbarWindow::OnPlaceMouseUp(), BuildIndustryWindow::OnPlaceObject(), OrdersWindow::OnPlaceObject(), NetworkGameWindow::OnQueryTextFinished(), NetworkStartServerWindow::OnQueryTextFinished(), SmallMapWindow::OnScroll(), OnTick_Companies(), OrdersWindow::OrderClick_NearestDepot(), PlaceExtraDepotRail(), PlaceRail_Station(), MusicSystem::Play(), PlayVehicleSound(), VideoDriver_SDL_Base::PollEvent(), PopupMainToolbarMenu(), PositionMainToolbar(), PositionNetworkChatWindow(), PositionNewsMessage(), PositionStatusbar(), MusicSystem::Prev(), GSConfigWindow::RebuildVisibleSettings(), ScriptSettingsWindow::RebuildVisibleSettings(), ServerNetworkAdminSocketHandler::Receive_ADMIN_JOIN(), ServerNetworkGameSocketHandler::Receive_CLIENT_COMMAND(), ServerNetworkGameSocketHandler::Receive_CLIENT_IDENTIFY(), ServerNetworkGameSocketHandler::Receive_CLIENT_JOIN(), ServerNetworkGameSocketHandler::Receive_CLIENT_RCON(), ClientNetworkCoordinatorSocketHandler::Receive_GC_ERROR(), ClientNetworkCoordinatorSocketHandler::Receive_GC_REGISTER_ACK(), ClientNetworkCoordinatorSocketHandler::Receive_GC_TURN_CONNECT(), ClientNetworkGameSocketHandler::Receive_SERVER_AUTH_REQUEST(), ClientNetworkCoordinatorSocketHandler::Register(), ScriptScanner::RegisterScript(), ScriptConfig::ResetEditableSettings(), ResetSignalVariant(), MusicSystem::SaveCustomPlaylist(), SaveOrLoad(), StationViewWindow::SelectGroupBy(), StationViewWindow::SelectSortBy(), StationViewWindow::SelectSortOrder(), ServerNetworkGameSocketHandler::SendConfigUpdate(), ClientNetworkCoordinatorSocketHandler::SendReceive(), ServerNetworkAdminSocketHandler::SendWelcome(), ServerNetworkGameSocketHandler::ServerNetworkGameSocketHandler(), ServiceIntervalSettingsValueText(), SetDefaultRailGui(), SetSettingValue(), BuildSignalWindow::SetSignalUIMode(), GRFConfig::SetSuitablePalette(), SetupScreenshotViewport(), NWidgetLeaf::SetupSmallestSize(), SetupWidgetDimensions(), ShowErrorMessage(), ShowMeasurementTooltips(), ShowNewspaper(), ShowSelectBaseStationIfNeeded(), ShowTicker(), MusicSystem::Shuffle(), MusicSystem::Stop(), SurveySettings(), SyncCompanySettings(), TicksPerTimetableUnit(), ToggleBoundingBoxes(), ToggleDirtyBlocks(), ToggleWidgetOutlines(), ToolbarFastForwardClick(), ToolbarOptionsClick(), TrainController(), NetworkSurveyHandler::Transmit(), TruncateBuffer(), TryPathReserve(), TryReserveRailTrack(), UnreserveRailTrack(), MusicSystem::Unshuffle(), UpdateAllServiceInterval(), UpdateGUIZoom(), UpdateLevelCrossingTile(), BuildTreesWindow::UpdateMode(), ScanProgressWindow::UpdateNewGRFScanStatus(), TimetableWindow::UpdateSelectionStates(), UpdateViewportPosition(), Town::UpdateVirtCoord(), NetworkClientListWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), VehicleEnterDepot(), VehicleIsAboveLatenessThreshold(), ViewportAddTownStrings(), and VpSelectTilesWithMethod().
|
static |
Errors while loading minimal settings.
Definition at line 68 of file settings.cpp.
Referenced by LoadFromConfig(), ListSettingDesc::ParseValue(), IntSettingDesc::ParseValue(), BoolSettingDesc::ParseValue(), OneOfManySettingDesc::ParseValue(), and ManyOfManySettingDesc::ParseValue().
GameSettings _settings_game |
Game settings of a running game or the scenario editor.
The current settings for this game.
Definition at line 60 of file settings.cpp.
Referenced by _GenerateWorld(), AddAcceptedCargoOfHouse(), AffectSpeedByZChange(), AfterLoadGame(), AfterLoadVehiclesPhase2(), AfterNewGRFScan::AfterNewGRFScan(), AircraftController(), AircraftEventHandler_AtTerminal(), AutoslopeEnabled(), Subsidy::AwardTo(), BuildLandLegend(), BuildRailClick_Remove(), CalcEngineReliability(), CalculateDesertLine(), RiverBuilder::CalculateG(), CalculateRefitMasks(), CalculateSnowLine(), CanBuildVehicleInfrastructure(), CanExpandRailStation(), CanRoadContinueIntoNextTile(), AI::CanStartNew(), ChangeIndustryProduction(), ChangeMinutesPerYear(), CheckAllowRemoveRoad(), CheckAllowRemoveTunnelBridge(), CheckBridgeAvailability(), CheckBuildableTile(), CheckCompanyHasMoney(), CheckFlatLandRoadStop(), CheckforTownRating(), CheckIfAuthorityAllowsNewStation(), CheckIfCanLevelIndustryPlatform(), CheckIfIndustryTileSlopes(), CheckIfTrainNeedsService(), CheckIndustryCloseDownProtection(), CheckNewIndustry_Farm(), CheckNewIndustry_Forest(), CheckNewIndustry_OilRefinery(), CheckNewIndustry_OilRig(), CheckNewTrain(), CheckNextTrainTile(), CheckRailSlope(), CheckRoadSlope(), CheckTakeoverVehicleLimit(), CheckTrainAttachment(), CheckTrainStayInDepot(), ClearTile_Town(), ClickChangeMaxHlCheat(), CmdBuildAirport(), CmdBuildBridge(), CmdBuildDock(), CmdBuildIndustry(), CmdBuildRailStation(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildRoadStop(), CmdBuildRoadVehicle(), CmdBuildRoadWaypoint(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdBuildTrainDepot(), CmdBuildTunnel(), CmdConvertRail(), CmdConvertRoad(), CmdFoundTown(), CmdGiveMoney(), CmdLevelLand(), CmdPlaceHouse(), CmdPlantTree(), CmdRefitVehicle(), CmdReverseTrainDirection(), CmdTerraformLand(), CompaniesGenStatistics(), Company::Company(), CompanyCheckBankrupt(), Train::ConsistChanged(), CreateNewIndustryHelper(), CreateRivers(), CreateSubsidy(), DeleteStaleLinks(), DeliverGoods(), DisplayVehicleSortDropDown(), DistanceFromEdgeDir(), DoCreateTown(), LinkGraphOverlay::DrawContent(), StationViewWindow::DrawEntries(), DrawRoadAsSnowOrDesert(), SmallMapWindow::DrawSmallMapColumn(), DrawTrainDetails(), CompanyInfrastructureWindow::DrawWidget(), StatusBarWindow::DrawWidget(), TownViewWindow::DrawWidget(), VehicleDetailsWindow::DrawWidget(), IndustryBuildData::EconomyMonthlyLoop(), ExtendTrainReservation(), FinaliseEngineArray(), FinaliseHouseArray(), FindSpring(), FindStationsNearby(), FindSubsidyIndustryCargoRoute(), FindSubsidyTownCargoRoute(), FindTownForIndustry(), FixSlopes(), FlatEmptyWorld(), FlowRiver(), FollowTrainReservation(), ForAllStationsAroundTiles(), FormatString(), RiverBuilder::FoundEndNode(), FreightWagonMult(), AI::GameLoop(), ScriptInstance::GameLoop(), GenerateIndustries(), GenerateLandscape(), GenerateStationName(), GenerateTerrainPerlin(), GenerateTownName(), GenerateTowns(), GenerateTrees(), GenerateWorld(), GetAcceptanceAroundTiles(), GetAirportNoiseLevelForDistance(), GetAmplitude(), GetAvailableMoney(), Station::GetCatchmentRadius(), GetClosestWaterDistance(), GetCompanyRailTypes(), GetCompanyRoadTypes(), AIConfig::GetConfig(), GameConfig::GetConfig(), IndustrySpec::GetConstructionCost(), RoadVehicle::GetCurrentMaxSpeed(), Train::GetCurrentMaxSpeed(), Train::GetCurveSpeedLimit(), TownViewWindow::GetDesiredInfoHeight(), TownAuthorityWindow::GetEnabledActions(), GetFreeUnitNumber(), GetGameSettings(), GetGlobalVariable(), GetIndustryGamePlayProbability(), Engine::GetLifeLengthInDays(), GetLoadAmount(), GetMaskOfTownActions(), GetMaxTreeSpriteSize(), GetNewEngine(), GetNewEngineID(), GetNormalGrowthRate(), GetNumberOfIndustries(), GetOtherAqueductEnd(), GetProductionAroundTiles(), GetRailTypes(), GetRandomTreeType(), GetRoadTypes(), GetScaledIndustryGenerationProbability(), RoadVehicle::GetSlopeSteepness(), Train::GetSlopeSteepness(), GetSmallMapVegetationPixels(), GetSnowLine(), GetTerrainType(), GetTileCatchmentRadius(), TownScopeResolver::GetVariable(), GetVelocityUnits(), CompanyFinancesWindow::GetWidgetString(), BuildIndustryWindow::GetWidgetString(), ScenarioEditorToolbarWindow::GetWidgetString(), GfxLoadSprites(), GlobalVarChangeInfo(), GrayscaleToMapHeights(), GrowTownInTile(), GUIPlaceProcDragXY(), Vehicle::HandleBreakdown(), HandleOldDiffCustom(), HasRailCatenaryDrawn(), HeightMapCoastLines(), HeightMapNormalize(), HeightMapSineTransform(), HighestSnowLine(), HighlightTownLocalAuthorityTiles(), IndustryCargoesWindow::HousesCanAccept(), IConsoleGetSetting(), IndustriesChangeInfo(), InitializePatchFlags(), int_noise(), InverseRemapCoords2(), AirportSpec::IsAvailable(), IsCommandAllowedWhilePaused(), Engine::IsEnabled(), ObjectSpec::IsEverAvailable(), IsInnerTile(), IsRoadAllowedHere(), IsValidTileForWaypoint(), IsVehicleTypeDisabled(), OPTSChunkHandler::Load(), PATSChunkHandler::Load(), LoadNewGRF(), LoadSpriteTables(), LoadTownData(), LoadUnloadVehicle(), LowestSnowLine(), MakeLake(), MakeTreeTypeButtons(), Town::MaxTownNoise(), MaybeCrashAirplane(), MenuClickTown(), Gamelog::Mode(), Vehicle::NeedsServicing(), BuildIndustryWindow::OnClick(), FoundTownWindow::OnClick(), LandInfoWindow::OnInit(), FoundTownWindow::OnInit(), BuildVehicleWindow::OnInvalidateData(), BuildAirportWindow::OnPaint(), CompanyWindow::OnPaint(), BuildDocksStationWindow::OnPaint(), BuildRailStationWindow::OnPaint(), BuildRoadStationWindow::OnPaint(), ScenarioEditorToolbarWindow::OnPaint(), BuildObjectWindow::OnPlaceMouseUp(), TerraformToolbarWindow::OnPlaceMouseUp(), OnTick_Companies(), OnTick_LinkGraph(), ParamSet(), ScriptInstance::Pause(), CargoPayment::PayTransfer(), CYapfCostRailT< Types >::PfCalcCost(), PlaceRail_Station(), PlaceRail_Waypoint(), PlaceRoad_BusStation(), PlaceRoad_TruckStation(), PlaceRoad_Waypoint(), PlaceTreesRandomly(), PopulateStationsNearby(), SmallMapWindow::RebuildColourIndexIfNecessary(), Station::RecomputeCatchment(), RecomputePrices(), RemoveAirport(), RemoveRoad(), ReplaceChain(), AI::ResetConfig(), ResetIndustries(), ResetNewGRFData(), ResetSettings(), ReverseTrainDirection(), RoadFindPathToDest(), RoadVehAccelerationModelChanged(), PATSChunkHandler::Save(), ScaleByCargoScale(), ScaleByInverseCargoScale(), ServerNetworkAdminSocketHandler::SendWelcome(), HousePickerCallbacks::SetClimateMask(), SetSettingValue(), SetStartingYear(), SetupScreenshotViewport(), SetYearEngineAgingStops(), StationViewWindow::ShowCargo(), Vehicle::ShowVisualEffect(), SplitGroundSpriteForOverlay(), StartupOneEngine(), StateGameLoop(), StateGameLoop_LinkGraphPauseControl(), StationJoinerNeeded(), SurveySettings(), TerraformTileHeight(), TestAutoslopeOnRailTile(), Gamelog::TestMode(), TGPGetMaxHeight(), TileAddWrap(), TileLoop_Town(), ToolbarScenDatePanel(), TownActionBuyRights(), TownActionFundBuildings(), TownActionRoadRebuild(), TownAllowedToBuildRoads(), TownHouseChangeInfo(), TrainController(), TrainDetailsCapacityTab(), TrainDetailsCargoTab(), TryBuildTownHouse(), AI::Uninitialize(), Game::Uninitialize(), UpdateAircraftSpeed(), UpdateLandscapingLimits(), UpdateLoadUnloadTicks(), RoadVehicle::UpdateSpeed(), Train::UpdateSpeed(), UpdateTownGrowth(), CompanyInfrastructureWindow::UpdateWidgetSize(), IndustrySpec::UsesOriginalEconomy(), TimerGameEconomy::UsingWallclockUnits(), VehicleServiceInDepot(), ViewportAddLandscape(), YapfRoadVehicleChooseTrack(), YapfRoadVehicleFindNearestDepot(), YapfTrainCheckReverse(), YapfTrainChooseTrack(), YapfTrainFindNearestDepot(), YapfTrainFindNearestSafeTile(), and LinkGraphJob::~LinkGraphJob().
GameSettings _settings_newgame |
Game settings for new games (updated from the intro screen).
The settings values that are used for new games and/or modified in config file.
Definition at line 61 of file settings.cpp.
Referenced by AfterLoadGame(), GameOptionsWindow::BuildDropDownList(), ChangeMinutesPerYear(), ChangeTimekeepingUnits(), AIConfig::GetConfig(), GameConfig::GetConfig(), GetGameSettings(), GetMapHeightLimit(), GenerateLandscapeWindow::GetWidgetString(), CreateScenarioWindow::GetWidgetString(), HandleOldDiffCustom(), IConsoleGetSetting(), SettingEntry::IsVisibleByRestrictionMode(), LoadFromConfig(), NetworkRestartMap(), GenerateLandscapeWindow::OnClick(), CreateScenarioWindow::OnClick(), GenerateLandscapeWindow::OnDropdownSelect(), CreateScenarioWindow::OnDropdownSelect(), GenerateLandscapeWindow::OnInvalidateData(), SelectGameWindow::OnInvalidateData(), AfterNewGRFScan::OnNewGRFsScanned(), CreateScenarioWindow::OnPaint(), GenerateLandscapeWindow::OnQueryTextFinished(), CreateScenarioWindow::OnQueryTextFinished(), AI::ResetConfig(), SetNewLandscapeType(), SetSettingValue(), SetSettingValue(), StartNewGameWithoutGUI(), AI::Uninitialize(), Game::Uninitialize(), TimerGameEconomy::UsingWallclockUnits(), and ValidateSettings().
const uint16_t INIFILE_VERSION = (IniFileVersion)(IFV_MAX_VERSION - 1) |
Current ini-file version of OpenTTD.
Definition at line 179 of file settings.cpp.
Referenced by SaveVersionInConfig().