- added Aroenai's snd_menuvolume submission.

SVN r2600 (trunk)
This commit is contained in:
Christoph Oelckers 2010-08-26 18:08:09 +00:00
parent 06a35dea11
commit ffa58aadbe
2 changed files with 59 additions and 56 deletions

View file

@ -205,6 +205,7 @@ EXTERN_CVAR (String, playerclass)
EXTERN_CVAR (String, name) EXTERN_CVAR (String, name)
EXTERN_CVAR (Int, team) EXTERN_CVAR (Int, team)
EXTERN_CVAR(Bool, neverswitchonpickup) EXTERN_CVAR(Bool, neverswitchonpickup)
EXTERN_CVAR(Float, snd_menuvolume)
extern bool sendpause; extern bool sendpause;
extern int flagsvar; extern int flagsvar;
@ -663,28 +664,28 @@ CCMD (menu_help)
CCMD (quicksave) CCMD (quicksave)
{ // F6 { // F6
//M_StartControlPanel (true); //M_StartControlPanel (true);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
M_QuickSave(); M_QuickSave();
} }
CCMD (quickload) CCMD (quickload)
{ // F9 { // F9
//M_StartControlPanel (true); //M_StartControlPanel (true);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
M_QuickLoad(); M_QuickLoad();
} }
CCMD (menu_endgame) CCMD (menu_endgame)
{ // F7 { // F7
//M_StartControlPanel (true); //M_StartControlPanel (true);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
M_EndGame(0); M_EndGame(0);
} }
CCMD (menu_quit) CCMD (menu_quit)
{ // F10 { // F10
//M_StartControlPanel (true); //M_StartControlPanel (true);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
M_QuitGame(0); M_QuitGame(0);
} }
@ -1439,7 +1440,7 @@ void M_QuickSaveResponse (int ch)
if (ch == 'y') if (ch == 'y')
{ {
M_DoSave (quickSaveSlot); M_DoSave (quickSaveSlot);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/dismiss", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/dismiss", snd_menuvolume, ATTN_NONE);
} }
} }
@ -1447,7 +1448,7 @@ void M_QuickSave ()
{ {
if (!usergame || (players[consoleplayer].health <= 0 && !multiplayer)) if (!usergame || (players[consoleplayer].health <= 0 && !multiplayer))
{ {
S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE);
return; return;
} }
@ -1478,7 +1479,7 @@ void M_QuickLoadResponse (int ch)
if (ch == 'y') if (ch == 'y')
{ {
M_LoadSelect (quickSaveSlot); M_LoadSelect (quickSaveSlot);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/dismiss", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/dismiss", snd_menuvolume, ATTN_NONE);
} }
} }
@ -1981,7 +1982,7 @@ void M_EndGame(int choice)
choice = 0; choice = 0;
if (!usergame) if (!usergame)
{ {
S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/invalid", snd_menuvolume, ATTN_NONE);
return; return;
} }
@ -2042,7 +2043,7 @@ void M_QuitResponse(int ch)
{ {
if (gameinfo.quitSound.IsNotEmpty()) if (gameinfo.quitSound.IsNotEmpty())
{ {
S_Sound (CHAN_VOICE | CHAN_UI, gameinfo.quitSound, 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, gameinfo.quitSound, snd_menuvolume, ATTN_NONE);
I_WaitVBL (105); I_WaitVBL (105);
} }
} }
@ -2879,7 +2880,7 @@ void M_StartMessage (const char *string, void (*routine)(int))
if (messageRoutine != NULL) if (messageRoutine != NULL)
{ {
S_StopSound (CHAN_VOICE); S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/prompt", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/prompt", snd_menuvolume, ATTN_NONE);
} }
return; return;
} }
@ -2898,7 +2899,7 @@ void M_EndMessage(int key)
} }
SB_state = screen->GetPageCount(); // refresh the status bar SB_state = screen->GetPageCount(); // refresh the status bar
BorderNeedRefresh = screen->GetPageCount(); BorderNeedRefresh = screen->GetPageCount();
S_Sound(CHAN_VOICE | CHAN_UI, "menu/dismiss", 1, ATTN_NONE); S_Sound(CHAN_VOICE | CHAN_UI, "menu/dismiss", snd_menuvolume, ATTN_NONE);
} }
@ -3101,7 +3102,7 @@ bool M_Responder (event_t *ev)
if (currentMenu->menuitems[i].alphaKey == ch) if (currentMenu->menuitems[i].alphaKey == ch)
{ {
itemOn = i; itemOn = i;
S_Sound(CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound(CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
return true; return true;
} }
} }
@ -3337,7 +3338,7 @@ void M_ButtonHandler(EMenuKey key, bool repeat)
if (itemOn + 1 >= currentMenu->numitems) if (itemOn + 1 >= currentMenu->numitems)
itemOn = 0; itemOn = 0;
else itemOn++; else itemOn++;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} while (currentMenu->menuitems[itemOn].status == -1); } while (currentMenu->menuitems[itemOn].status == -1);
break; break;
@ -3347,7 +3348,7 @@ void M_ButtonHandler(EMenuKey key, bool repeat)
if (itemOn == 0) if (itemOn == 0)
itemOn = currentMenu->numitems - 1; itemOn = currentMenu->numitems - 1;
else itemOn--; else itemOn--;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} while (currentMenu->menuitems[itemOn].status == -1); } while (currentMenu->menuitems[itemOn].status == -1);
break; break;
@ -3355,7 +3356,7 @@ void M_ButtonHandler(EMenuKey key, bool repeat)
if (currentMenu->menuitems[itemOn].routine && if (currentMenu->menuitems[itemOn].routine &&
currentMenu->menuitems[itemOn].status == 2) currentMenu->menuitems[itemOn].status == 2)
{ {
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
currentMenu->menuitems[itemOn].routine(0); currentMenu->menuitems[itemOn].routine(0);
} }
break; break;
@ -3364,7 +3365,7 @@ void M_ButtonHandler(EMenuKey key, bool repeat)
if (currentMenu->menuitems[itemOn].routine && if (currentMenu->menuitems[itemOn].routine &&
currentMenu->menuitems[itemOn].status == 2) currentMenu->menuitems[itemOn].status == 2)
{ {
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
currentMenu->menuitems[itemOn].routine(1); currentMenu->menuitems[itemOn].routine(1);
} }
break; break;
@ -3377,12 +3378,12 @@ void M_ButtonHandler(EMenuKey key, bool repeat)
if (currentMenu->menuitems[itemOn].status == 2) if (currentMenu->menuitems[itemOn].status == 2)
{ {
currentMenu->menuitems[itemOn].routine(1); // right arrow currentMenu->menuitems[itemOn].routine(1); // right arrow
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
else else
{ {
currentMenu->menuitems[itemOn].routine(itemOn); currentMenu->menuitems[itemOn].routine(itemOn);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
} }
} }
break; break;
@ -3602,7 +3603,7 @@ void M_StartControlPanel (bool makeSound, bool wantTop)
if (makeSound) if (makeSound)
{ {
S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/activate", snd_menuvolume, ATTN_NONE);
} }
} }
@ -3946,12 +3947,12 @@ void M_PopMenuStack (void)
} }
drawSkull = MenuStack[MenuStackDepth].drawSkull; drawSkull = MenuStack[MenuStackDepth].drawSkull;
++MenuStackDepth; ++MenuStackDepth;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/backup", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/backup", snd_menuvolume, ATTN_NONE);
} }
else else
{ {
M_ClearMenus (); M_ClearMenus ();
S_Sound (CHAN_VOICE | CHAN_UI, "menu/clear", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/clear", snd_menuvolume, ATTN_NONE);
} }
} }

