From ec72b141f47cd1a5b061f9bc87c1a02e2722be59 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 15 Apr 2015 20:52:23 -0400 Subject: setup: Remove "enable gamepad" checkbox. This control seemed redundant, as we have the control below it that selects the gamepad to use. So remove it and set the usejoystick variable automatically based on whether joystick_index has been configured to point to a valid device. --- src/setup/joystick.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/setup') diff --git a/src/setup/joystick.c b/src/setup/joystick.c index cad1a92f..22b1a089 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -568,7 +568,7 @@ static int OpenAllJoysticks(void) result = 0; - for (i=0; ijbutton.which; calibrate_button = event->jbutton.button; @@ -643,7 +644,6 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data) if (IsKnownJoystick(joystick_index)) { LoadKnownConfiguration(); - usejoystick = 1; TXT_CloseWindow(calibration_window); } else @@ -661,11 +661,12 @@ static int CalibrationEventCallback(SDL_Event *event, void *user_data) static void NoJoystick(void) { - TXT_MessageBox(NULL, "No joysticks or gamepads could be found.\n\n" + TXT_MessageBox(NULL, "No gamepads or joysticks could be found.\n\n" "Try configuring your controller from within\n" "your OS first. Maybe you need to install\n" "some drivers or otherwise configure it."); + usejoystick = 0; joystick_index = -1; SetJoystickButtonLabel(); } @@ -707,7 +708,7 @@ static void CalibrateJoystick(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) TXT_SignalConnect(calibration_window, "closed", CalibrateWindowClosed, NULL); // Start calibration - + usejoystick = 0; joystick_index = -1; } @@ -736,7 +737,6 @@ void ConfigJoystick(void) TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); TXT_AddWidgets(window, - TXT_NewCheckBox("Enable gamepad/joystick", &usejoystick), joystick_table = TXT_NewTable(2), TXT_NewSeparator("Axes"), axis_table = TXT_NewTable(2), @@ -744,6 +744,13 @@ void ConfigJoystick(void) button_table = TXT_NewTable(4), NULL); + TXT_SetColumnWidths(joystick_table, 13, 40); + + TXT_AddWidgets(joystick_table, + TXT_NewLabel("Controller"), + joystick_button = TXT_NewButton("zzzz"), + NULL); + TXT_SetColumnWidths(axis_table, 20, 15); TXT_AddWidgets(axis_table, @@ -761,13 +768,6 @@ void ConfigJoystick(void) JOYSTICK_AXIS_HORIZONTAL), NULL); - TXT_SetColumnWidths(joystick_table, 20, 15); - - TXT_AddWidgets(joystick_table, - TXT_NewLabel("Current controller"), - joystick_button = TXT_NewButton("zzzz"), - NULL); - TXT_SetColumnWidths(button_table, 16, 12, 14, 11); AddJoystickControl(button_table, "Fire/Attack", &joybfire); -- cgit v1.2.3