more sounds in menus

This commit is contained in:
Bill Currie 2007-05-13 05:14:32 +00:00 committed by Jeff Teunissen
parent 0301cd6fa8
commit bffd9f208f
5 changed files with 64 additions and 9 deletions

View file

@ -13,6 +13,7 @@
#include "HUD.h" #include "HUD.h"
#include "client_menu.h" #include "client_menu.h"
#include "PropertyList.h" #include "PropertyList.h"
#include "sound.h"
#include "gui/InputLine.h" #include "gui/InputLine.h"
#include "gui/Rect.h" #include "gui/Rect.h"
@ -28,6 +29,34 @@ string [6] dot_name = {
"gfx/menudot6.lmp", "gfx/menudot6.lmp",
}; };
void ()
menu_enter_sound =
{
S_LocalSound ("misc/menu2.wav");
}
void ()
menu_leave_sound =
{
S_LocalSound ("misc/menu2.wav");
}
integer (integer key, integer unicode, integer down)
menu_key_sound =
{
switch (key) {
case QFK_DOWN:
case QFM_WHEEL_DOWN:
S_LocalSound ("misc/menu1.wav");
break;
case QFK_UP:
case QFM_WHEEL_UP:
S_LocalSound ("misc/menu1.wav");
break;
}
return 0;
}
void (integer x, integer y) spinner = void (integer x, integer y) spinner =
{ {
local integer i = (integer) (time * 10) % 6; local integer i = (integer) (time * 10) % 6;
@ -182,17 +211,20 @@ integer (integer key, integer unicode, integer down) load_keyevent =
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:
case QFM_WHEEL_DOWN: case QFM_WHEEL_DOWN:
S_LocalSound ("misc/menu1.wav");
load_cursor++; load_cursor++;
load_cursor %= MAX_SAVEGAMES; load_cursor %= MAX_SAVEGAMES;
return 1; return 1;
case QFK_UP: case QFK_UP:
case QFM_WHEEL_UP: case QFM_WHEEL_UP:
S_LocalSound ("misc/menu1.wav");
load_cursor += MAX_SAVEGAMES - 1; load_cursor += MAX_SAVEGAMES - 1;
load_cursor %= MAX_SAVEGAMES; load_cursor %= MAX_SAVEGAMES;
return 1; return 1;
case QFK_RETURN: case QFK_RETURN:
case QFM_BUTTON1: case QFM_BUTTON1:
if (loadable[load_cursor]) { if (loadable[load_cursor]) {
S_LocalSound ("misc/menu2.wav");
Menu_SelectMenu (NIL); Menu_SelectMenu (NIL);
Cbuf_AddText (sprintf ("load s%i.sav\n", load_cursor)); Cbuf_AddText (sprintf ("load s%i.sav\n", load_cursor));
} }
@ -206,11 +238,13 @@ integer (integer key, integer unicode, integer down) save_keyevent =
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:
case QFM_WHEEL_DOWN: case QFM_WHEEL_DOWN:
S_LocalSound ("misc/menu1.wav");
save_cursor++; save_cursor++;
save_cursor %= MAX_SAVEGAMES; save_cursor %= MAX_SAVEGAMES;
return 1; return 1;
case QFK_UP: case QFK_UP:
case QFM_WHEEL_UP: case QFM_WHEEL_UP:
S_LocalSound ("misc/menu1.wav");
save_cursor += MAX_SAVEGAMES - 1; save_cursor += MAX_SAVEGAMES - 1;
save_cursor %= MAX_SAVEGAMES; save_cursor %= MAX_SAVEGAMES;
return 1; return 1;
@ -226,6 +260,8 @@ integer (integer key, integer unicode, integer down) save_keyevent =
void () load_menu = void () load_menu =
{ {
Menu_Begin (0, 0, "load"); Menu_Begin (0, 0, "load");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_KeyEvent (load_keyevent); Menu_KeyEvent (load_keyevent);
Menu_Draw (load_draw); Menu_Draw (load_draw);
@ -236,6 +272,8 @@ void () load_menu =
void () save_menu = void () save_menu =
{ {
Menu_Begin (0, 0, "save"); Menu_Begin (0, 0, "save");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_KeyEvent (save_keyevent); Menu_KeyEvent (save_keyevent);
Menu_Draw (save_draw); Menu_Draw (save_draw);
@ -285,6 +323,8 @@ integer (integer x, integer y) quit_draw =
void () quit_menu = void () quit_menu =
{ {
Menu_Begin (0, 0, "quit"); Menu_Begin (0, 0, "quit");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_KeyEvent (quit_keyevent); Menu_KeyEvent (quit_keyevent);
Menu_Draw (quit_draw); Menu_Draw (quit_draw);
@ -309,6 +349,9 @@ integer (string text, integer key) sp_start =
void () single_player_menu = void () single_player_menu =
{ {
Menu_Begin (54, 32, ""); Menu_Begin (54, 32, "");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_KeyEvent (menu_key_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_Pic (16, 4, "gfx/qplaque.lmp"); Menu_Pic (16, 4, "gfx/qplaque.lmp");
Menu_CenterPic (160, 4, "gfx/ttl_sgl.lmp"); Menu_CenterPic (160, 4, "gfx/ttl_sgl.lmp");
@ -389,6 +432,7 @@ integer (integer key, integer unicode, integer down) lanconfig_keyevent =
case QFK_DOWN: case QFK_DOWN:
case QFM_WHEEL_DOWN: case QFM_WHEEL_DOWN:
if (!input_active) { if (!input_active) {
S_LocalSound ("misc/menu2.wav");
lanConfig_cursor ++; lanConfig_cursor ++;
lanConfig_cursor %= NUM_LANCONFIG_CMDS; lanConfig_cursor %= NUM_LANCONFIG_CMDS;
} }
@ -396,6 +440,7 @@ integer (integer key, integer unicode, integer down) lanconfig_keyevent =
case QFK_UP: case QFK_UP:
case QFM_WHEEL_UP: case QFM_WHEEL_UP:
if (!input_active) { if (!input_active) {
S_LocalSound ("misc/menu2.wav");
lanConfig_cursor += NUM_LANCONFIG_CMDS - 1; lanConfig_cursor += NUM_LANCONFIG_CMDS - 1;
lanConfig_cursor %= NUM_LANCONFIG_CMDS; lanConfig_cursor %= NUM_LANCONFIG_CMDS;
} }
@ -420,6 +465,8 @@ integer (integer key, integer unicode, integer down) lanconfig_keyevent =
void () lanconfig_menu = void () lanconfig_menu =
{ {
Menu_Begin (54, 92, ""); Menu_Begin (54, 92, "");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_Pic (16, 4, "gfx/qplaque.lmp"); Menu_Pic (16, 4, "gfx/qplaque.lmp");
Menu_CenterPic (160, 4, "gfx/p_multi.lmp"); Menu_CenterPic (160, 4, "gfx/p_multi.lmp");
@ -431,6 +478,9 @@ void () lanconfig_menu =
void () join_menu = void () join_menu =
{ {
Menu_Begin (54, 32, ""); Menu_Begin (54, 32, "");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_KeyEvent (menu_key_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_Pic (16, 4, "gfx/qplaque.lmp"); Menu_Pic (16, 4, "gfx/qplaque.lmp");
Menu_CenterPic (160, 4, "gfx/p_multi.lmp"); Menu_CenterPic (160, 4, "gfx/p_multi.lmp");
@ -455,6 +505,8 @@ integer (integer key, integer unicode, integer down) multi_player_keyevent =
void () multi_player_menu = void () multi_player_menu =
{ {
Menu_Begin (54, 52, ""); Menu_Begin (54, 52, "");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_Pic (16, 4, "gfx/qplaque.lmp"); Menu_Pic (16, 4, "gfx/qplaque.lmp");
Menu_CenterPic (160, 4, "gfx/p_multi.lmp"); Menu_CenterPic (160, 4, "gfx/p_multi.lmp");
@ -478,6 +530,9 @@ void () help_menu =
void () main_menu = void () main_menu =
{ {
Menu_Begin (0, 0, "main"); Menu_Begin (0, 0, "main");
Menu_EnterHook (menu_enter_sound);
Menu_LeaveHook (menu_leave_sound);
Menu_KeyEvent (menu_key_sound);
Menu_FadeScreen (1); Menu_FadeScreen (1);
Menu_Pic (16, 4, "gfx/qplaque.lmp"); Menu_Pic (16, 4, "gfx/qplaque.lmp");
Menu_CenterPic (160, 4, "gfx/ttl_main.lmp"); Menu_CenterPic (160, 4, "gfx/ttl_main.lmp");

View file

@ -283,7 +283,7 @@ CB_basic_control_binding =
Loading basic keynames when entering the menu Loading basic keynames when entering the menu
*/ */
integer () void ()
CB_ME_basic_control_binding = CB_ME_basic_control_binding =
{ {
get_hash_keys (movement_bindings); get_hash_keys (movement_bindings);
@ -360,7 +360,7 @@ CB_misc_control_binding =
Loading misc keynames when entering the menu Loading misc keynames when entering the menu
*/ */
integer () void ()
CB_ME_misc_control_binding = CB_ME_misc_control_binding =
{ {
get_hash_keys(misc_bindings); get_hash_keys(misc_bindings);
@ -437,7 +437,7 @@ CB_weapon_control_binding =
Loading weapon keynames when entering the Loading weapon keynames when entering the
menu menu
*/ */
integer () void ()
CB_ME_weapon_control_binding = CB_ME_weapon_control_binding =
{ {
get_hash_keys(weapon_bindings); get_hash_keys(weapon_bindings);

View file

@ -4,8 +4,8 @@
@extern void (integer x, integer y, string text) Menu_Begin; @extern void (integer x, integer y, string text) Menu_Begin;
@extern void (integer val) Menu_FadeScreen; @extern void (integer val) Menu_FadeScreen;
@extern void (integer (integer x, integer y) func) Menu_Draw; @extern void (integer (integer x, integer y) func) Menu_Draw;
@extern void (integer () func) Menu_EnterHook; @extern void (void () func) Menu_EnterHook;
@extern void (integer () func) Menu_LeaveHook; @extern void (void () func) Menu_LeaveHook;
@extern void (integer x, integer y, string name) Menu_Pic; @extern void (integer x, integer y, string name) Menu_Pic;
@extern void (integer x, integer y, string name, integer srcx, integer srcy, @extern void (integer x, integer y, string name, integer srcx, integer srcy,
integer width, integer height) Menu_SubPic; integer width, integer height) Menu_SubPic;

View file

@ -3,8 +3,8 @@
void (integer x, integer y, string text) Menu_Begin = #0; void (integer x, integer y, string text) Menu_Begin = #0;
void (integer val) Menu_FadeScreen = #0; void (integer val) Menu_FadeScreen = #0;
void (integer (integer x, integer y) func) Menu_Draw = #0; void (integer (integer x, integer y) func) Menu_Draw = #0;
void (integer () func) Menu_EnterHook = #0; void (void () func) Menu_EnterHook = #0;
void (integer () func) Menu_LeaveHook = #0; void (void () func) Menu_LeaveHook = #0;
void (integer x, integer y, string name) Menu_Pic = #0; void (integer x, integer y, string name) Menu_Pic = #0;
void (integer x, integer y, string name, integer srcx, integer srcy, integer width, integer height) Menu_SubPic = #0; void (integer x, integer y, string name, integer srcx, integer srcy, integer width, integer height) Menu_SubPic = #0;
void (integer x, integer y, string name) Menu_CenterPic = #0; void (integer x, integer y, string name) Menu_CenterPic = #0;

View file

@ -660,7 +660,7 @@ DRAW_player_options =
Entercallback for the playermenu. Entercallback for the playermenu.
For initalising the playername and teamname. For initalising the playername and teamname.
*/ */
integer () void ()
CB_ME_player_options = CB_ME_player_options =
{ {
if (gametype () == "quakeworld") { if (gametype () == "quakeworld") {
@ -841,7 +841,7 @@ DRAW_network_options =
Entercallback for the networkmenu. Entercallback for the networkmenu.
*/ */
integer () void ()
CB_ME_network_options = CB_ME_network_options =
{ {
[network_config_rate_il setText:Cvar_GetString ("rate")]; [network_config_rate_il setText:Cvar_GetString ("rate")];