shithub: choc

Download patch

ref: bb3f64f28173bba0b243957c63679d2ec63dce5c
parent: 373a8dd0c10c1d9f3be29cd3546819236b860ab8
author: Simon Howard <[email protected]>
date: Sat Jul 10 11:27:52 EDT 2010

Add key binding to change demo recording quit key.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1939

--- a/setup/configfile.c
+++ b/setup/configfile.c
@@ -336,6 +336,7 @@
     {"key_weapon7",                 &key_weapon7, DEFAULT_KEY, 0, 0},
     {"key_weapon8",                 &key_weapon8, DEFAULT_KEY, 0, 0},
     {"key_message_refresh",         &key_message_refresh, DEFAULT_KEY, 0, 0},
+    {"key_demo_quit",               &key_demo_quit, DEFAULT_KEY, 0, 0},
 };
 
 static default_collection_t extra_defaults =
--- a/setup/keyboard.c
+++ b/setup/keyboard.c
@@ -91,6 +91,7 @@
 int key_weapon8        = '8';
 
 int key_message_refresh = KEY_ENTER;
+int key_demo_quit      = 'q';
 
 int vanilla_keyboard_mapping = 1;
 
@@ -273,6 +274,7 @@
     AddKeyControl(table, "Decrease screen size",  &key_menu_decscreen);
 
     AddKeyControl(table, "Display last message",  &key_message_refresh);
+    AddKeyControl(table, "Finish recording demo", &key_demo_quit);
 
     TXT_AddWidgets(table, TXT_NewStrut(0, 1),
                           TXT_NewStrut(0, 1),
--- a/setup/keyboard.h
+++ b/setup/keyboard.h
@@ -91,6 +91,7 @@
 extern int key_weapon8;
 
 extern int key_message_refresh;
+extern int key_demo_quit;
 
 void ConfigKeyboard(void);
 
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -184,6 +184,7 @@
 int             key_weapon8 = '8';
 
 int             key_pause = KEY_PAUSE;
+int             key_demo_quit = 'q';
  
 int             mousebfire = 0;
 int             mousebstrafe = 1;
@@ -1846,7 +1847,7 @@
 { 
     byte *demo_start;
 
-    if (gamekeydown['q'])           // press q to end demo recording 
+    if (gamekeydown[key_demo_quit])           // press q to end demo recording 
 	G_CheckDemoStatus (); 
 
     demo_start = demo_p;
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -149,6 +149,7 @@
 extern int key_weapon8;
 
 extern int key_message_refresh;
+extern int key_demo_quit;
  
 extern int	mousebfire;
 extern int	mousebstrafe;
@@ -1041,6 +1042,12 @@
     //
 
     CONFIG_VARIABLE_KEY(key_message_refresh,       key_message_refresh),
+
+    //!
+    // Key to quit the game when recording a demo.
+    //
+
+    CONFIG_VARIABLE_KEY(key_demo_quit,             key_demo_quit),
 };
 
 static default_collection_t extra_defaults =