shithub: choc

Download patch

ref: bef190087e4efaa75f07487accbbfac4a9ac9802
parent: 949c81d7f1d5868caa3ccd6a3f44aa86a179f34a
author: Archenoth <archenoth@gmail.com>
date: Tue Dec 14 10:14:33 EST 2021

Add ability to map mouse buttons to run!

That means that in "More controls" under the mouse setup, you can now
pick "Run" as a command you can set to a mouse button

--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -345,7 +345,8 @@
     speed = key_speed >= NUMKEYS
          || joybspeed >= MAX_JOY_BUTTONS
          || gamekeydown[key_speed] 
-         || joybuttons[joybspeed];
+         || joybuttons[joybspeed]
+         || mousebuttons[mousebspeed];
  
     forward = side = 0;
     
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -310,7 +310,8 @@
         || joybuttons[joybstrafe];
     speed = joybspeed >= MAX_JOY_BUTTONS
          || gamekeydown[key_speed]
-         || joybuttons[joybspeed];
+         || joybuttons[joybspeed]
+         || mousebuttons[mousebspeed];
 
     // haleyjd: removed externdriver crap
     
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -229,7 +229,8 @@
     speed = key_speed >= NUMKEYS
         || joybspeed >= MAX_JOY_BUTTONS
         || gamekeydown[key_speed]
-        || joybuttons[joybspeed];
+        || joybuttons[joybspeed]
+        || mousebuttons[mousebspeed];
 
     // haleyjd: removed externdriver crap
     
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -442,6 +442,13 @@
     CONFIG_VARIABLE_INT(mouseb_forward),
 
     //!
+    // Mouse button to turn on running.  When held down, the player
+    // will run while moving.
+    //
+
+    CONFIG_VARIABLE_INT(mouseb_speed),
+
+    //!
     // @game hexen strife
     //
     // Mouse button to jump.
--- a/src/m_controls.c
+++ b/src/m_controls.c
@@ -107,6 +107,7 @@
 int mousebfire = 0;
 int mousebstrafe = 1;
 int mousebforward = 2;
+int mousebspeed = 3;
 
 int mousebjump = -1;
 
@@ -233,6 +234,7 @@
     M_BindIntVariable("mouseb_fire",        &mousebfire);
     M_BindIntVariable("mouseb_strafe",      &mousebstrafe);
     M_BindIntVariable("mouseb_forward",     &mousebforward);
+    M_BindIntVariable("mouseb_speed",       &mousebspeed);
 
     M_BindIntVariable("joyb_fire",          &joybfire);
     M_BindIntVariable("joyb_strafe",        &joybstrafe);
--- a/src/m_controls.h
+++ b/src/m_controls.h
@@ -136,6 +136,7 @@
 extern int mousebfire;
 extern int mousebstrafe;
 extern int mousebforward;
+extern int mousebspeed;
 
 extern int mousebjump;
 
--- a/src/setup/mouse.c
+++ b/src/setup/mouse.c
@@ -47,6 +47,7 @@
     &mousebjump,
     &mousebprevweapon,
     &mousebnextweapon,
+    &mousebspeed,
     &mousebinvleft,
     &mousebinvright,
     &mousebturnleft,
@@ -106,6 +107,7 @@
     AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon);
     AddMouseControl(buttons_table, "Strafe on", &mousebstrafe);
     AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);
+    AddMouseControl(buttons_table, "Run on", &mousebspeed);
     
     if (gamemission == heretic)
     {
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -388,7 +388,8 @@
     speed = key_speed >= NUMKEYS
          || joybspeed >= MAX_JOY_BUTTONS
          || gamekeydown[key_speed] 
-         || joybuttons[joybspeed];
+         || joybuttons[joybspeed]
+         || mousebuttons[mousebspeed];
  
     forward = side = 0;