shithub: choc

Download patch

ref: 65a0cc9ce37cd383c59bf82579f60e5b2de75ee0
parent: 06f1f8bc7c92aca32bbbefea1cbf0e5732d8e828
author: Simon Howard <[email protected]>
date: Sat Jun 11 13:48:40 EDT 2016

setup: Use TXT_If() for main menu.

--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -216,41 +216,28 @@
     TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
 
     TXT_AddWidgets(window,
-          TXT_NewButton2("Configure Display",
-                         (TxtWidgetSignalFunc) ConfigDisplay, NULL),
-          TXT_NewButton2("Configure Sound",
-                         (TxtWidgetSignalFunc) ConfigSound, NULL),
-          TXT_NewButton2("Configure Keyboard",
-                         (TxtWidgetSignalFunc) ConfigKeyboard, NULL),
-          TXT_NewButton2("Configure Mouse",
-                         (TxtWidgetSignalFunc) ConfigMouse, NULL),
-          TXT_NewButton2("Configure Gamepad/Joystick",
-                         (TxtWidgetSignalFunc) ConfigJoystick, NULL),
-          NULL);
-
-    // The compatibility window is only appropriate for Doom/Strife.
-
-    if (gamemission == doom || gamemission == strife)
-    {
-        txt_button_t *button;
-
-        button = TXT_NewButton2("Compatibility", 
-                                (TxtWidgetSignalFunc) CompatibilitySettings,
-                                NULL);
-
-        TXT_AddWidget(window, button);
-    }
-
-    TXT_AddWidgets(window,
-          GetLaunchButton(),
-          TXT_NewStrut(0, 1),
-          TXT_NewButton2("Start a Network Game", 
-                         (TxtWidgetSignalFunc) StartMultiGame, NULL),
-          TXT_NewButton2("Join a Network Game", 
-                         (TxtWidgetSignalFunc) JoinMultiGame, NULL),
-          TXT_NewButton2("Multiplayer Configuration", 
-                         (TxtWidgetSignalFunc) MultiplayerConfig, NULL),
-          NULL);
+        TXT_NewButton2("Configure Display",
+                       (TxtWidgetSignalFunc) ConfigDisplay, NULL),
+        TXT_NewButton2("Configure Sound",
+                       (TxtWidgetSignalFunc) ConfigSound, NULL),
+        TXT_NewButton2("Configure Keyboard",
+                       (TxtWidgetSignalFunc) ConfigKeyboard, NULL),
+        TXT_NewButton2("Configure Mouse",
+                       (TxtWidgetSignalFunc) ConfigMouse, NULL),
+        TXT_NewButton2("Configure Gamepad/Joystick",
+                       (TxtWidgetSignalFunc) ConfigJoystick, NULL),
+        TXT_If(gamemission == doom || gamemission == strife,
+            TXT_NewButton2("Compatibility",
+                           (TxtWidgetSignalFunc) CompatibilitySettings, NULL)),
+        GetLaunchButton(),
+        TXT_NewStrut(0, 1),
+        TXT_NewButton2("Start a Network Game",
+                       (TxtWidgetSignalFunc) StartMultiGame, NULL),
+        TXT_NewButton2("Join a Network Game",
+                       (TxtWidgetSignalFunc) JoinMultiGame, NULL),
+        TXT_NewButton2("Multiplayer Configuration",
+                       (TxtWidgetSignalFunc) MultiplayerConfig, NULL),
+        NULL);
 
     quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit");
     warp_action = TXT_NewWindowAction(KEY_F2, "Warp");