shithub: choc

Download patch

ref: 7b93759260950e88e5222c7d42cf0f57a869b306
parent: 42572cb925b9723cfa69ff37816de213d7d8a469
author: James Haley <haleyjd@hotmail.com>
date: Thu Sep 2 01:58:28 EDT 2010

Added Strife keys to configuration. Note that this *depends* on the
current behavior of Choco Doom in treating configuration variable
strings as case-sensitive, because these are the real values used by
Rogue in their config, and they differ from some Heretic/Hexen config
strings only by case.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2000

--- a/src/m_config.c
+++ b/src/m_config.c
@@ -186,6 +186,12 @@
     CONFIG_VARIABLE_KEY(key_straferight),
 
     //!
+    // Keyboard key to use health. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_useHealth),
+
+    //!
     // Keyboard key to jump.
     //
 
@@ -228,6 +234,42 @@
     CONFIG_VARIABLE_KEY(key_lookcenter),
 
     //!
+    // Keyboard key to query inventory. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invquery),
+
+    //!
+    // Keyboard key to display mission objective. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_mission),
+
+    //!
+    // Keyboard key to display inventory popup. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invPop),
+
+    //!
+    // Keyboard key to display keys popup. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invKey),
+
+    //!
+    // Keyboard key to jump to start of inventory. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invHome),
+
+    //!
+    // Keyboard key to jump to end of inventory. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invEnd),
+
+    //!
     // Keyboard key to scroll left in the inventory.
     //
 
@@ -240,6 +282,18 @@
     CONFIG_VARIABLE_KEY(key_invright),
 
     //!
+    // Keyboard key to scroll left in the inventory. (Strife)
+    //
+    
+    CONFIG_VARIABLE_KEY(key_invLeft),
+
+    //!
+    // Keyboard key to scroll right in the inventory. (Strife)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invRight),
+
+    //!
     // Keyboard key to use the current item in the inventory.
     //
 
@@ -246,6 +300,30 @@
     CONFIG_VARIABLE_KEY(key_useartifact),
 
     //!
+    // Keyboard key to use inventory item. (Strife)
+    //
+    
+    CONFIG_VARIABLE_KEY(key_invUse),
+
+    //!
+    // Keyboard key to drop an inventory item. (Strife only)
+    //
+
+    CONFIG_VARIABLE_KEY(key_invDrop),
+
+    //!
+    // Keyboard key to look up. (Strife)
+    //
+
+    CONFIG_VARIABLE_KEY(key_lookUp),
+
+    //!
+    // Keyboard key to look down. (Strife)
+    //
+
+    CONFIG_VARIABLE_KEY(key_lookDown),
+
+    //!
     // Keyboard key to fire the currently selected weapon.
     //
 
@@ -425,7 +503,13 @@
 
     CONFIG_VARIABLE_INT(messageson),
 
+    //!
+    // Name of background flat used by view border. (Strife only)
+    //
 
+    CONFIG_VARIABLE_STRING(back_flat),
+
+
     //!
     // Multiplayer chat macro: message to send when alt+0 is pressed.
     //
@@ -485,12 +569,6 @@
     //
 
     CONFIG_VARIABLE_STRING(chatmacro9),
-
-    //!
-    // Name of background flat used by view border. Strife only.
-    //
-
-    CONFIG_VARIABLE_STRING(back_flat),
 };
 
 static default_collection_t doom_defaults = 
--- a/src/m_controls.c
+++ b/src/m_controls.c
@@ -66,6 +66,26 @@
 int key_jump = '/';
 
 //
+// Strife key controls
+//
+// haleyjd 09/01/10
+//
+
+// Note: Strife also uses key_invleft, key_invright, key_jump, key_lookup, and
+// key_lookdown, but with different default values.
+
+int key_usehealth = 'h';
+int key_invquery  = 'q';
+int key_mission   = 'w';
+int key_invpop    = 'z';
+int key_invkey    = 'k';
+int key_invhome   = KEY_HOME;
+int key_invend    = KEY_END;
+int key_invuse    = KEY_ENTER;
+int key_invdrop   = KEY_BACKSPACE;
+
+
+//
 // Mouse controls
 //
 
@@ -94,7 +114,7 @@
 int key_weapon7 = '7';
 int key_weapon8 = '8';
 
-// Map cotnrols keys:
+// Map controls keys:
 
 int key_map_north     = KEY_UPARROW;
 int key_map_south     = KEY_DOWNARROW;
@@ -212,6 +232,38 @@
 void M_BindHexenControls(void)
 {
     M_BindVariable("key_jump",           &key_jump);
+    M_BindVariable("mouseb_jump",        &mousebjump);
+    M_BindVariable("joyb_jump",          &joybjump);
+}
+
+void M_BindStrifeControls(void)
+{
+    // These keys are shared with Heretic/Hexen but have different defaults:
+    key_jump     = 'a';
+    key_lookup   = KEY_PGUP;
+    key_lookdown = KEY_PGDN;
+    key_invleft  = KEY_INS;
+    key_invright = KEY_DEL;
+
+    M_BindVariable("key_jump",           &key_jump);
+    M_BindVariable("key_lookUp",         &key_lookup);
+    M_BindVariable("key_lookDown",       &key_lookdown);
+    M_BindVariable("key_invLeft",        &key_invleft);
+    M_BindVariable("key_invRight",       &key_invright);
+
+    // Custom Strife-only Keys:
+    M_BindVariable("key_useHealth",      &key_usehealth);
+    M_BindVariable("key_invquery",       &key_invquery);
+    M_BindVariable("key_mission",        &key_mission);
+    M_BindVariable("key_invPop",         &key_invpop);
+    M_BindVariable("key_invKey",         &key_invkey);
+    M_BindVariable("key_invHome",        &key_invhome);
+    M_BindVariable("key_invEnd",         &key_invend);
+    M_BindVariable("key_invUse",         &key_invuse);
+    M_BindVariable("key_invDrop",        &key_invdrop);
+
+    // Strife also supports jump on mouse and joystick, and in the exact same
+    // manner as Hexen!
     M_BindVariable("mouseb_jump",        &mousebjump);
     M_BindVariable("joyb_jump",          &joybjump);
 }
--- a/src/m_controls.h
+++ b/src/m_controls.h
@@ -140,6 +140,7 @@
 void M_BindBaseControls(void);
 void M_BindHereticControls(void);
 void M_BindHexenControls(void);
+void M_BindStrifeControls(void);
 void M_BindWeaponControls(void);
 void M_BindMapControls(void);
 void M_BindMenuControls(void);
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -383,6 +383,7 @@
     M_BindWeaponControls();
     M_BindMapControls();
     M_BindMenuControls();
+    M_BindStrifeControls(); // haleyjd 09/01/10: [STRIFE]
 
 #ifdef FEATURE_MULTIPLAYER
     NET_BindVariables();