OpenTTD Source  20240917-master-g9ab0a47812
settings_func.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef SETTINGS_FUNC_H
11 #define SETTINGS_FUNC_H
12 
13 #include "company_type.h"
14 #include "string_type.h"
15 
16 struct IniFile;
17 
18 void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
19 void IConsoleSetSetting(const char *name, int32_t value);
20 void IConsoleGetSetting(const char *name, bool force_newgame = false);
21 void IConsoleListSettings(const char *prefilter);
22 
23 void LoadFromConfig(bool minimal = false);
24 void SaveToConfig();
25 
26 void IniLoadWindowSettings(IniFile &ini, const char *grpname, void *desc);
27 void IniSaveWindowSettings(IniFile &ini, const char *grpname, void *desc);
28 
30 struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);
31 void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config);
32 void DeleteGRFPresetFromConfig(const char *config_name);
33 
35 
36 void SyncCompanySettings();
37 
38 #endif /* SETTINGS_FUNC_H */
GetGRFPresetList
StringList GetGRFPresetList()
Get the list of known NewGrf presets.
Definition: settings.cpp:1521
DeleteGRFPresetFromConfig
void DeleteGRFPresetFromConfig(const char *config_name)
Delete a NewGRF configuration by preset name.
Definition: settings.cpp:1572
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
SyncCompanySettings
void SyncCompanySettings()
Sync all company settings in a multiplayer game.
Definition: settings.cpp:1795
IConsoleGetSetting
void IConsoleGetSetting(const char *name, bool force_newgame=false)
Output value of a specific setting to the console.
Definition: settings.cpp:1894
LoadFromConfig
void LoadFromConfig(bool minimal=false)
Load the values from the configuration files.
Definition: settings.cpp:1354
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:147
IConsoleListSettings
void IConsoleListSettings(const char *prefilter)
List all settings and their value to the console.
Definition: settings.cpp:1929
StringList
std::vector< std::string > StringList
Type for a list of strings.
Definition: string_type.h:60
SaveToConfig
void SaveToConfig()
Save the values to the configuration file.
Definition: settings.cpp:1447
SaveGRFPresetToConfig
void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config)
Save a NewGRF configuration with a preset name.
Definition: settings.cpp:1558
string_type.h
IniFile
Ini file that supports both loading and saving.
Definition: ini_type.h:88
SetDefaultCompanySettings
void SetDefaultCompanySettings(CompanyID cid)
Set the company settings for a new company to their default values.
Definition: settings.cpp:1783
IniSaveWindowSettings
void IniSaveWindowSettings(IniFile &ini, const char *grpname, void *desc)
Save a WindowDesc to config.
Definition: settings.cpp:873
LoadGRFPresetFromConfig
struct GRFConfig * LoadGRFPresetFromConfig(const char *config_name)
Load a NewGRF configuration by preset-name.
Definition: settings.cpp:1541
IniLoadWindowSettings
void IniLoadWindowSettings(IniFile &ini, const char *grpname, void *desc)
Load a WindowDesc from config.
Definition: settings.cpp:862
company_type.h