Go to the documentation of this file.
1 /* $Id: settings_func.h 25291 2013-05-26 19:27:22Z frosch $ */
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 <>.
8  */
12 #ifndef SETTINGS_FUNC_H
13 #define SETTINGS_FUNC_H
15 #include "core/smallvec_type.hpp"
16 #include "company_type.h"
18 struct IniFile;
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);
25 void LoadFromConfig(bool minimal = false);
26 void SaveToConfig();
27 void CheckConfig();
29 void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc);
30 void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc);
32 /* Functions to load and save NewGRF settings to a separate
33  * configuration file, used for presets. */
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);
41 uint GetCompanySettingIndex(const char *name);
44 #if defined(ENABLE_NETWORK)
45 void SyncCompanySettings();
46 #else /* ENABLE_NETWORK */
47 static inline void SyncCompanySettings() {}
48 #endif /* ENABLE_NETWORK */
50 #endif /* SETTINGS_FUNC_H */
void IConsoleListSettings(const char *prefilter)
List all settings and their value to the console.
Definition: settings.cpp:2160
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:1730
void GetGRFPresetList(GRFPresetList *list)
Get the list of known NewGrf presets.
Definition: settings.cpp:1753
void SetDefaultCompanySettings(CompanyID cid)
Set the company settings for a new company to their default values.
Definition: settings.cpp:1975
void LoadFromConfig(bool minimal=false)
Load the values from the configuration files.
Definition: settings.cpp:1700
uint GetCompanySettingIndex(const char *name)
Get the index in the _company_settings array of a setting.
Definition: settings.cpp:2008
void SyncCompanySettings()
Sync all company settings in a multiplayer game.
Definition: settings.cpp:1989
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:2127
void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc)
Load a WindowDesc from config.
Definition: settings.cpp:744
void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config)
Save a NewGRF configuration with a preset name.
Definition: settings.cpp:1793
void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc)
Save a WindowDesc to config.
Definition: settings.cpp:755
struct GRFConfig * LoadGRFPresetFromConfig(const char *config_name)
Load a NewGRF configuration by preset-name.
Definition: settings.cpp:1774
Ini file that supports both loading and saving.
Definition: ini_type.h:88
GRFTextWrapper * name
NOSAVE: GRF name (Action 0x08)
Types related to companies.
void DeleteGRFPresetFromConfig(const char *config_name)
Delete a NewGRF configuration by preset name.
Definition: settings.cpp:1809
Enum for all companies/owners.
Definition: company_type.h:20