00001 /* $Id: settings_func.h 20689 2010-08-29 15:58:43Z alberth $ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * 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. 00006 * 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. 00007 * 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/>. 00008 */ 00009 00012 #ifndef SETTINGS_FUNC_H 00013 #define SETTINGS_FUNC_H 00014 00015 #include "core/smallvec_type.hpp" 00016 #include "company_type.h" 00017 00018 void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false); 00019 void IConsoleSetSetting(const char *name, int32 value); 00020 void IConsoleGetSetting(const char *name, bool force_newgame = false); 00021 void IConsoleListSettings(const char *prefilter); 00022 00023 void LoadFromConfig(); 00024 void SaveToConfig(); 00025 void CheckConfig(); 00026 00027 /* Functions to load and save NewGRF settings to a separate 00028 * configuration file, used for presets. */ 00029 typedef AutoFreeSmallVector<char *, 4> GRFPresetList; 00030 00031 void GetGRFPresetList(GRFPresetList *list); 00032 struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name); 00033 void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config); 00034 void DeleteGRFPresetFromConfig(const char *config_name); 00035 00036 uint GetCompanySettingIndex(const char *name); 00037 void SetDefaultCompanySettings(CompanyID cid); 00038 00039 #if defined(ENABLE_NETWORK) 00040 void SyncCompanySettings(); 00041 #else /* ENABLE_NETWORK */ 00042 static inline void SyncCompanySettings() {} 00043 #endif /* ENABLE_NETWORK */ 00044 00045 #endif /* SETTINGS_FUNC_H */