summaryrefslogtreecommitdiff
path: root/src/ui_atoms.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2011-02-23 16:13:23 +0300
committerAndrey Nazarov <skuller@skuller.net>2011-02-23 16:13:23 +0300
commit356f70c3d55c4e21d61a30ab24cb6b0ba46861d6 (patch)
treee65f7b5c36feb294ebf79250d27ffc6508e4f25b /src/ui_atoms.c
parentd1a4276a7d1f9497b573c65a701c9ba79ac54f8e (diff)
Allow F1-12 keys to be rebound from menu.
Diffstat (limited to 'src/ui_atoms.c')
-rw-r--r--src/ui_atoms.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/ui_atoms.c b/src/ui_atoms.c
index f7ae7b4..729d322 100644
--- a/src/ui_atoms.c
+++ b/src/ui_atoms.c
@@ -492,20 +492,7 @@ void UI_Draw( int realtime ) {
R_SetColor( DRAW_COLOR_CLEAR, NULL );
}
-/*
-=================
-UI_Keydown
-=================
-*/
-void UI_Keydown( int key ) {
- menuSound_t sound;
-
- if( !uis.activeMenu ) {
- return;
- }
-
- sound = Menu_Keydown( uis.activeMenu, key );
-
+void UI_StartSound( menuSound_t sound ) {
switch( sound ) {
case QMS_IN:
S_StartLocalSound( "misc/menu1.wav" );
@@ -522,7 +509,23 @@ void UI_Keydown( int key ) {
default:
break;
}
+}
+
+/*
+=================
+UI_Keydown
+=================
+*/
+void UI_Keydown( int key ) {
+ menuSound_t sound;
+
+ if( !uis.activeMenu ) {
+ return;
+ }
+
+ sound = Menu_Keydown( uis.activeMenu, key );
+ UI_StartSound( sound );
}
/*
@@ -544,24 +547,7 @@ void UI_CharEvent( int key ) {
return;
}
- switch( sound ) {
- case QMS_IN:
- S_StartLocalSound( "misc/menu1.wav" );
- break;
- case QMS_MOVE:
- S_StartLocalSound( "misc/menu2.wav" );
- break;
- case QMS_OUT:
- S_StartLocalSound( "misc/menu3.wav" );
- break;
- case QMS_BEEP:
- S_StartLocalSound( "misc/talk1.wav" );
- break;
- case QMS_NOTHANDLED:
- default:
- break;
- }
-
+ UI_StartSound( sound );
}
static void UI_Menu_g( genctx_t *ctx ) {