shithub: choc

Download patch

ref: 880ce3aa3f7fd7f8d2345982603e8bfa8914fd4f
parent: 7127f6c844ee24e3629f292a8301395111266a7e
author: Simon Howard <[email protected]>
date: Fri Jun 1 14:06:15 EDT 2007

Hide the joystick speed control when the always run hack is being used.

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

--- a/setup/joystick.c
+++ b/setup/joystick.c
@@ -98,13 +98,23 @@
     TXT_AddWidgets(button_table,
                    TXT_NewLabel("Fire"),
                    TXT_NewJoystickInput(&joybfire),
-                   TXT_NewLabel("Speed"),
-                   TXT_NewJoystickInput(&joybspeed),
                    TXT_NewLabel("Use"),
                    TXT_NewJoystickInput(&joybuse),
                    TXT_NewLabel("Strafe"),
                    TXT_NewJoystickInput(&joybstrafe),
                    NULL);
+
+    // High values of joybspeed are used to activate the "always run mode"
+    // trick in Vanilla Doom.  If this has been enabled, not only is the
+    // joybspeed value meaningless, but the control itself is useless.
+
+    if (joybspeed < 20)
+    {
+        TXT_AddWidgets(button_table,
+                       TXT_NewLabel("Speed"),
+                       TXT_NewJoystickInput(&joybspeed),
+                       NULL);
+    }
 
     SetJoystickButtonLabel();
 }
--- a/setup/keyboard.c
+++ b/setup/keyboard.c
@@ -61,7 +61,7 @@
     }
     else
     {
-       joybspeed = 0;
+        joybspeed = 0;
     }
 }
 
@@ -102,7 +102,7 @@
     txt_table_t *action_table;
     txt_checkbox_t *run_control;
 
-    always_run = joybspeed >= 10;
+    always_run = joybspeed >= 20;
 
     window = TXT_NewWindow("Keyboard configuration");