foxygit / doom Log in
commit 880ce3aa3f7fd7f8d2345982603e8bfa8914fd4f
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Jun 1 18:06:15 2007 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Jun 1 18:06:15 2007 +0000

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

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 888
---
 setup/joystick.c | 14 ++++++++++++--
 setup/keyboard.c |  4 ++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/setup/joystick.c b/setup/joystick.c
index 435a864c..ce6a81ec 100644
--- a/setup/joystick.c
+++ b/setup/joystick.c
@@ -98,14 +98,24 @@ void ConfigJoystick(void)
     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();
 }

diff --git a/setup/keyboard.c b/setup/keyboard.c
index bb749d4d..e558840a 100644
--- a/setup/keyboard.c
+++ b/setup/keyboard.c
@@ -61,7 +61,7 @@ static void UpdateJoybSpeed(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(var))
     }
     else
     {
-       joybspeed = 0;
+        joybspeed = 0;
     }
 }

@@ -102,7 +102,7 @@ void ConfigKeyboard(void)
     txt_table_t *action_table;
     txt_checkbox_t *run_control;

-    always_run = joybspeed >= 10;
+    always_run = joybspeed >= 20;

     window = TXT_NewWindow("Keyboard configuration");