2008-01-07 00:19:09 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-01-07 00:19:09 +00:00
|
|
|
/** @file settings_func.h Functions related to setting/changing the settings. */
|
|
|
|
|
|
|
|
#ifndef SETTINGS_FUNC_H
|
|
|
|
#define SETTINGS_FUNC_H
|
|
|
|
|
2008-07-22 14:17:29 +00:00
|
|
|
#include "core/smallvec_type.hpp"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "company_type.h"
|
2008-07-22 14:17:29 +00:00
|
|
|
|
2010-01-28 23:17:28 +00:00
|
|
|
void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
|
2009-02-08 12:25:13 +00:00
|
|
|
void IConsoleSetSetting(const char *name, int32 value);
|
2010-01-28 23:17:28 +00:00
|
|
|
void IConsoleGetSetting(const char *name, bool force_newgame = false);
|
2009-02-08 12:25:13 +00:00
|
|
|
void IConsoleListSettings(const char *prefilter);
|
2008-01-07 00:19:09 +00:00
|
|
|
|
2011-11-14 21:42:54 +00:00
|
|
|
void LoadFromConfig(bool minimal = false);
|
2008-01-07 00:19:09 +00:00
|
|
|
void SaveToConfig();
|
|
|
|
void CheckConfig();
|
|
|
|
|
2008-07-22 14:17:29 +00:00
|
|
|
/* Functions to load and save NewGRF settings to a separate
|
|
|
|
* configuration file, used for presets. */
|
|
|
|
typedef AutoFreeSmallVector<char *, 4> GRFPresetList;
|
|
|
|
|
|
|
|
void GetGRFPresetList(GRFPresetList *list);
|
|
|
|
struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);
|
|
|
|
void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config);
|
|
|
|
void DeleteGRFPresetFromConfig(const char *config_name);
|
|
|
|
|
2009-05-26 13:29:01 +00:00
|
|
|
uint GetCompanySettingIndex(const char *name);
|
2009-05-26 23:14:02 +00:00
|
|
|
void SetDefaultCompanySettings(CompanyID cid);
|
2009-05-26 13:29:01 +00:00
|
|
|
|
2009-06-10 18:53:43 +00:00
|
|
|
#if defined(ENABLE_NETWORK)
|
|
|
|
void SyncCompanySettings();
|
|
|
|
#else /* ENABLE_NETWORK */
|
|
|
|
static inline void SyncCompanySettings() {}
|
|
|
|
#endif /* ENABLE_NETWORK */
|
|
|
|
|
2008-01-07 00:19:09 +00:00
|
|
|
#endif /* SETTINGS_FUNC_H */
|