ref: 4319d9cda4caab4a9c4d5f98a780ea8d9e3531f6
parent: 232fba47e0a42af8c3ec0f934eaa855163c4ee35
author: Simon Howard <[email protected]>
date: Sat Jul 31 15:25:17 EDT 2010
Add multiplayer spy key binding. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1948
--- a/setup/configfile.c
+++ b/setup/configfile.c
@@ -314,6 +314,7 @@
{"key_menu_qload", &key_menu_qload, DEFAULT_KEY, 0, 0},
{"key_menu_quit", &key_menu_quit, DEFAULT_KEY, 0, 0},
{"key_menu_gamma", &key_menu_gamma, DEFAULT_KEY, 0, 0},
+ {"key_spy", &key_spy, DEFAULT_KEY, 0, 0},
{"key_menu_incscreen", &key_menu_incscreen, DEFAULT_KEY, 0, 0},
{"key_menu_decscreen", &key_menu_decscreen, DEFAULT_KEY, 0, 0},
--- a/setup/keyboard.c
+++ b/setup/keyboard.c
@@ -64,6 +64,7 @@
int key_menu_qload = KEY_F9;
int key_menu_quit = KEY_F10;
int key_menu_gamma = KEY_F11;
+int key_spy = KEY_F12;
int key_menu_incscreen = KEY_EQUALS;
int key_menu_decscreen = KEY_MINUS;
@@ -116,7 +117,7 @@
static int *shortcuts[] = { &key_menu_help, &key_menu_save, &key_menu_load,
&key_menu_volume, &key_menu_detail, &key_menu_qsave,
- &key_menu_endgame, &key_menu_messages,
+ &key_menu_endgame, &key_menu_messages, &key_spy,
&key_menu_qload, &key_menu_quit, &key_menu_gamma,
&key_menu_incscreen, &key_menu_decscreen,
&key_message_refresh, &key_multi_msg,
@@ -274,6 +275,7 @@
AddKeyControl(table, "Quick load", &key_menu_qload);
AddKeyControl(table, "Quit game", &key_menu_quit);
AddKeyControl(table, "Toggle gamma", &key_menu_gamma);
+ AddKeyControl(table, "Multiplayer spy", &key_spy);
AddKeyControl(table, "Increase screen size", &key_menu_incscreen);
AddKeyControl(table, "Decrease screen size", &key_menu_decscreen);
--- a/setup/keyboard.h
+++ b/setup/keyboard.h
@@ -65,6 +65,7 @@
extern int key_menu_qload;
extern int key_menu_quit;
extern int key_menu_gamma;
+extern int key_spy;
extern int key_menu_incscreen;
extern int key_menu_decscreen;
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -185,6 +185,7 @@
int key_pause = KEY_PAUSE;
int key_demo_quit = 'q';
+int key_spy = KEY_F12;
int mousebfire = 0;
int mousebstrafe = 1;
@@ -740,7 +741,7 @@
{
// allow spy mode changes even during the demo
if (gamestate == GS_LEVEL && ev->type == ev_keydown
- && ev->data1 == KEY_F12 && (singledemo || !deathmatch) )
+ && ev->data1 == key_spy && (singledemo || !deathmatch) )
{
// spy mode
do
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -122,6 +122,7 @@
extern int key_menu_qload;
extern int key_menu_quit;
extern int key_menu_gamma;
+extern int key_spy;
extern int key_menu_incscreen;
extern int key_menu_decscreen;
@@ -921,6 +922,12 @@
//
CONFIG_VARIABLE_KEY(key_menu_gamma, key_menu_gamma),
+
+ //!
+ // Keyboard shortcut to switch view in multiplayer.
+ //
+
+ CONFIG_VARIABLE_KEY(key_spy, key_spy),
//!
// Keyboard shortcut to increase the screen size.