summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-03-05 18:00:48 +0000
committerrubidium <rubidium@openttd.org>2011-03-05 18:00:48 +0000
commitf90044d343ff97ca54c09e9f5360eba87744b613 (patch)
tree86c4c198468833f166103cb5011f15c3e60d4641 /src/table
parentbaaf3cd837fb9af8b47fb91e093150b9058b6740 (diff)
downloadopenttd-f90044d343ff97ca54c09e9f5360eba87744b613.tar.xz
(svn r22202) -Codechange: make MusicFileSettings a proper citizen of the client settings
Diffstat (limited to 'src/table')
-rw-r--r--src/table/music_settings.ini75
-rw-r--r--src/table/settings.h.preamble4
-rw-r--r--src/table/settings.ini58
3 files changed, 55 insertions, 82 deletions
diff --git a/src/table/music_settings.ini b/src/table/music_settings.ini
deleted file mode 100644
index b458b77a3..000000000
--- a/src/table/music_settings.ini
+++ /dev/null
@@ -1,75 +0,0 @@
-[pre-amble]
-static const SettingDesc _music_settings[] = {
-[post-amble]
-};
-[templates]
-SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
-SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $proc, $from, $to),
-SDT_LIST = SDT_LIST($base, $var, $type, $flags, $guiflags, $def, $str, $proc, $from, $to),
-SDT_END = SDT_END()
-
-[defaults]
-flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
-guiflags = 0
-interval = 0
-str = STR_NULL
-proc = NULL
-load = NULL
-from = 0
-to = SL_MAX_VERSION
-
-
-
-[SDT_VAR]
-base = MusicFileSettings
-var = playlist
-type = SLE_UINT8
-def = 0
-min = 0
-max = 5
-interval = 1
-
-[SDT_VAR]
-base = MusicFileSettings
-var = music_vol
-type = SLE_UINT8
-def = 127
-min = 0
-max = 127
-interval = 1
-
-[SDT_VAR]
-base = MusicFileSettings
-var = effect_vol
-type = SLE_UINT8
-def = 127
-min = 0
-max = 127
-interval = 1
-
-[SDT_LIST]
-base = MusicFileSettings
-var = custom_1
-type = SLE_UINT8
-def = NULL
-
-[SDT_LIST]
-base = MusicFileSettings
-var = custom_2
-type = SLE_UINT8
-def = NULL
-
-[SDT_BOOL]
-base = MusicFileSettings
-var = playing
-def = true
-
-[SDT_BOOL]
-base = MusicFileSettings
-var = shuffle
-def = false
-
-[SDT_END]
-
-
-};
diff --git a/src/table/settings.h.preamble b/src/table/settings.h.preamble
index 8bb937edb..70d6826cb 100644
--- a/src/table/settings.h.preamble
+++ b/src/table/settings.h.preamble
@@ -153,8 +153,8 @@ static bool UpdateClientConfigValues(int32 p1);
#define SDTC_BOOL(var, flags, guiflags, def, str, proc, from, to)\
SDTG_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, _settings_client.var, 1, def, 0, 1, 0, NULL, str, proc, from, to)
-#define SDTC_LIST(var, type, length, flags, guiflags, def, str, proc, from, to)\
- SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, length, def, 0, 0, 0, NULL, str, proc, from, to)
+#define SDTC_LIST(var, type, flags, guiflags, def, str, proc, from, to)\
+ SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, proc, from, to)
#define SDTC_STR(var, type, flags, guiflags, def, str, proc, from, to)\
SDTG_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, proc, from, to)
diff --git a/src/table/settings.ini b/src/table/settings.ini
index 8d97878a9..b921b4b1e 100644
--- a/src/table/settings.ini
+++ b/src/table/settings.ini
@@ -15,14 +15,13 @@ const SettingDesc _settings[] = {
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $proc, $from, $to),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $proc, $from, $to),
SDTC_BOOL = SDTC_BOOL( $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
-SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
-SDTC_DBOOL = SDTC_BOOL( $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
-SDT_DBOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
+SDTC_LIST = SDTC_LIST( $var, $type, $flags, $guiflags, $def, $str, $proc, $from, $to),
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $guiflags, $def, $max, $full, $str, $proc, $from, $to),
-SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $proc, $from, $to, $load),
-SDT_STR = SDT_STR($base, $var, $type, $flags, $guiflags, $def, $str, $proc, $from, $to),
SDTC_STR = SDTC_STR( $var, $type, $flags, $guiflags, $def, $str, $proc, $from, $to),
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $proc, $from, $to),
+SDT_BOOL = SDT_BOOL($base, $var, $flags, $guiflags, $def, $str, $proc, $from, $to),
+SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def, $max, $full, $str, $proc, $from, $to, $load),
+SDT_STR = SDT_STR($base, $var, $type, $flags, $guiflags, $def, $str, $proc, $from, $to),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $proc, $from, $to),
SDT_NULL = SDT_NULL($length, $from, $to),
SDT_END = SDT_END()
@@ -2334,6 +2333,55 @@ min = 10
max = 65500
[SDTC_VAR]
+var = music.playlist
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = 0
+min = 0
+max = 5
+interval = 1
+
+[SDTC_VAR]
+var = music.music_vol
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = 127
+min = 0
+max = 127
+interval = 1
+
+[SDTC_VAR]
+var = music.effect_vol
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = 127
+min = 0
+max = 127
+interval = 1
+
+[SDTC_LIST]
+var = music.custom_1
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = NULL
+
+[SDTC_LIST]
+var = music.custom_2
+type = SLE_UINT8
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = NULL
+
+[SDTC_BOOL]
+var = music.playing
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = true
+
+[SDTC_BOOL]
+var = music.shuffle
+flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def = false
+
+[SDTC_VAR]
ifdef = ENABLE_NETWORK
var = gui.network_chat_box_width
type = SLE_UINT16