From: MirceaKitsune Date: Sat, 26 Feb 2011 16:53:13 +0000 (+0200) Subject: Use an even uglier hack in the menu, until I can figure out the right maths. Sometime... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e9cf4034377c004592ab564506c53a04bc10e690;p=voretournament%2Fvoretournament.git Use an even uglier hack in the menu, until I can figure out the right maths. Sometimes you have to go with these hacks :/ --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index cc23364a..639bf5c8 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1056,6 +1056,8 @@ seta menu_skin "earthy" set menu_slowmo 1 seta menu_sounds 2 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds" +set menu_block_sound_sliders 0 "part of an ugly hack to allow the cl_vore_cutvolume cvars to work properly" + r_textbrightness 0.2 r_textcontrast 0.8 r_textshadow 1 diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index f7a268e1..e4d4aa3d 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -735,6 +735,9 @@ void CSQC_UpdateView(float w, float h) cvar_set("volume", ftos(volume_modify_1)); cvar_set("bgmvolume", ftos(volume_modify_2)); // TODO: Setting the "volume" cvar is a bad way to go, and modifies the menu slider! We need a better way + + if(!cvar("menu_block_sound_sliders")) + cvar_set("menu_block_sound_sliders", "1"); // ugly hack to block the sound sliders } else if not(getstati(STAT_VORE_EATEN)) { @@ -742,8 +745,13 @@ void CSQC_UpdateView(float w, float h) // so if we change the volume settings, update the initial volume volume_modify_default_1 = cvar("volume"); volume_modify_default_2 = cvar("bgmvolume"); + + if(cvar("menu_block_sound_sliders")) + cvar_set("menu_block_sound_sliders", "0"); // ugly hack to block the sound sliders } } + else if(cvar("menu_block_sound_sliders")) + cvar_set("menu_block_sound_sliders", "0"); // ugly hack to block the sound sliders // Draw the mouse cursor // NOTE: drawpic must happen after R_RenderScene for some reason diff --git a/data/qcsrc/menu/voret/dialog_settings_audio.c b/data/qcsrc/menu/voret/dialog_settings_audio.c index 8d68649a..5968216c 100644 --- a/data/qcsrc/menu/voret/dialog_settings_audio.c +++ b/data/qcsrc/menu/voret/dialog_settings_audio.c @@ -26,11 +26,15 @@ void fillVoretAudioSettingsTab(entity me) s = makeVoretDecibelsSlider(-20, 0, 0.5, "bgmvolume"); me.TD(me, 1, 1, e = makeVoretSliderCheckBox(-1000000, 1, s, "Music:")); me.TD(me, 1, 2, s); + setDependent(e, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed + setDependent(s, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed me.TR(me); me.TR(me); s = makeVoretDecibelsSlider(-20, 0, 0.5, "volume"); me.TD(me, 1, 1, e = makeVoretSliderCheckBox(-1000000, 1, s, "Master:")); me.TD(me, 1, 2, s); + setDependent(e, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed + setDependent(s, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed me.TR(me); me.TDempty(me, 0.2); s = makeVoretDecibelsSlider(-20, 0, 0.5, "snd_staticvolume");