OpenTTD
settings_func.h
Go to the documentation of this file.
1 /* $Id: settings_func.h 25291 2013-05-26 19:27:22Z frosch $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef SETTINGS_FUNC_H
13 #define SETTINGS_FUNC_H
14 
15 #include "core/smallvec_type.hpp"
16 #include "company_type.h"
17 
18 struct IniFile;
19 
20 void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
21 void IConsoleSetSetting(const char *name, int32 value);
22 void IConsoleGetSetting(const char *name, bool force_newgame = false);
23 void IConsoleListSettings(const char *prefilter);
24 
25 void LoadFromConfig(bool minimal = false);
26 void SaveToConfig();
27 void CheckConfig();
28 
29 void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc);
30 void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc);
31 
32 /* Functions to load and save NewGRF settings to a separate
33  * configuration file, used for presets. */
35 
37 struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);
38 void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config);
39 void DeleteGRFPresetFromConfig(const char *config_name);
40 
41 uint GetCompanySettingIndex(const char *name);
43 
44 #if defined(ENABLE_NETWORK)
45 void SyncCompanySettings();
46 #else /* ENABLE_NETWORK */
47 static inline void SyncCompanySettings() {}
48 #endif /* ENABLE_NETWORK */
49 
50 #endif /* SETTINGS_FUNC_H */