View file

@ -100,6 +100,7 @@ EXTERN_CVAR (Int, snd_channels)
// defaulted values // defaulted values
// //
CVAR (Float, mouse_sensitivity, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Float, mouse_sensitivity, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Float, snd_menuvolume, 0.6f, CVAR_ARCHIVE)
// Show messages has default, 0 = off, 1 = on // Show messages has default, 0 = off, 1 = on
CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
@ -1274,6 +1275,7 @@ static valueenum_t Resamplers[] =
static menuitem_t SoundItems[] = static menuitem_t SoundItems[] =
{ {
{ slider, "Sounds volume", {&snd_sfxvolume}, {0.0}, {1.0}, {0.05f}, {NULL} }, { slider, "Sounds volume", {&snd_sfxvolume}, {0.0}, {1.0}, {0.05f}, {NULL} },
{ slider, "Menu volume", {&snd_menuvolume}, {0.0}, {1.0}, {0.05f}, {NULL} },
{ slider, "Music volume", {&snd_musicvolume}, {0.0}, {1.0}, {0.05f}, {NULL} }, { slider, "Music volume", {&snd_musicvolume}, {0.0}, {1.0}, {0.05f}, {NULL} },
{ discrete, "MIDI device", {&snd_mididevice}, {0.0}, {0.0}, {0.0}, {NULL} }, { discrete, "MIDI device", {&snd_mididevice}, {0.0}, {0.0}, {0.0}, {NULL} },
{ redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} }, { redtext, " ", {NULL}, {0.0}, {0.0}, {0.0}, {NULL} },
@ -1304,7 +1306,7 @@ static menu_t SoundMenu =
SoundItems, SoundItems,
}; };
#define MIDI_DEVICE_ITEM 2 #define MIDI_DEVICE_ITEM 3
/*======================================= /*=======================================
* *
@ -1506,13 +1508,13 @@ void M_SizeDisplay (int diff)
CCMD (sizedown) CCMD (sizedown)
{ {
M_SizeDisplay (-1); M_SizeDisplay (-1);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
CCMD (sizeup) CCMD (sizeup)
{ {
M_SizeDisplay (1); M_SizeDisplay (1);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
// Draws a string in the console font, scaled to the 8x8 cells // Draws a string in the console font, scaled to the 8x8 cells
@ -2186,7 +2188,7 @@ void M_OptResponder(event_t *ev)
NewBits = BitTranslate[DummyDepthCvar]; NewBits = BitTranslate[DummyDepthCvar];
setmodeneeded = true; setmodeneeded = true;
testingmode = I_GetTime(false) + 5 * TICRATE; testingmode = I_GetTime(false) + 5 * TICRATE;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
SetModesMenu (NewWidth, NewHeight, NewBits); SetModesMenu (NewWidth, NewHeight, NewBits);
} }
else if (ev->data1 >= '0' && ev->data1 <= '9') else if (ev->data1 >= '0' && ev->data1 <= '9')
@ -2291,7 +2293,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
CurrentMenu->items[CurrentItem].a.selmode = modecol; CurrentMenu->items[CurrentItem].a.selmode = modecol;
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} }
break; break;
@ -2361,7 +2363,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (CurrentMenu->items[CurrentItem].type == screenres) if (CurrentMenu->items[CurrentItem].type == screenres)
CurrentMenu->items[CurrentItem].a.selmode = modecol; CurrentMenu->items[CurrentItem].a.selmode = modecol;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} }
break; break;
@ -2383,7 +2385,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
{ {
++CurrentItem; ++CurrentItem;
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} }
break; break;
@ -2406,7 +2408,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
{ {
++CurrentItem; ++CurrentItem;
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
} }
break; break;
@ -2444,7 +2446,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
else else
item->a.cvar->SetGenericRep (newval, CVAR_Float); item->a.cvar->SetGenericRep (newval, CVAR_Float);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_sens: case joy_sens:
@ -2452,7 +2454,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (value.Float < item->b.min) if (value.Float < item->b.min)
value.Float = item->b.min; value.Float = item->b.min;
SELECTED_JOYSTICK->SetSensitivity(value.Float); SELECTED_JOYSTICK->SetSensitivity(value.Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_slider: case joy_slider:
@ -2485,12 +2487,12 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
{ {
SELECTED_JOYSTICK->SetAxisDeadZone(item->a.joyselection, value.Float); SELECTED_JOYSTICK->SetAxisDeadZone(item->a.joyselection, value.Float);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case palettegrid: case palettegrid:
SelColorIndex = (SelColorIndex - 1) & 15; SelColorIndex = (SelColorIndex - 1) & 15;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
break; break;
case discretes: case discretes:
@ -2535,14 +2537,14 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (item->e.values == Depths) if (item->e.values == Depths)
BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits); BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case ediscrete: case ediscrete:
value = item->a.cvar->GetGenericRep(CVAR_String); value = item->a.cvar->GetGenericRep(CVAR_String);
value.String = const_cast<char *>(M_FindPrevVal(value.String, item->e.enumvalues, (int)item->b.numvalues)); value.String = const_cast<char *>(M_FindPrevVal(value.String, item->e.enumvalues, (int)item->b.numvalues));
item->a.cvar->SetGenericRep(value, CVAR_String); item->a.cvar->SetGenericRep(value, CVAR_String);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case bitmask: case bitmask:
@ -2561,21 +2563,21 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
value.Int = (value.Int & ~bmask) | int(item->e.values[cur].value); value.Int = (value.Int & ~bmask) | int(item->e.values[cur].value);
item->a.cvar->SetGenericRep (value, CVAR_Int); item->a.cvar->SetGenericRep (value, CVAR_Int);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case inverter: case inverter:
value = item->a.cvar->GetGenericRep (CVAR_Float); value = item->a.cvar->GetGenericRep (CVAR_Float);
value.Float = -value.Float; value.Float = -value.Float;
item->a.cvar->SetGenericRep (value, CVAR_Float); item->a.cvar->SetGenericRep (value, CVAR_Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_inverter: case joy_inverter:
assert(item->e.joyslidernum == 0); assert(item->e.joyslidernum == 0);
value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection); value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection);
SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float); SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case screenres: case screenres:
@ -2599,7 +2601,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
item->a.selmode = col; item->a.selmode = col;
} }
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
break; break;
default: default:
@ -2641,7 +2643,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
else else
item->a.cvar->SetGenericRep (newval, CVAR_Float); item->a.cvar->SetGenericRep (newval, CVAR_Float);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_sens: case joy_sens:
@ -2649,7 +2651,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (value.Float > item->c.max) if (value.Float > item->c.max)
value.Float = item->c.max; value.Float = item->c.max;
SELECTED_JOYSTICK->SetSensitivity(value.Float); SELECTED_JOYSTICK->SetSensitivity(value.Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_slider: case joy_slider:
@ -2682,12 +2684,12 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
{ {
SELECTED_JOYSTICK->SetAxisDeadZone(item->a.joyselection, value.Float); SELECTED_JOYSTICK->SetAxisDeadZone(item->a.joyselection, value.Float);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case palettegrid: case palettegrid:
SelColorIndex = (SelColorIndex + 1) & 15; SelColorIndex = (SelColorIndex + 1) & 15;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
break; break;
case discretes: case discretes:
@ -2732,14 +2734,14 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (item->e.values == Depths) if (item->e.values == Depths)
BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits); BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case ediscrete: case ediscrete:
value = item->a.cvar->GetGenericRep(CVAR_String); value = item->a.cvar->GetGenericRep(CVAR_String);
value.String = const_cast<char *>(M_FindNextVal(value.String, item->e.enumvalues, (int)item->b.numvalues)); value.String = const_cast<char *>(M_FindNextVal(value.String, item->e.enumvalues, (int)item->b.numvalues));
item->a.cvar->SetGenericRep(value, CVAR_String); item->a.cvar->SetGenericRep(value, CVAR_String);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case bitmask: case bitmask:
@ -2758,21 +2760,21 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
value.Int = (value.Int & ~bmask) | int(item->e.values[cur].value); value.Int = (value.Int & ~bmask) | int(item->e.values[cur].value);
item->a.cvar->SetGenericRep (value, CVAR_Int); item->a.cvar->SetGenericRep (value, CVAR_Int);
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case inverter: case inverter:
value = item->a.cvar->GetGenericRep (CVAR_Float); value = item->a.cvar->GetGenericRep (CVAR_Float);
value.Float = -value.Float; value.Float = -value.Float;
item->a.cvar->SetGenericRep (value, CVAR_Float); item->a.cvar->SetGenericRep (value, CVAR_Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case joy_inverter: case joy_inverter:
assert(item->e.joyslidernum == 0); assert(item->e.joyslidernum == 0);
value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection); value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection);
SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float); SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
break; break;
case screenres: case screenres:
@ -2799,7 +2801,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
item->a.selmode = col; item->a.selmode = col;
} }
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
break; break;
default: default:
@ -2829,7 +2831,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
setmodeneeded = true; setmodeneeded = true;
NewBits = BitTranslate[DummyDepthCvar]; NewBits = BitTranslate[DummyDepthCvar];
} }
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
SetModesMenu (NewWidth, NewHeight, NewBits); SetModesMenu (NewWidth, NewHeight, NewBits);
} }
else if ((item->type == more || else if ((item->type == more ||
@ -2841,7 +2843,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
&& item->e.mfunc) && item->e.mfunc)
{ {
CurrentMenu->lastOn = CurrentItem; CurrentMenu->lastOn = CurrentItem;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
if (item->type == safemore || item->type == rsafemore) if (item->type == safemore || item->type == rsafemore)
{ {
ActivateConfirm (item->label, item->e.mfunc); ActivateConfirm (item->label, item->e.mfunc);
@ -2876,7 +2878,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
if (item->e.values == Depths) if (item->e.values == Depths)
BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits); BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
else if (item->type == control) else if (item->type == control)
{ {
@ -2889,7 +2891,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
else if (item->type == listelement) else if (item->type == listelement)
{ {
CurrentMenu->lastOn = CurrentItem; CurrentMenu->lastOn = CurrentItem;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
item->e.lfunc (CurrentItem); item->e.lfunc (CurrentItem);
} }
else if (item->type == inverter) else if (item->type == inverter)
@ -2897,14 +2899,14 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
value = item->a.cvar->GetGenericRep (CVAR_Float); value = item->a.cvar->GetGenericRep (CVAR_Float);
value.Float = -value.Float; value.Float = -value.Float;
item->a.cvar->SetGenericRep (value, CVAR_Float); item->a.cvar->SetGenericRep (value, CVAR_Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
else if (item->type == joy_inverter) else if (item->type == joy_inverter)
{ {
assert(item->e.joyslidernum == 0); assert(item->e.joyslidernum == 0);
value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection); value.Float = SELECTED_JOYSTICK->GetAxisScale(item->a.joyselection);
SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float); SELECTED_JOYSTICK->SetAxisScale(item->a.joyselection, -value.Float);
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
} }
else if (item->type == screenres) else if (item->type == screenres)
{ {
@ -2912,7 +2914,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
else if (item->type == colorpicker) else if (item->type == colorpicker)
{ {
CurrentMenu->lastOn = CurrentItem; CurrentMenu->lastOn = CurrentItem;
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE);
StartColorPickerMenu (item->label, item->a.colorcvar); StartColorPickerMenu (item->label, item->a.colorcvar);
} }
else if (item->type == palettegrid) else if (item->type == palettegrid)