2011-03-06 10:54:20 +01: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/>.
;
2011-03-03 22:04:17 +01:00
[pre-amble]
static const uint GAME_DIFFICULTY_NUM = 18;
static uint16 _old_diff_custom[GAME_DIFFICULTY_NUM];
2012-12-05 20:36:41 +01:00
uint8 _old_diff_level; ///< Old difficulty level from old savegames
2013-06-29 11:47:18 +02:00
uint8 _old_units; ///< Old units from old savegames
2011-03-03 22:04:17 +01:00
2019-09-29 22:27:32 +02:00
/* Most of these strings are used both for gameopt-backward compatibility
2011-03-03 22:04:17 +01:00
* and the settings tables. The rest is here for consistency. */
static const char *_locale_currencies = "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|RON|RUR|SIT|SEK|YTL|SKK|BRL|EEK|custom";
2020-12-15 00:39:57 +01:00
static const char *_locale_units = "imperial|metric|si|gameunits";
2011-03-03 22:04:17 +01:00
static const char *_town_names = "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovak|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan";
static const char *_climates = "temperate|arctic|tropic|toyland";
static const char *_autosave_interval = "off|monthly|quarterly|half year|yearly";
static const char *_roadsides = "left|right";
static const char *_savegame_date = "long|short|iso";
static const char *_server_langs = "ANY|ENGLISH|GERMAN|FRENCH|BRAZILIAN|BULGARIAN|CHINESE|CZECH|DANISH|DUTCH|ESPERANTO|FINNISH|HUNGARIAN|ICELANDIC|ITALIAN|JAPANESE|KOREAN|LITHUANIAN|NORWEGIAN|POLISH|PORTUGUESE|ROMANIAN|RUSSIAN|SLOVAK|SLOVENIAN|SPANISH|SWEDISH|TURKISH|UKRAINIAN|AFRIKAANS|CROATIAN|CATALAN|ESTONIAN|GALICIAN|GREEK|LATVIAN";
2012-12-05 20:34:25 +01:00
static const char *_osk_activation = "disabled|double|single|immediately";
2012-12-05 20:36:04 +01:00
static const char *_settings_profiles = "easy|medium|hard";
2012-12-23 22:07:12 +01:00
static const char *_news_display = "off|summarized|full";
2011-03-03 22:04:17 +01:00
static const SettingDesc _gameopt_settings[] = {
2014-01-02 18:55:57 +01:00
/* In version 4 a new difficulty setting has been added to the difficulty settings,
* town attitude towards demolishing. Needs special handling because some dimwit thought
* it funny to have the GameDifficulty struct be an array while it is a struct of
* same-sized members
* XXX - To save file-space and since values are never bigger than about 10? only
* save the first 16 bits in the savegame. Question is why the values are still int32
* and why not byte for example?
* 'SLE_FILE_I16 | SLE_VAR_U16' in "diff_custom" is needed to get around SlArray() hack
* for savegames version 0 - though it is an array, it has to go through the byteswap process */
2011-03-03 22:04:17 +01:00
[post-amble]
};
[templates]
2020-12-14 00:14:37 +01:00
SDTG_GENERAL = SDTG_GENERAL($name, $sdt_cmd, $sle_cmd, $type, $flags, $guiflags, $var, $length, $def, $min, $max, $interval, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
2011-03-05 11:47:49 +01:00
SDT_NULL = SDT_NULL($length, $from, $to),
2020-12-14 00:14:37 +01:00
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $guiflags, $var, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $strhelp, $strval, $proc, $from, $to, $load, $cat, $extra),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra),
2011-03-05 11:47:49 +01:00
SDT_END = SDT_END()
2011-03-03 22:04:17 +01:00
2011-03-05 11:12:03 +01:00
[defaults]
flags = 0
2019-04-22 12:10:44 +02:00
guiflags = SGF_NONE
2011-03-05 11:12:03 +01:00
interval = 0
str = STR_NULL
2012-05-12 12:09:00 +02:00
strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT
2011-03-06 16:51:44 +01:00
strval = STR_NULL
2019-04-11 13:24:02 +02:00
proc = nullptr
load = nullptr
2019-01-26 02:48:40 +01:00
from = SL_MIN_VERSION
2011-03-05 11:20:49 +01:00
to = SL_MAX_VERSION
2012-11-08 11:04:00 +01:00
cat = SC_ADVANCED
2020-12-14 00:14:37 +01:00
extra = 0
2011-03-05 11:12:03 +01:00
2011-03-03 22:04:17 +01:00
[SDTG_GENERAL]
name = ""diff_custom""
sdt_cmd = SDT_INTLIST
sle_cmd = SL_ARR
type = SLE_FILE_I16 | SLE_VAR_U16
2011-03-05 12:34:31 +01:00
flags = SLF_NOT_IN_CONFIG
2011-03-03 22:04:17 +01:00
var = _old_diff_custom
length = 17
def = 0
min = 0
max = 0
2019-04-11 13:24:02 +02:00
full = nullptr
2019-01-26 02:48:40 +01:00
to = SLV_4
2011-03-03 22:04:17 +01:00
[SDTG_GENERAL]
name = ""diff_custom""
sdt_cmd = SDT_INTLIST
sle_cmd = SL_ARR
type = SLE_UINT16
2011-03-05 12:34:31 +01:00
flags = SLF_NOT_IN_CONFIG
2011-03-03 22:04:17 +01:00
var = _old_diff_custom
length = 18
def = 0
min = 0
max = 0
2019-04-11 13:24:02 +02:00
full = nullptr
2019-01-26 02:48:40 +01:00
from = SLV_4
2011-03-03 22:04:17 +01:00
##
2012-12-05 20:36:41 +01:00
[SDTG_VAR]
name = ""diff_level""
var = _old_diff_level
2011-03-03 22:04:17 +01:00
type = SLE_UINT8
2012-12-05 20:36:41 +01:00
flags = SLF_NOT_IN_CONFIG
2012-12-05 20:34:45 +01:00
def = SP_CUSTOM
min = SP_EASY
max = SP_CUSTOM
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDT_OMANY]
base = GameSettings
var = locale.currency
type = SLE_UINT8
2011-03-05 12:34:31 +01:00
flags = SLF_NO_NETWORK_SYNC
2011-03-03 22:04:17 +01:00
def = 0
2013-03-09 17:16:17 +01:00
max = CURRENCY_END - 1
2011-03-03 22:04:17 +01:00
full = _locale_currencies
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2013-06-29 11:47:18 +02:00
[SDTG_OMANY]
name = ""units""
var = _old_units
2011-03-03 22:04:17 +01:00
type = SLE_UINT8
2013-06-29 11:47:18 +02:00
flags = SLF_NOT_IN_CONFIG
2011-03-03 22:04:17 +01:00
def = 1
max = 2
full = _locale_units
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
# There are only 21 predefined town_name values (0-20), but you can have more with newgrf action F so allow
# these bigger values (21-255). Invalid values will fallback to english on use and (undefined string) in GUI.
[SDT_OMANY]
base = GameSettings
var = game_creation.town_name
type = SLE_UINT8
def = 0
max = 255
full = _town_names
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDT_OMANY]
base = GameSettings
var = game_creation.landscape
type = SLE_UINT8
def = 0
max = 3
full = _climates
load = ConvertLandscape
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2011-11-25 18:33:58 +01:00
[SDT_VAR]
base = GameSettings
var = game_creation.snow_line_height
type = SLE_UINT8
def = DEF_SNOWLINE_HEIGHT * TILE_HEIGHT
min = MIN_SNOWLINE_HEIGHT * TILE_HEIGHT
max = MAX_SNOWLINE_HEIGHT * TILE_HEIGHT
2019-01-26 02:48:40 +01:00
to = SLV_22
2011-11-25 18:33:58 +01:00
2011-11-17 21:42:12 +01:00
[SDT_NULL]
length = 1
2019-01-26 02:48:40 +01:00
from = SLV_22
to = SLV_165
2011-03-03 22:04:17 +01:00
2011-03-05 11:47:49 +01:00
[SDT_NULL]
2011-03-03 22:04:17 +01:00
length = 1
2019-01-26 02:48:40 +01:00
to = SLV_23
2011-03-03 22:04:17 +01:00
2011-03-05 11:47:49 +01:00
[SDTC_OMANY]
2011-03-03 22:04:17 +01:00
var = gui.autosave
type = SLE_UINT8
2019-01-26 02:48:40 +01:00
from = SLV_23
2011-03-05 12:34:31 +01:00
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
2011-03-03 22:04:17 +01:00
def = 1
max = 4
full = _autosave_interval
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDT_OMANY]
base = GameSettings
var = vehicle.road_side
type = SLE_UINT8
def = 1
max = 1
full = _roadsides
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDT_END]