OpenTTD
settings_func.h
Go to the documentation of this file.
1 /* $Id$ */
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 #include "string_type.h"
18 
19 struct IniFile;
20 
21 void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
22 void IConsoleSetSetting(const char *name, int32 value);
23 void IConsoleGetSetting(const char *name, bool force_newgame = false);
24 void IConsoleListSettings(const char *prefilter);
25 
26 void LoadFromConfig(bool minimal = false);
27 void SaveToConfig();
28 
29 void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc);
30 void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc);
31 
33 struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);
34 void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config);
35 void DeleteGRFPresetFromConfig(const char *config_name);
36 
37 uint GetCompanySettingIndex(const char *name);
39 
40 void SyncCompanySettings();
41 
42 #endif /* SETTINGS_FUNC_H */
Owner
Enum for all companies/owners.
Definition: company_type.h:20
void IConsoleListSettings(const char *prefilter)
List all settings and their value to the console.
Definition: settings.cpp:2181
Simple vector class that allows allocating an item without the need to copy this->data needlessly...
void SaveToConfig()
Save the values to the configuration file.
Definition: settings.cpp:1754
void SetDefaultCompanySettings(CompanyID cid)
Set the company settings for a new company to their default values.
Definition: settings.cpp:1998
void LoadFromConfig(bool minimal=false)
Load the values from the configuration files.
Definition: settings.cpp:1724
uint GetCompanySettingIndex(const char *name)
Get the index in the _company_settings array of a setting.
Definition: settings.cpp:2029
void SyncCompanySettings()
Sync all company settings in a multiplayer game.
Definition: settings.cpp:2011
Information about GRF, used in the game and (part of it) in savegames.
void IConsoleGetSetting(const char *name, bool force_newgame=false)
Output value of a specific setting to the console.
Definition: settings.cpp:2148
void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc)
Load a WindowDesc from config.
Definition: settings.cpp:765
StringList GetGRFPresetList()
Get the list of known NewGrf presets.
Definition: settings.cpp:1777
void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config)
Save a NewGRF configuration with a preset name.
Definition: settings.cpp:1816
void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc)
Save a WindowDesc to config.
Definition: settings.cpp:776
struct GRFConfig * LoadGRFPresetFromConfig(const char *config_name)
Load a NewGRF configuration by preset-name.
Definition: settings.cpp:1797
Ini file that supports both loading and saving.
Definition: ini_type.h:88
std::vector< std::string > StringList
Type for a list of strings.
Definition: string_type.h:60
GRFTextWrapper * name
NOSAVE: GRF name (Action 0x08)
Types related to companies.
Types for strings.
void DeleteGRFPresetFromConfig(const char *config_name)
Delete a NewGRF configuration by preset name.
Definition: settings.cpp:1832