float contentavgalpha, liquidalpha_prev;\r
float stomachsplash_alpha, stomachsplash_remove_at_respawn;\r
float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2;\r
+float volume_modify_changed_1, volume_modify_changed_2;\r
vector myhealth_gentlergb;\r
vector liquidcolor_prev;\r
vector damage_blurpostprocess, content_blurpostprocess;\r
if(cvar("cl_vore_cutvolume_sound") < 1 || cvar("cl_vore_cutvolume_music") < 1)\r
{\r
float volume_modify_1_target, volume_modify_2_target, volume_modify_fade;\r
- if(spectatee_status == -1 || intermission)\r
- {\r
- volume_modify_1_target = 1;\r
- volume_modify_2_target = 1;\r
- }\r
- else if(getstati(STAT_VORE_EATEN))\r
+\r
+ if(volume_modify_changed_1 != cvar("menu_volume") || volume_modify_changed_2 != cvar("menu_bgmvolume"))\r
{\r
- volume_modify_1_target = volume_modify_default_1 * cvar("cl_vore_cutvolume_sound");\r
- volume_modify_2_target = volume_modify_default_2 * cvar("cl_vore_cutvolume_music");\r
+ // An ugly hack to allow the cutvolume feature to work with the menu audio sliders.\r
+ // Without it, adjusting the music or master sound sliders while fading that volume would have bad results.\r
+ // This needs to be done in a better way! Currently, changing the volume sliders will just reset the fading.\r
+\r
+ volume_modify_default_1 = volume_modify_1 = cvar("volume");\r
+ volume_modify_default_2 = volume_modify_2 = cvar("bgmvolume");\r
+\r
+ volume_modify_changed_1 = cvar("menu_volume");\r
+ volume_modify_changed_2 = cvar("menu_bgmvolume");\r
}\r
else\r
{\r
- volume_modify_1_target = 1;\r
- volume_modify_2_target = 1;\r
- }\r
- volume_modify_fade = cvar("cl_vore_cutvolume_fade") * frametime;\r
-\r
- if(volume_modify_1 != volume_modify_1_target || volume_modify_2 != volume_modify_2_target)\r
- {\r
- if (volume_modify_1 > volume_modify_1_target + volume_modify_fade)\r
- volume_modify_1 -= volume_modify_fade;\r
- else if (volume_modify_1 < volume_modify_1_target - volume_modify_fade)\r
- volume_modify_1 += volume_modify_fade;\r
- else\r
- volume_modify_1 = volume_modify_1_target;\r
-\r
- if (volume_modify_2 > volume_modify_2_target + volume_modify_fade)\r
- volume_modify_2 -= volume_modify_fade;\r
- else if (volume_modify_2 < volume_modify_2_target - volume_modify_fade)\r
- volume_modify_2 += volume_modify_fade;\r
+ if(spectatee_status == -1 || intermission)\r
+ {\r
+ volume_modify_1_target = 1;\r
+ volume_modify_2_target = 1;\r
+ }\r
+ else if(getstati(STAT_VORE_EATEN))\r
+ {\r
+ volume_modify_1_target = volume_modify_default_1 * cvar("cl_vore_cutvolume_sound");\r
+ volume_modify_2_target = volume_modify_default_2 * cvar("cl_vore_cutvolume_music");\r
+ }\r
else\r
- volume_modify_2 = volume_modify_1_target;\r
+ {\r
+ volume_modify_1_target = 1;\r
+ volume_modify_2_target = 1;\r
+ }\r
+ volume_modify_fade = cvar("cl_vore_cutvolume_fade") * frametime;\r
\r
- cvar_set("volume", ftos(volume_modify_1));\r
- cvar_set("bgmvolume", ftos(volume_modify_2));\r
- // TODO: Setting the "volume" cvar is a bad way to go, and modifies the menu slider! We need a better way\r
+ if(volume_modify_1 != volume_modify_1_target || volume_modify_2 != volume_modify_2_target)\r
+ {\r
+ if (volume_modify_1 > volume_modify_1_target + volume_modify_fade)\r
+ volume_modify_1 -= volume_modify_fade;\r
+ else if (volume_modify_1 < volume_modify_1_target - volume_modify_fade)\r
+ volume_modify_1 += volume_modify_fade;\r
+ else\r
+ volume_modify_1 = volume_modify_1_target;\r
\r
- if(!cvar("menu_block_sound_sliders"))\r
- cvar_set("menu_block_sound_sliders", "1"); // ugly hack to block the sound sliders\r
- }\r
- else if not(getstati(STAT_VORE_EATEN))\r
- {\r
- // no volume fading is currently taking place, and we are not inside the stomach.\r
- // so if we change the volume settings, update the initial volume\r
- volume_modify_default_1 = cvar("volume");\r
- volume_modify_default_2 = cvar("bgmvolume");\r
+ if (volume_modify_2 > volume_modify_2_target + volume_modify_fade)\r
+ volume_modify_2 -= volume_modify_fade;\r
+ else if (volume_modify_2 < volume_modify_2_target - volume_modify_fade)\r
+ volume_modify_2 += volume_modify_fade;\r
+ else\r
+ volume_modify_2 = volume_modify_1_target;\r
\r
- if(cvar("menu_block_sound_sliders"))\r
- cvar_set("menu_block_sound_sliders", "0"); // ugly hack to block the sound sliders\r
+ cvar_set("volume", ftos(volume_modify_1));\r
+ cvar_set("bgmvolume", ftos(volume_modify_2));\r
+ // TODO: Setting the "volume" cvar is a bad way to go, and modifies the menu slider! We need a better way\r
+ }\r
}\r
}\r
- else if(cvar("menu_block_sound_sliders"))\r
- cvar_set("menu_block_sound_sliders", "0"); // ugly hack to block the sound sliders\r
\r
// Draw the mouse cursor\r
// NOTE: drawpic must happen after R_RenderScene for some reason\r
s = makeVoretDecibelsSlider(-20, 0, 0.5, "bgmvolume");\r
me.TD(me, 1, 1, e = makeVoretSliderCheckBox(-1000000, 1, s, "Music:"));\r
me.TD(me, 1, 2, s);\r
- setDependent(e, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed\r
- setDependent(s, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed\r
+ makeMulti(e, "menu_bgmvolume"); // part of an ugly hack for the menu audio sliders to work with the cutsound feature\r
+ makeMulti(s, "menu_bgmvolume"); // part of an ugly hack for the menu audio sliders to work with the cutsound feature\r
me.TR(me);\r
me.TR(me);\r
s = makeVoretDecibelsSlider(-20, 0, 0.5, "volume");\r
me.TD(me, 1, 1, e = makeVoretSliderCheckBox(-1000000, 1, s, "Master:"));\r
me.TD(me, 1, 2, s);\r
- setDependent(e, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed\r
- setDependent(s, "menu_block_sound_sliders", 0, 0); // part of an ugly hack that needs to be fixed\r
+ makeMulti(e, "menu_volume"); // part of an ugly hack for the menu audio sliders to work with the cutsound feature\r
+ makeMulti(s, "menu_volume"); // part of an ugly hack for the menu audio sliders to work with the cutsound feature\r
me.TR(me);\r
me.TDempty(me, 0.2);\r
s = makeVoretDecibelsSlider(-20, 0, 0.5, "snd_staticvolume");\r