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/>.
;
2021-05-29 11:08:58 +02:00
; Various of settings that are stored in global variables. They are all
; located under "misc" in the configuration files.
2011-03-03 22:04:17 +01:00
[pre-amble]
2020-12-06 21:11:48 +01:00
extern std::string _config_language_file;
2011-03-03 22:04:17 +01:00
2021-09-19 22:44:28 +02:00
static constexpr std::initializer_list<const char*> _support8bppmodes{"no", "system", "hardware"};
static constexpr std::initializer_list<const char*> _display_opt_modes{"SHOW_TOWN_NAMES", "SHOW_STATION_NAMES", "SHOW_SIGNS", "FULL_ANIMATION", "", "FULL_DETAIL", "WAYPOINTS", "SHOW_COMPETITOR_SIGNS"};
2014-04-27 14:15:14 +02:00
2021-01-07 22:09:43 +01:00
#ifdef WITH_COCOA
extern bool _allow_hidpi_window;
#endif
2021-03-08 15:42:39 +01:00
#ifndef WITH_COCOA
#define WITHOUT_COCOA
#endif
2021-01-07 22:09:43 +01:00
2021-07-05 17:46:38 +02:00
static const SettingVariant _misc_settings_table[] = {
2011-03-03 22:04:17 +01:00
[post-amble]
};
[templates]
2021-06-03 20:55:03 +02:00
SDTG_LIST = SDTG_LIST($name, $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
SDTG_MMANY = SDTG_MMANY($name, $type, $flags, $var, $def, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTG_SSTR = SDTG_SSTR($name, $type, $flags, $var, $def, 0, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $var, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
2011-03-03 22:04:17 +01:00
2021-03-01 13:12:17 +01:00
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
SDTG_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
2011-03-05 11:12:03 +01:00
[defaults]
2021-06-03 20:55:03 +02:00
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
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
2021-05-24 09:44:20 +02:00
pre_cb = nullptr
post_cb = nullptr
2019-04-11 13:24:02 +02:00
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
2021-02-16 00:09:52 +01:00
startup = true
2011-03-05 11:12:03 +01:00
2011-03-03 22:04:17 +01:00
[SDTG_MMANY]
name = ""display_opt""
type = SLE_UINT8
var = _display_opt
2011-08-01 20:41:21 +02:00
def = (1 << DO_SHOW_TOWN_NAMES | 1 << DO_SHOW_STATION_NAMES | 1 << DO_SHOW_SIGNS | 1 << DO_FULL_ANIMATION | 1 << DO_FULL_DETAIL | 1 << DO_SHOW_WAYPOINT_NAMES | 1 << DO_SHOW_COMPETITOR_SIGNS)
2021-05-23 19:16:56 +02:00
full = _display_opt_modes
2011-03-03 22:04:17 +01:00
[SDTG_BOOL]
name = ""fullscreen""
var = _fullscreen
def = false
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2021-03-08 15:42:39 +01:00
[SDTG_BOOL]
ifdef = WITH_COCOA
name = ""video_hw_accel""
var = _video_hw_accel
def = false
cat = SC_BASIC
[SDTG_BOOL]
ifdef = WITHOUT_COCOA
name = ""video_hw_accel""
var = _video_hw_accel
def = true
cat = SC_BASIC
2021-04-10 14:53:26 +02:00
[SDTG_BOOL]
name = ""video_vsync""
var = _video_vsync
def = false
cat = SC_BASIC
2014-04-27 14:15:14 +02:00
[SDTG_OMANY]
name = ""support8bpp""
type = SLE_UINT8
var = _support8bpp
def = 0
max = 2
full = _support8bppmodes
cat = SC_BASIC
2020-05-17 23:32:06 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""soundsset""
type = SLE_STRQ
var = BaseSounds::ini_set
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2020-05-17 23:32:06 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""musicset""
type = SLE_STRQ
var = BaseMusic::ini_set
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2020-05-17 23:32:08 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""videodriver""
type = SLE_STRQ
var = _ini_videodriver
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2020-05-17 23:32:08 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""musicdriver""
type = SLE_STRQ
var = _ini_musicdriver
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2020-05-17 23:32:08 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""sounddriver""
type = SLE_STRQ
var = _ini_sounddriver
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2020-05-17 23:32:08 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""blitter""
type = SLE_STRQ
var = _ini_blitter
2019-04-11 13:24:02 +02:00
def = nullptr
2011-03-03 22:04:17 +01:00
2020-12-06 21:11:48 +01:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""language""
2020-12-06 21:11:48 +01:00
type = SLE_STR
2011-03-03 22:04:17 +01:00
var = _config_language_file
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
; workaround for implicit lengthof() in SDTG_LIST
2011-03-05 11:47:49 +01:00
[SDTG_LIST]
2011-03-03 22:04:17 +01:00
name = ""resolution""
type = SLE_INT
length = 2
var = _cur_resolution
2021-01-14 21:53:06 +01:00
def = ""0,0""
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2021-04-28 17:32:33 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""screenshot_format""
2021-04-28 17:32:33 +02:00
type = SLE_STR
2011-03-03 22:04:17 +01:00
var = _screenshot_format_name
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2021-04-28 17:32:33 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""savegame_format""
2021-04-28 17:32:33 +02:00
type = SLE_STR
2011-03-03 22:04:17 +01:00
var = _savegame_format
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
[SDTG_BOOL]
name = ""rightclick_emulate""
var = _rightclick_emulate
def = false
2021-04-28 17:10:15 +02:00
[SDTG_SSTR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""small_font""
2021-04-28 17:10:15 +02:00
type = SLE_STR
2022-09-15 19:21:27 +02:00
var = _fcsettings.small.font
2019-04-11 13:24:02 +02:00
def = nullptr
2011-03-03 22:04:17 +01:00
2021-04-28 17:10:15 +02:00
[SDTG_SSTR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""medium_font""
2021-04-28 17:10:15 +02:00
type = SLE_STR
2022-09-15 19:21:27 +02:00
var = _fcsettings.medium.font
2019-04-11 13:24:02 +02:00
def = nullptr
2011-03-03 22:04:17 +01:00
2021-04-28 17:10:15 +02:00
[SDTG_SSTR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""large_font""
2021-04-28 17:10:15 +02:00
type = SLE_STR
2022-09-15 19:21:27 +02:00
var = _fcsettings.large.font
2019-04-11 13:24:02 +02:00
def = nullptr
2011-03-03 22:04:17 +01:00
2021-04-28 17:10:15 +02:00
[SDTG_SSTR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-11-20 12:56:51 +01:00
name = ""mono_font""
2021-04-28 17:10:15 +02:00
type = SLE_STR
2022-09-15 19:21:27 +02:00
var = _fcsettings.mono.font
2019-04-11 13:24:02 +02:00
def = nullptr
2011-11-20 12:56:51 +01:00
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""small_size""
type = SLE_UINT
2022-09-15 19:21:27 +02:00
var = _fcsettings.small.size
2013-04-07 00:06:44 +02:00
def = 0
2011-03-03 22:04:17 +01:00
min = 0
max = 72
[SDTG_VAR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""medium_size""
type = SLE_UINT
2022-09-15 19:21:27 +02:00
var = _fcsettings.medium.size
2013-04-07 00:06:44 +02:00
def = 0
2011-03-03 22:04:17 +01:00
min = 0
max = 72
[SDTG_VAR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""large_size""
type = SLE_UINT
2022-09-15 19:21:27 +02:00
var = _fcsettings.large.size
2013-04-07 00:06:44 +02:00
def = 0
2011-03-03 22:04:17 +01:00
min = 0
max = 72
2011-11-20 12:56:51 +01:00
[SDTG_VAR]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-11-20 20:06:27 +01:00
name = ""mono_size""
2011-11-20 12:56:51 +01:00
type = SLE_UINT
2022-09-15 19:21:27 +02:00
var = _fcsettings.mono.size
2013-04-07 00:06:44 +02:00
def = 0
2011-11-20 12:56:51 +01:00
min = 0
max = 72
2011-03-03 22:04:17 +01:00
[SDTG_BOOL]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""small_aa""
2022-09-15 19:21:27 +02:00
var = _fcsettings.small.aa
2011-03-03 22:04:17 +01:00
def = false
[SDTG_BOOL]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""medium_aa""
2022-09-15 19:21:27 +02:00
var = _fcsettings.medium.aa
2011-03-03 22:04:17 +01:00
def = false
[SDTG_BOOL]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-03-03 22:04:17 +01:00
name = ""large_aa""
2022-09-15 19:21:27 +02:00
var = _fcsettings.large.aa
2011-03-03 22:04:17 +01:00
def = false
2011-11-20 12:56:51 +01:00
[SDTG_BOOL]
2018-11-25 01:32:48 +01:00
ifdef = HAS_TRUETYPE_FONT
2011-11-20 12:56:51 +01:00
name = ""mono_aa""
2022-09-15 19:21:27 +02:00
var = _fcsettings.mono.aa
2011-11-20 12:56:51 +01:00
def = false
2023-12-16 18:28:49 +01:00
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""global_aa""
var = _fcsettings.global_aa
def = true
[SDTG_BOOL]
ifdef = HAS_TRUETYPE_FONT
name = ""prefer_sprite_font""
var = _fcsettings.prefer_sprite
def = false
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
2012-05-15 22:37:42 +02:00
name = ""sprite_cache_size_px""
2011-03-03 22:04:17 +01:00
type = SLE_UINT
var = _sprite_cache_size
2012-05-15 22:37:42 +02:00
def = 128
2011-03-03 22:04:17 +01:00
min = 1
2011-11-24 13:38:48 +01:00
max = 512
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
name = ""player_face""
type = SLE_UINT32
var = _company_manager_face
def = 0
min = 0
max = 0xFFFFFFFF
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
name = ""transparency_options""
type = SLE_UINT
var = _transparency_opt
def = 0
min = 0
max = 0x1FF
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
name = ""transparency_locks""
type = SLE_UINT
var = _transparency_lock
def = 0
min = 0
max = 0x1FF
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
[SDTG_VAR]
name = ""invisibility_options""
type = SLE_UINT
var = _invisibility_opt
def = 0
min = 0
max = 0xFF
2012-11-08 11:04:00 +01:00
cat = SC_BASIC
2011-03-03 22:04:17 +01:00
2021-04-28 17:32:33 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""keyboard""
2021-04-28 17:32:33 +02:00
type = SLE_STR
2011-03-03 22:04:17 +01:00
var = _keyboard_opt[0]
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2021-04-28 17:32:33 +02:00
[SDTG_SSTR]
2011-03-03 22:04:17 +01:00
name = ""keyboard_caps""
2021-04-28 17:32:33 +02:00
type = SLE_STR
2011-03-03 22:04:17 +01:00
var = _keyboard_opt[1]
2019-04-11 13:24:02 +02:00
def = nullptr
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-03-03 22:04:17 +01:00
2011-11-14 22:41:23 +01:00
[SDTG_VAR]
name = ""last_newgrf_count""
type = SLE_UINT32
var = _settings_client.gui.last_newgrf_count
def = 100
min = 0
max = UINT32_MAX
2012-11-08 11:04:00 +01:00
cat = SC_EXPERT
2011-11-14 22:41:23 +01:00
2014-10-11 15:22:37 +02:00
[SDTG_VAR]
2021-04-20 12:49:20 +02:00
name = ""gui_scale""
type = SLE_INT32
var = _gui_scale_cfg
def = -1
min = -1
max = MAX_INTERFACE_SCALE
2019-02-23 09:27:46 +01:00
cat = SC_BASIC
2021-01-07 22:09:43 +01:00
[SDTG_BOOL]
ifdef = WITH_COCOA
name = ""allow_hidpi""
var = _allow_hidpi_window
def = true