Added option to disable sound when moving cursor by using scrollwheel.
This commit is contained in:
parent
9a4c2dc111
commit
cbe710b549
2 changed files with 11 additions and 5 deletions
|
|
@ -32,10 +32,14 @@
|
|||
**
|
||||
*/
|
||||
|
||||
#include "c_cvars.h"
|
||||
#include "v_video.h"
|
||||
#include "menu.h"
|
||||
#include "vm.h"
|
||||
|
||||
// by request of Nash
|
||||
CVARD(Bool, silence_menu_scroll, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "Silences cursor movement when scrolling");
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
|
|
@ -65,4 +69,4 @@ DEFINE_ACTION_FUNCTION_NATIVE(_OptionMenuItemOption, SetCVarDescription, SetCVar
|
|||
PARAM_STRING(label);
|
||||
SetCVarDescription(cv, &label);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,9 +225,10 @@ class OptionMenu : Menu
|
|||
{
|
||||
if (ev.type == UIEvent.Type_WheelUp)
|
||||
{
|
||||
if (MenuScrollViewport(-2, true))
|
||||
if (MenuScrollViewport(-2, true) )
|
||||
{
|
||||
MenuSound ("menu/cursor");
|
||||
bool silence = Cvar.FindCVar("silence_menu_scroll").getInt();
|
||||
if (!silence) MenuSound ("menu/cursor");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -235,7 +236,8 @@ class OptionMenu : Menu
|
|||
{
|
||||
if (MenuScrollViewport(2, true))
|
||||
{
|
||||
MenuSound ("menu/cursor");
|
||||
bool silence = Cvar.FindCVar("silence_menu_scroll").getInt();
|
||||
if (!silence) MenuSound ("menu/cursor");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -489,7 +491,7 @@ class OptionMenu : Menu
|
|||
if (!mDesc.mItems[i].Selectable()) continue;
|
||||
lastSelectable = i;
|
||||
}
|
||||
if (lastSelectable != -1 && mDesc.mSelectedItem > lastSelectable)
|
||||
if (cursor && lastSelectable != -1 && mDesc.mSelectedItem > lastSelectable)
|
||||
{
|
||||
mDesc.mSelectedItem = lastSelectable;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue