OpenTTD Source: src/settings_func.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SETTINGS_FUNC_H
11#define SETTINGS_FUNC_H
12
13#include "company_type.h"
14#include "string_type.h"
15#include "newgrf_config.h"
16
17struct IniFile;
18struct WindowDesc;
19
20void IConsoleSetSetting(std::string_view name, std::string_view value, bool force_newgame = false);
21void IConsoleSetSetting(std::string_view name, int32_t value);
22void IConsoleGetSetting(std::string_view name, bool force_newgame = false);
23void IConsoleListSettings(std::string_view prefilter);
24
25void LoadFromConfig(bool minimal = false);
26void SaveToConfig();
27
28void IniLoadWindowSettings(IniFile &ini, std::string_view grpname, WindowDesc *desc);
29void IniSaveWindowSettings(IniFile &ini, std::string_view grpname, WindowDesc *desc);
30
31 StringList GetGRFPresetList();
32GRFConfigList LoadGRFPresetFromConfig(std::string_view config_name);
33void SaveGRFPresetToConfig(std::string_view config_name, GRFConfigList &config);
34void DeleteGRFPresetFromConfig(std::string_view config_name);
35
36void SetDefaultCompanySettings(CompanyID cid);
37
38void SyncCompanySettings();
39
40#endif /* SETTINGS_FUNC_H */
company_type.h
Types related to companies.
newgrf_config.h
Functions to find and configure NewGRFs.
SyncCompanySettings
void SyncCompanySettings()
Sync all company settings in a multiplayer game.
Definition settings.cpp:1870
IniLoadWindowSettings
void IniLoadWindowSettings(IniFile &ini, std::string_view grpname, WindowDesc *desc)
Load a WindowDesc from config.
Definition settings.cpp:873
SaveGRFPresetToConfig
void SaveGRFPresetToConfig(std::string_view config_name, GRFConfigList &config)
Save a NewGRF configuration with a preset name.
Definition settings.cpp:1581
GetGRFPresetList
StringList GetGRFPresetList()
Get the list of known NewGrf presets.
Definition settings.cpp:1544
IConsoleGetSetting
void IConsoleGetSetting(std::string_view name, bool force_newgame=false)
Output value of a specific setting to the console.
Definition settings.cpp:1970
DeleteGRFPresetFromConfig
void DeleteGRFPresetFromConfig(std::string_view config_name)
Delete a NewGRF configuration by preset name.
Definition settings.cpp:1595
SetDefaultCompanySettings
void SetDefaultCompanySettings(CompanyID cid)
Set the company settings for a new company to their default values.
Definition settings.cpp:1857
LoadFromConfig
void LoadFromConfig(bool minimal=false)
Load the values from the configuration files.
Definition settings.cpp:1375
LoadGRFPresetFromConfig
GRFConfigList LoadGRFPresetFromConfig(std::string_view config_name)
Load a NewGRF configuration by preset-name.
Definition settings.cpp:1564
SaveToConfig
void SaveToConfig()
Save the values to the configuration file.
Definition settings.cpp:1469
IConsoleListSettings
void IConsoleListSettings(std::string_view prefilter)
List all settings and their value to the console.
Definition settings.cpp:2008
IniSaveWindowSettings
void IniSaveWindowSettings(IniFile &ini, std::string_view grpname, WindowDesc *desc)
Save a WindowDesc to config.
Definition settings.cpp:884
string_type.h
Types for strings.
StringList
std::vector< std::string > StringList
Type for a list of strings.
Definition string_type.h:60
IniFile
Ini file that supports both loading and saving.
Definition ini_type.h:86
PoolID< uint8_t, struct CompanyIDTag, 0xF, 0xFF >
WindowDesc
High level window description.
Definition window_gui.h:168