From 73b226b4b7f6f6693869ee790905c3a1dceddd2a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 22 Jan 2004 01:33:27 +0000 Subject: [PATCH] fix the key bindings menus (invalid strings) and add a music volume knob --- ruamoko/cl_menu/controls_o.qc | 9 ++++++++- ruamoko/cl_menu/options.qc | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ruamoko/cl_menu/controls_o.qc b/ruamoko/cl_menu/controls_o.qc index 8d0f02276..1f57c3102 100644 --- a/ruamoko/cl_menu/controls_o.qc +++ b/ruamoko/cl_menu/controls_o.qc @@ -164,7 +164,14 @@ get_hash_keys = if (desc2 != "") { desc1 += ", " + desc2; } - binding.keys = desc1; + if (binding.keys) { + str_free (binding.keys); + binding.keys = NIL; + } + if (desc1) { + binding.keys = str_new (); + str_copy (binding.keys, desc1); + } } }; diff --git a/ruamoko/cl_menu/options.qc b/ruamoko/cl_menu/options.qc index 5f58186bc..5bc2897f4 100644 --- a/ruamoko/cl_menu/options.qc +++ b/ruamoko/cl_menu/options.qc @@ -202,10 +202,10 @@ CB_audio_options = if(!(key == QFK_RIGHT || key == QFK_LEFT )) { return 0; } - volume = cvar ("volume"); + volume = cvar (text); volume = min_max_cnt (MIN_VOLUME, MAX_VOLUME, VOLUME_STEP, volume, (key == QFK_RIGHT) && (key != QFK_LEFT)); - cvar_set ("volume", ftos (volume)); + cvar_set (text, ftos (volume)); return 0; }; @@ -232,6 +232,11 @@ DRAW_audio_options = to_percentage (MIN_VOLUME, MAX_VOLUME, cvar("volume")) ); Draw_String (x + 126 + (15 + 4)*8 , bar_pad + 10, ftos(cvar("volume"))); + Draw_String (x + 70, bar_pad + 18, "Music :"); + draw_perc_bar (x + 126, bar_pad + 18, 15, + to_percentage (MIN_VOLUME, MAX_VOLUME, cvar("bgmvolume")) ); + Draw_String (x + 126 + (15 + 4)*8 , bar_pad + 18, ftos(cvar("bgmvolume"))); + opt_cursor (x + 62, y + (Menu_GetIndex() * 10) + 60); return 1; }; @@ -252,6 +257,7 @@ MENU_audio_options = bar_pad = 0; Menu_Item (54, bar_pad + 10, "volume", CB_audio_options, 1); + Menu_Item (54, bar_pad + 10, "bgmvolume", CB_audio_options, 1); Menu_End (); };