Exemplo n.º 1
0
void MainMenu(void)
{
    txt_window_t *window;
    txt_window_action_t *quit_action;
    txt_window_action_t *warp_action;

    window = TXT_NewWindow("Main Menu");

    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);

    quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit");
    warp_action = TXT_NewWindowAction(KEY_F2, "Warp");
    TXT_SignalConnect(quit_action, "pressed", QuitConfirm, NULL);
    TXT_SignalConnect(warp_action, "pressed",
                      (TxtWidgetSignalFunc) WarpMenu, NULL);
    TXT_SetWindowAction(window, TXT_HORIZ_LEFT, quit_action);
    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, warp_action);

    TXT_SetKeyListener(window, MainMenuKeyPress, NULL);
}
void StartMultiGame(void)
{
    txt_window_t *window;
    txt_table_t *gameopt_table;
    txt_table_t *advanced_table;
    txt_widget_t *iwad_selector;

    window = TXT_NewWindow("Start multiplayer game");

    TXT_AddWidgets(window, 
                   gameopt_table = TXT_NewTable(2),
                   TXT_NewSeparator("Monster options"),
                   TXT_NewInvertedCheckBox("Monsters enabled", &nomonsters),
                   TXT_NewCheckBox("Fast monsters", &fast),
                   TXT_NewCheckBox("Respawning monsters", &respawn),
                   TXT_NewSeparator("Advanced"),
                   advanced_table = TXT_NewTable(2),
                   TXT_NewButton2("Add extra parameters...", 
                                  OpenExtraParamsWindow, NULL),
                   NULL);

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
    TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction());
    
    TXT_SetColumnWidths(gameopt_table, 12, 12);

    TXT_AddWidgets(gameopt_table,
           TXT_NewLabel("Game"),
           iwad_selector = IWADSelector(),
           TXT_NewLabel("Skill"),
           skillbutton = TXT_NewDropdownList(&skill, skills, 5),
           TXT_NewLabel("Game type"),
           TXT_NewDropdownList(&deathmatch, gamemodes, 3),
           TXT_NewLabel("Level warp"),
           warpbutton = TXT_NewButton2("????", LevelSelectDialog, NULL),
           TXT_NewLabel("Time limit"),
           TXT_NewHorizBox(TXT_NewIntInputBox(&timer, 2),
                           TXT_NewLabel("minutes"),
                           NULL),
           NULL);

    TXT_SetColumnWidths(advanced_table, 12, 12);

    TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);

    TXT_AddWidgets(advanced_table, 
                   TXT_NewLabel("UDP port"),
                   TXT_NewIntInputBox(&udpport, 5),
                   NULL);

    UpdateWarpType(NULL, NULL);
    UpdateWarpButton();
}
Exemplo n.º 3
0
void JoinMultiGame(void)
{
    txt_window_t *window;
    txt_table_t *gameopt_table;
    txt_table_t *serveropt_table;
    txt_inputbox_t *address_box;

    window = TXT_NewWindow("Join multiplayer game");
    TXT_SetWindowHelpURL(window, MULTI_JOIN_HELP_URL);

    TXT_AddWidgets(window, 
        gameopt_table = TXT_NewTable(2),
        TXT_NewSeparator("Server"),
        serveropt_table = TXT_NewTable(1),
        TXT_NewStrut(0, 1),
        TXT_NewButton2("Add extra parameters...", OpenExtraParamsWindow, NULL),
        NULL);

    TXT_SetColumnWidths(gameopt_table, 12, 12);

    TXT_AddWidgets(gameopt_table,
                   TXT_NewLabel("Game"),
                   IWADSelector(),
                   NULL);

    if (gamemission == hexen)
    {
        TXT_AddWidgets(gameopt_table,
                       TXT_NewLabel("Character class "),
                       TXT_NewDropdownList(&character_class,
                                           character_classes, 3),
                       NULL);
    }

    TXT_AddWidgets(serveropt_table,
                   TXT_NewHorizBox(
                           TXT_NewLabel("Connect to address: "),
                           address_box = TXT_NewInputBox(&connect_address, 30),
                           NULL),
                   TXT_NewButton2("Find server on Internet...",
                                  FindInternetServer, NULL),
                   TXT_NewButton2("Find server on local network...",
                                  FindLANServer, NULL),
                   NULL);

    TXT_SelectWidget(window, address_box);

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
    TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, JoinGameAction());
}
Exemplo n.º 4
0
static void AddSectionLabel(txt_table_t *table, char *title, boolean add_space)
{
    char buf[64];

    if (add_space)
    {
        TXT_AddWidgets(table, TXT_NewStrut(0, 1), TXT_NewStrut(0, 1),
                              NULL);
    }

    M_snprintf(buf, sizeof(buf), " - %s - ", title);

    TXT_AddWidgets(table, TXT_NewLabel(buf),  TXT_NewStrut(0, 0),
                          NULL);
}
Exemplo n.º 5
0
void ScrollingMenu(void)
{
    txt_window_t *window;
    txt_button_t *button;
    txt_table_t *table;

    window = TXT_NewWindow("Scrollable menu");

    table = TXT_NewTable(1);

    TXT_AddWidgets(table,
                   TXT_NewButton("Configure display"),
                   TXT_NewButton("Configure joystick"),
                   TXT_NewButton("Configure keyboard"),
                   TXT_NewButton("Configure mouse"),
                   TXT_NewButton("Configure sound"),
                   TXT_NewStrut(0, 1),
                   button = TXT_NewButton("Save Parameters and launch DOOM"),
                   TXT_NewStrut(0, 1),
                   TXT_NewButton("Start a network game"),
                   TXT_NewButton("Join a network game"),
                   TXT_NewButton("Multiplayer configuration"),
                   NULL);

    TXT_SignalConnect(button, "pressed", PwnBox, NULL);

    TXT_AddWidget(window, TXT_NewScrollPane(0, 6, table));
}
Exemplo n.º 6
0
static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
                                  TXT_UNCAST_ARG(modes_table))
{
    TXT_CAST_ARG(txt_table_t, modes_table);
    txt_window_t *window;
    txt_checkbox_t *ar_checkbox;

    window = TXT_NewWindow("Advanced display options");

    TXT_SetColumnWidths(window, 35);

    TXT_AddWidgets(window,
                   ar_checkbox = TXT_NewCheckBox("Fix aspect ratio",
                                                 &aspect_ratio_correct),
                   NULL);

    if (gamemission == heretic || gamemission == hexen || gamemission == strife)
    {
        TXT_AddWidget(window,
                      TXT_NewCheckBox("Graphical startup", &graphical_startup));
    }

    if (gamemission == doom || gamemission == heretic || gamemission == strife)
    {
        TXT_AddWidget(window,
                      TXT_NewCheckBox("Show ENDOOM screen on exit",
                                      &show_endoom));
    }

    TXT_SignalConnect(ar_checkbox, "changed", GenerateModesTable, modes_table);
}
Exemplo n.º 7
0
static void QuitConfirm(void *unused1, void *unused2)
{
    txt_window_t *window;
    txt_label_t *label;
    txt_button_t *yes_button;
    txt_button_t *no_button;

    window = TXT_NewWindow(NULL);

    TXT_AddWidgets(window, 
                   label = TXT_NewLabel("Exiting setup.\nSave settings?"),
                   TXT_NewStrut(24, 0),
                   yes_button = TXT_NewButton2("  Yes  ", DoQuit, DoQuit),
                   no_button = TXT_NewButton2("  No   ", DoQuit, NULL),
                   NULL);

    TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER);
    TXT_SetWidgetAlign(yes_button, TXT_HORIZ_CENTER);
    TXT_SetWidgetAlign(no_button, TXT_HORIZ_CENTER);

    // Only an "abort" button in the middle.
    TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, 
                        TXT_NewWindowAbortAction(window));
    TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
}
Exemplo n.º 8
0
static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
                                  TXT_UNCAST_ARG(sizes_table))
{
    TXT_CAST_ARG(txt_table_t, sizes_table);
    txt_window_t *window;
    txt_checkbox_t *ar_checkbox;

    window = TXT_NewWindow("Advanced display options");

    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

    TXT_SetColumnWidths(window, 40);

    TXT_AddWidgets(window,
        ar_checkbox = TXT_NewCheckBox("Force correct aspect ratio",
                                      &aspect_ratio_correct),
        TXT_If(gamemission == heretic || gamemission == hexen
            || gamemission == strife,
            TXT_NewCheckBox("Graphical startup", &graphical_startup)),
        TXT_If(gamemission == doom || gamemission == heretic
            || gamemission == strife,
            TXT_NewCheckBox("Show ENDOOM screen on exit",
                            &show_endoom)),
#ifdef HAVE_LIBPNG
        TXT_NewCheckBox("Save screenshots in PNG format",
                        &png_screenshots),
#endif
        NULL);

    TXT_SignalConnect(ar_checkbox, "changed", GenerateSizesTable, sizes_table);
}
Exemplo n.º 9
0
static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
{
    txt_window_t *window;
    txt_table_t *buttons_table;

    window = TXT_NewWindow("Additional mouse buttons");

    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

    TXT_AddWidgets(window,
                   buttons_table = TXT_NewTable(2),
                   NULL);

    TXT_SetColumnWidths(buttons_table, 24, 5);

    AddMouseControl(buttons_table, "Move backward", &mousebbackward);
    AddMouseControl(buttons_table, "Use", &mousebuse);
    AddMouseControl(buttons_table, "Strafe left", &mousebstrafeleft);
    AddMouseControl(buttons_table, "Strafe right", &mousebstraferight);

    if (gamemission == hexen || gamemission == strife)
    {
        AddMouseControl(buttons_table, "Jump", &mousebjump);
    }

    AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon);
    AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);
}
Exemplo n.º 10
0
static void CalibrateJoystick(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
{
    // Try to open all available joysticks.  If none are opened successfully,
    // bomb out with an error.

    if (!OpenAllJoysticks())
    {
        NoJoystick();
        return;
    }

    calibration_window = TXT_NewWindow("Gamepad/Joystick calibration");

    TXT_AddWidgets(calibration_window,
                   TXT_NewStrut(0, 1),
                   TXT_NewLabel("Center the D-pad or joystick,\n"
                                "and press a button."),
                   TXT_NewStrut(0, 1),
                   NULL);

    TXT_SetWindowAction(calibration_window, TXT_HORIZ_LEFT, NULL);
    TXT_SetWindowAction(calibration_window, TXT_HORIZ_CENTER, 
                        TXT_NewWindowAbortAction(calibration_window));
    TXT_SetWindowAction(calibration_window, TXT_HORIZ_RIGHT, NULL);

    TXT_SDL_SetEventCallback(CalibrationEventCallback, NULL);

    TXT_SignalConnect(calibration_window, "closed", CalibrateWindowClosed, NULL);

    // Start calibration

    joystick_index = -1;
}
Exemplo n.º 11
0
void TXT_ConfigureJoystickAxis(txt_joystick_axis_t *joystick_axis,
                               int using_button,
                               txt_joystick_axis_callback_t callback)
{
    // Open the joystick first.
    if (SDL_Init(SDL_INIT_JOYSTICK) < 0)
    {
        return;
    }

    joystick_axis->joystick = SDL_JoystickOpen(joystick_index);
    if (joystick_axis->joystick == NULL)
    {
        TXT_MessageBox(NULL, "Please configure a controller first!");
        return;
    }

    SDL_JoystickEventState(SDL_ENABLE);

    // Build the prompt window.

    joystick_axis->config_window
        = TXT_NewWindow("Gamepad/Joystick calibration");
    TXT_AddWidgets(joystick_axis->config_window,
                   TXT_NewStrut(0, 1),
                   joystick_axis->config_label = TXT_NewLabel(""),
                   TXT_NewStrut(0, 1),
                   NULL);

    TXT_SetWindowAction(joystick_axis->config_window, TXT_HORIZ_LEFT, NULL);
    TXT_SetWindowAction(joystick_axis->config_window, TXT_HORIZ_CENTER,
                        TXT_NewWindowAbortAction(joystick_axis->config_window));
    TXT_SetWindowAction(joystick_axis->config_window, TXT_HORIZ_RIGHT, NULL);
    TXT_SetWidgetAlign(joystick_axis->config_window, TXT_HORIZ_CENTER);

    if (using_button >= 0)
    {
        joystick_axis->config_stage = CONFIG_STAGE1;
        joystick_axis->config_button = using_button;
        IdentifyBadAxes(joystick_axis);
    }
    else
    {
        joystick_axis->config_stage = CONFIG_CENTER;
    }

    SetCalibrationLabel(joystick_axis);

    // Close the joystick and shut down joystick subsystem when the window
    // is closed.
    TXT_SignalConnect(joystick_axis->config_window, "closed",
                      CalibrateWindowClosed, joystick_axis);

    TXT_SDL_SetEventCallback(EventCallback, joystick_axis);

    // When successfully calibrated, invoke this callback:
    joystick_axis->callback = callback;
}
Exemplo n.º 12
0
void CompatibilitySettings(void)
{
    txt_window_t *window;

    if (gamemission == doom)
    {
    window = TXT_NewWindow("Crispness");

    TXT_AddWidgets(window,
                   TXT_NewCheckBox("Enable translucency",
                                   &crispy_translucency),
                   TXT_NewCheckBox("Show colored numbers in status bar",
                                   &crispy_coloredhud),
                   TXT_NewCheckBox("Show level stats in automap",
                                   &crispy_automapstats),
                   TXT_NewCheckBox("Show \"secret revealed\" message",
                                   &crispy_secretmessage),
                   TXT_NewCheckBox("Show laser pointer",
                                   &crispy_crosshair),
                   TXT_NewCheckBox("Enable jumping [*]",
                                   &crispy_jump),
                   TXT_NewCheckBox("Enable free look [*]",
                                   &crispy_freelook),
                   TXT_NewCheckBox("Enable permanent mouse look",
                                   &crispy_mouselook),
                   TXT_NewCheckBox("Enable vertical aiming",
                                   &crispy_freeaim),
                   TXT_NewCheckBox("Players may walk over/under monsters",
                                   &crispy_overunder),
                   TXT_NewCheckBox("Enable weapon recoil",
                                   &crispy_recoil),
                   NULL);
    }
    else
    {
    window = TXT_NewWindow("Compatibility");

    TXT_AddWidgets(window, 
                   TXT_NewCheckBox("Vanilla savegame limit",
                                   &vanilla_savegame_limit),
                   TXT_NewCheckBox("Vanilla demo limit",
                                   &vanilla_demo_limit),
                   NULL);
    }
}
Exemplo n.º 13
0
static void AdvancedDisplayConfig(TXT_UNCAST_ARG(widget),
                                  TXT_UNCAST_ARG(modes_table))
{
    TXT_CAST_ARG(txt_table_t, modes_table);
    txt_window_t *window;
    txt_checkbox_t *ar_checkbox;

    window = TXT_NewWindow("Advanced display options");

    TXT_SetColumnWidths(window, 35);

    TXT_AddWidgets(window,
                   ar_checkbox = TXT_NewCheckBox("Fix aspect ratio",
                                                 &aspect_ratio_correct),
                   TXT_NewCheckBox("Show ENDOOM screen on exit", &show_endoom),
                   NULL);

    TXT_SignalConnect(ar_checkbox, "changed", GenerateModesTable, modes_table);

    // On Windows, there is an extra control to change between 
    // the Windows GDI and DirectX video drivers.

#if defined(_WIN32) && !defined(_WIN32_WCE)
    {
        txt_radiobutton_t *dx_button, *gdi_button;

        TXT_AddWidgets(window,
                       TXT_NewSeparator("Windows video driver"),
                       dx_button = TXT_NewRadioButton("DirectX",
                                                      &use_directx, 1),
                       gdi_button = TXT_NewRadioButton("Windows GDI",
                                                       &use_directx, 0),
                       NULL);

        TXT_SignalConnect(dx_button, "selected",
                          UpdateVideoDriver, modes_table);
        TXT_SignalConnect(gdi_button, "selected",
                          UpdateVideoDriver, modes_table);
        SetWin32VideoDriver();
    }
#endif
}
Exemplo n.º 14
0
static void UpdateExtraTable(TXT_UNCAST_ARG(widget),
                             TXT_UNCAST_ARG(extra_table))
{
    TXT_CAST_ARG(txt_table_t, extra_table);

    TXT_ClearTable(extra_table);

    switch (snd_musicmode)
    {
        case MUSICMODE_OPL:
            TXT_AddWidgets(extra_table,
                           TXT_NewLabel("OPL type"),
                           OPLTypeSelector(),
                           NULL);
            break;

        case MUSICMODE_GUS:
            TXT_AddWidgets(extra_table,
                           TXT_NewLabel("GUS patch path:"),
                           TXT_TABLE_OVERFLOW_RIGHT,
                           TXT_NewFileSelector(&gus_patch_path, 34,
                                               "Select path to GUS patches",
                                               TXT_DIRECTORY),
                           TXT_TABLE_OVERFLOW_RIGHT,
                           NULL);
            break;

        case MUSICMODE_NATIVE:
            TXT_AddWidgets(extra_table,
                           TXT_NewLabel("Timidity configuration file:"),
                           TXT_TABLE_OVERFLOW_RIGHT,
                           TXT_NewFileSelector(&timidity_cfg_path, 34,
                                               "Select Timidity config file",
                                               cfg_extension),
                           TXT_TABLE_OVERFLOW_RIGHT,
                           NULL);
            break;

        default:
            break;
    }
}
Exemplo n.º 15
0
void CompatibilitySettings(void)
{
    txt_window_t *window;

    window = TXT_NewWindow("Compatibility");

    TXT_AddWidgets(window, 
                   TXT_NewCheckBox("Vanilla savegame limit",
                                   &vanilla_savegame_limit),
                   TXT_NewCheckBox("Vanilla demo limit",
                                   &vanilla_demo_limit),
                   NULL);
}
void JoinMultiGame(void)
{
    txt_window_t *window;
    txt_table_t *gameopt_table;
    txt_table_t *serveropt_table;
    txt_inputbox_t *address_box;

    window = TXT_NewWindow("Join multiplayer game");

    TXT_AddWidgets(window, 
        gameopt_table = TXT_NewTable(2),
        TXT_NewSeparator("Server"),
        serveropt_table = TXT_NewTable(2),
        TXT_NewStrut(0, 1),
        TXT_NewButton2("Add extra parameters...", OpenExtraParamsWindow, NULL),
        NULL);

    TXT_SetColumnWidths(gameopt_table, 12, 12);

    TXT_AddWidgets(gameopt_table,
                   TXT_NewLabel("Game"),
                   IWADSelector(),
                   NULL);

    TXT_AddWidgets(serveropt_table,
                   TXT_NewRadioButton("Connect to address:",
                                      &jointype, JOIN_ADDRESS),
                   address_box = TXT_NewInputBox(&connect_address, 30),
                   TXT_NewRadioButton("Auto-join LAN game",
                                      &jointype, JOIN_AUTO_LAN),
                   NULL);

    TXT_SignalConnect(address_box, "changed", SelectAddressJoin, NULL);
    TXT_SelectWidget(window, address_box);

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
    TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, JoinGameAction());
}
Exemplo n.º 17
0
void MultiplayerConfig(TXT_UNCAST_ARG(widget), void *user_data)
{
    txt_window_t *window;
    txt_label_t *label;
    txt_table_t *table;
    char buf[10];
    int i;

    window = TXT_NewWindow("Multiplayer Configuration");
    TXT_SetWindowHelpURL(window, MULTI_CONFIG_HELP_URL);

    TXT_AddWidgets(window,
                   TXT_NewStrut(0, 1),
                   TXT_NewHorizBox(TXT_NewLabel("Player name:  "),
                                   TXT_NewInputBox(&net_player_name, 25),
                                   NULL),
                   TXT_NewStrut(0, 1),
                   TXT_NewSeparator("Chat macros"),
                   NULL);

    table = TXT_NewTable(2);

    for (i=0; i<10; ++i)
    {
        M_snprintf(buf, sizeof(buf), "#%i ", i + 1);

        label = TXT_NewLabel(buf);
        TXT_SetFGColor(label, TXT_COLOR_BRIGHT_CYAN);

        TXT_AddWidgets(table,
                       label,
                       TXT_NewInputBox(&chat_macros[(i + 1) % 10], 40),
                       NULL);
    }

    TXT_AddWidget(window, table);
}
void MultiplayerConfig(void)
{
    txt_window_t *window;
    txt_label_t *label;
    txt_table_t *table;
    char buf[10];
    int i;

    window = TXT_NewWindow("Multiplayer Configuration");

    TXT_AddWidgets(window, 
                   TXT_NewStrut(0, 1),
                   TXT_NewHorizBox(TXT_NewLabel("Player name:  "),
                                   TXT_NewInputBox(&net_player_name, 25),
                                   NULL),
                   TXT_NewStrut(0, 1),
                   TXT_NewSeparator("Chat macros"),
                   NULL);

    table = TXT_NewTable(2);

    for (i=0; i<10; ++i)
    {
        sprintf(buf, "#%i ", i + 1);

        label = TXT_NewLabel(buf);
        TXT_SetFGColor(label, TXT_COLOR_BRIGHT_CYAN);

        TXT_AddWidgets(table,
                       label,
                       TXT_NewInputBox(&chat_macros[(i + 1) % 10], 40),
                       NULL);
    }
    
    TXT_AddWidget(window, table);
}
Exemplo n.º 19
0
void Window2(void)
{
    txt_window_t *window;
    txt_table_t *table;
    txt_table_t *unselectable_table;
    txt_scrollpane_t *scrollpane;

    window = TXT_NewWindow("Another test");
    TXT_SetWindowPosition(window, 
                          TXT_HORIZ_RIGHT, 
                          TXT_VERT_TOP, 
                          TXT_SCREEN_W - 1, 1);

    TXT_AddWidgets(window,
                   TXT_NewScrollPane(40, 1,
                        TXT_NewLabel("* Unselectable scroll pane *")),
                   unselectable_table = TXT_NewTable(1),
                   NULL);

    TXT_AddWidget(unselectable_table, TXT_NewLabel("* Unselectable table *"));

    TXT_AddWidget(window, TXT_NewSeparator("Input boxes"));
    table = TXT_NewTable(2);
    TXT_AddWidget(window, table);
    TXT_AddWidget(table, TXT_NewLabel("String: "));
    TXT_AddWidget(table, TXT_NewInputBox(&textbox_value, 20));
    TXT_AddWidget(table, TXT_NewLabel("Int: "));
    TXT_AddWidget(table, TXT_NewIntInputBox(&numbox_value, 10));
    TXT_AddWidget(table, TXT_NewLabel("Spin control:"));
    TXT_AddWidget(table, TXT_NewSpinControl(&numbox_value, 0, 15));

    TXT_AddWidget(window, TXT_NewSeparator("Scroll pane test"));
    scrollpane = TXT_NewScrollPane(40, 5, TXT_NewLabel(
        "This is a scrollable pane. The contents\n"
        "of this box are larger than the box\n"
        "itself, but it can be scrolled around\n"
        "to explore the full contents.\n"
        "\n"
        "Scrollable panes can be scrolled both\n"
        "vertically and horizontally. They\n"
        "can contain any widget. The scroll bars\n"
        "appear automatically as needed.\n"
        "\n"
        "This is a very long line of text that forces a horizontal scrollbar"
    ));
    TXT_AddWidget(window, scrollpane);
}
Exemplo n.º 20
0
static void QueryResponseCallback(net_addr_t *addr,
                                  net_querydata_t *querydata,
                                  unsigned int ping_time,
                                  TXT_UNCAST_ARG(results_table))
{
    TXT_CAST_ARG(txt_table_t, results_table);
    char ping_time_str[16];
    char description[47];

    // When we connect we'll have to negotiate a common protocol that we
    // can agree upon between the client and server. If we can't then we
    // won't be able to connect, so it's pointless to include it in the
    // results list. If protocol==NET_PROTOCOL_UNKNOWN then this may be
    // an old, pre-3.0 Chocolate Doom server that doesn't support the new
    // protocol negotiation mechanism, or it may be an incompatible fork.
    if (querydata->protocol == NET_PROTOCOL_UNKNOWN)
    {
        return;
    }

    M_snprintf(ping_time_str, sizeof(ping_time_str), "%ims", ping_time);

    // Build description from server name field. Because there is limited
    // space, we only include the player count if there are already players
    // connected to the server.
    if (querydata->num_players > 0)
    {
        M_snprintf(description, sizeof(description), "(%d/%d) ",
                   querydata->num_players, querydata->max_players);
    }
    else
    {
        M_StringCopy(description, "", sizeof(description));
    }

    M_StringConcat(description, querydata->description, sizeof(description));

    TXT_AddWidgets(results_table,
                   TXT_NewLabel(ping_time_str),
                   TXT_NewButton2(NET_AddrToString(addr),
                                  SelectQueryAddress, querydata),
                   TXT_NewLabel(description),
                   NULL);

    ++query_servers_found;
}
Exemplo n.º 21
0
static void QueryPeriodicCallback(TXT_UNCAST_ARG(results_table))
{
    TXT_CAST_ARG(txt_table_t, results_table);

    if (!NET_Query_Poll(QueryResponseCallback, results_table))
    {
        TXT_SetPeriodicCallback(NULL, NULL, 0);

        if (query_servers_found == 0)
        {
            TXT_AddWidgets(results_table,
                TXT_TABLE_EMPTY,
                TXT_NewLabel("No compatible servers found."),
                NULL
            );
        }
    }
}
Exemplo n.º 22
0
void ConfigMouse(void)
{
    txt_window_t *window;

    window = TXT_NewWindow("Mouse configuration");

    TXT_SetTableColumns(window, 2);

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, TestConfigAction());
    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

    TXT_AddWidgets(window,
                   TXT_NewCheckBox("Enable mouse", &usemouse),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   TXT_NewInvertedCheckBox("Allow vertical mouse movement", 
                                           &novert),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   TXT_NewCheckBox("Grab mouse in windowed mode", 
                                   &grabmouse),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   TXT_NewCheckBox("Double click acts as \"use\"",
                                   &dclick_use),
                   TXT_TABLE_OVERFLOW_RIGHT,

                   TXT_NewSeparator("Mouse motion"),
                   TXT_NewLabel("Speed"),
                   TXT_NewSpinControl(&mouseSensitivity, 1, 256),
                   TXT_NewLabel("Acceleration"),
                   TXT_NewFloatSpinControl(&mouse_acceleration, 1.0, 5.0),
                   TXT_NewLabel("Acceleration threshold"),
                   TXT_NewSpinControl(&mouse_threshold, 0, 32),

                   TXT_NewSeparator("Buttons"),
                   NULL);

    AddMouseControl(window, "Fire/Attack", &mousebfire);
    AddMouseControl(window, "Move forward", &mousebforward);
    AddMouseControl(window, "Strafe on", &mousebstrafe);

    TXT_AddWidget(window,
                  TXT_NewButton2("More controls...", ConfigExtraButtons, NULL));
}
Exemplo n.º 23
0
static void CalibrateJoystick(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
{
    calibrate_stage = CALIBRATE_CENTER;

    // Try to open all available joysticks.  If none are opened successfully,
    // bomb out with an error.

    if (!OpenAllJoysticks())
    {
        NoJoystick();
        return;
    }

    calibration_window = TXT_NewWindow("Gamepad/Joystick calibration");

    TXT_AddWidgets(calibration_window,
                   TXT_NewLabel("Please follow the following instructions\n"
                                "in order to calibrate your controller."),
                   TXT_NewStrut(0, 1),
                   calibration_label = TXT_NewLabel("zzz"),
                   TXT_NewStrut(0, 1),
                   NULL);

    TXT_SetWindowAction(calibration_window, TXT_HORIZ_LEFT, NULL);
    TXT_SetWindowAction(calibration_window, TXT_HORIZ_CENTER, 
                        TXT_NewWindowAbortAction(calibration_window));
    TXT_SetWindowAction(calibration_window, TXT_HORIZ_RIGHT, NULL);

    TXT_SetWidgetAlign(calibration_label, TXT_HORIZ_CENTER);
    TXT_SDL_SetEventCallback(CalibrationEventCallback, NULL);

    TXT_SignalConnect(calibration_window, "closed", CalibrateWindowClosed, NULL);

    // Start calibration

    joystick_index = -1;
    calibrate_stage = CALIBRATE_CENTER;

    SetCalibrationLabel();
}
Exemplo n.º 24
0
static void QueryResponseCallback(net_addr_t *addr,
                                  net_querydata_t *querydata,
                                  unsigned int ping_time,
                                  TXT_UNCAST_ARG(results_table))
{
    TXT_CAST_ARG(txt_table_t, results_table);
    char ping_time_str[16];
    char description[47];

    M_snprintf(ping_time_str, sizeof(ping_time_str), "%ims", ping_time);
    M_StringCopy(description, querydata->description,
                 sizeof(description));

    TXT_AddWidgets(results_table,
                   TXT_NewLabel(ping_time_str),
                   TXT_NewButton2(NET_AddrToString(addr),
                                  SelectQueryAddress, querydata),
                   TXT_NewLabel(description),
                   NULL);

    ++query_servers_found;
}
Exemplo n.º 25
0
void ConfigDisplay(TXT_UNCAST_ARG(widget), void *user_data)
{
    txt_window_t *window;
    txt_table_t *sizes_table;
    txt_window_action_t *advanced_button;

    // Open the window
    window = TXT_NewWindow("Display Configuration");
    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

    // Build window:
    TXT_AddWidgets(window,
        TXT_NewCheckBox("Full screen", &fullscreen),
        TXT_NewConditional(&fullscreen, 0,
            sizes_table = TXT_NewTable(3)),
        NULL);

    TXT_SetColumnWidths(window, 42);

    // The window is set at a fixed vertical position.  This keeps
    // the top of the window stationary when switching between
    // fullscreen and windowed mode (which causes the window's
    // height to change).
    TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
                                  TXT_SCREEN_W / 2, 6);

    GenerateSizesTable(NULL, sizes_table);

    // Button to open "advanced" window.
    // Need to pass a pointer to the window sizes table, as some of the options
    // in there trigger a rebuild of it.
    advanced_button = TXT_NewWindowAction('a', "Advanced");
    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, advanced_button);
    TXT_SignalConnect(advanced_button, "pressed",
                      AdvancedDisplayConfig, sizes_table);
}
Exemplo n.º 26
0
void ConfigKeyboard(void)
{
    txt_window_t *window;
    txt_table_t *movement_table;
    txt_table_t *action_table;
    txt_table_t *dialogs_table;
    txt_checkbox_t *run_control;

    always_run = joybspeed >= 20;

    window = TXT_NewWindow("Keyboard configuration");

    TXT_AddWidgets(window,
                   TXT_NewSeparator("Movement"),
                   movement_table = TXT_NewTable(4),

                   TXT_NewSeparator("Action"),
                   action_table = TXT_NewTable(4),
                   dialogs_table = TXT_NewTable(2),

                   TXT_NewSeparator("Misc."),
                   run_control = TXT_NewCheckBox("Always run", &always_run),
                   TXT_NewInvertedCheckBox("Use native keyboard mapping", 
                                           &vanilla_keyboard_mapping),
                   NULL);

    TXT_SetColumnWidths(movement_table, 15, 8, 15, 8);

    TXT_SignalConnect(run_control, "changed", UpdateJoybSpeed, NULL);

    AddKeyControl(movement_table, "Move Forward", &key_up);
    AddKeyControl(movement_table, " Strafe Left", &key_strafeleft);
    AddKeyControl(movement_table, "Move Backward", &key_down);
    AddKeyControl(movement_table, " Strafe Right", &key_straferight);
    AddKeyControl(movement_table, "Turn Left", &key_left);
    AddKeyControl(movement_table, " Speed On", &key_speed);
    AddKeyControl(movement_table, "Turn Right", &key_right);
    AddKeyControl(movement_table, " Strafe On", &key_strafe);

    if (gamemission == hexen || gamemission == strife)
    {
        AddKeyControl(movement_table, "Jump", &key_jump);
    }

    TXT_SetColumnWidths(action_table, 15, 8, 15, 8);

    AddKeyControl(action_table, "Fire/Attack", &key_fire);
    AddKeyControl(action_table, " Use", &key_use);

    // Other key bindings are stored in separate sub-dialogs:

    TXT_SetColumnWidths(dialogs_table, 24, 24);

    TXT_AddWidgets(dialogs_table,
                   TXT_NewButton2("More controls...", ConfigExtraKeys, NULL),
                   TXT_NewButton2("Other keys...", OtherKeysDialog, NULL),
                   NULL);

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, TestConfigAction());

}
Exemplo n.º 27
0
void ConfigSound(void)
{
    txt_window_t *window;
    txt_table_t *extra_table;
    txt_dropdown_list_t *sfx_mode_control;
    txt_dropdown_list_t *music_mode_control;
    int num_sfx_modes, num_music_modes;

    // Work out what sfx mode we are currently using:

    if (snd_sfxdevice == SNDDEVICE_PCSPEAKER)
    {
        snd_sfxmode = SFXMODE_PCSPEAKER;
    }
    else if (snd_sfxdevice >= SNDDEVICE_SB)
    {
        snd_sfxmode = SFXMODE_DIGITAL;
    }
    else
    {
        snd_sfxmode = SFXMODE_DISABLED;
    }

    // Is music enabled?

    switch (snd_musicdevice)
    {
        case SNDDEVICE_GENMIDI:
            snd_musicmode = MUSICMODE_NATIVE;
            break;
        case SNDDEVICE_CD:
            snd_musicmode = MUSICMODE_CD;
            break;
        case SNDDEVICE_SB:
        case SNDDEVICE_ADLIB:
        case SNDDEVICE_AWE32:
            snd_musicmode = MUSICMODE_OPL;
            break;
        case SNDDEVICE_GUS:
            snd_musicmode = MUSICMODE_GUS;
            break;
        default:
            snd_musicmode = MUSICMODE_DISABLED;
            break;
    }

    // Doom has PC speaker sound effects, but others do not:

    if (gamemission == doom)
    {
        num_sfx_modes = NUM_SFXMODES;
    }
    else
    {
        num_sfx_modes = NUM_SFXMODES - 1;
    }

    // Hexen has CD audio; others do not.

    if (gamemission == hexen)
    {
        num_music_modes = NUM_MUSICMODES;
    }
    else
    {
        num_music_modes = NUM_MUSICMODES - 1;
    }

    // Build the window

    window = TXT_NewWindow("Sound configuration");
    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);
    TXT_SetTableColumns(window, 2);
    TXT_SetColumnWidths(window, 19, 15);

    TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
                                  TXT_SCREEN_W / 2, 5);

    TXT_AddWidgets(window,
                   TXT_NewSeparator("Sound effects"),
                   TXT_NewLabel("Sound effects"),
                   sfx_mode_control = TXT_NewDropdownList(&snd_sfxmode,
                                                          sfxmode_strings,
                                                          num_sfx_modes),
                   TXT_NewLabel("Sound channels"),
                   TXT_NewSpinControl(&numChannels, 1, 8),
                   TXT_NewLabel("SFX volume"),
                   TXT_NewSpinControl(&sfxVolume, 0, 15),
                   NULL);

    // Only show for games that implemented pitch shifting:
    if (gamemission == doom || gamemission == heretic || gamemission == hexen)
    {
        TXT_AddWidgets(window,
                       TXT_NewCheckBox("Pitch-shifted sounds",
                                       &snd_pitchshift),
                       TXT_TABLE_OVERFLOW_RIGHT,
                       NULL);
    }

    if (gamemission == strife)
    {
        TXT_AddWidgets(window,
                       TXT_NewLabel("Voice volume"),
                       TXT_NewSpinControl(&voiceVolume, 0, 15),
                       TXT_NewCheckBox("Show text with voices", &show_talk),
                       TXT_TABLE_OVERFLOW_RIGHT,
                       NULL);
    }

    TXT_AddWidgets(window,
                   TXT_NewSeparator("Music"),
                   TXT_NewLabel("Music"),
                   music_mode_control = TXT_NewDropdownList(&snd_musicmode,
                                                            musicmode_strings,
                                                            num_music_modes),
                   TXT_NewLabel("Music volume"),
                   TXT_NewSpinControl(&musicVolume, 0, 15),
                   extra_table = TXT_NewTable(2),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   NULL);

    TXT_SetColumnWidths(extra_table, 19, 15);

    TXT_SignalConnect(sfx_mode_control, "changed", UpdateSndDevices, NULL);
    TXT_SignalConnect(music_mode_control, "changed", UpdateSndDevices, NULL);

    // Update extra_table when the music mode is changed, and build it now.
    TXT_SignalConnect(music_mode_control, "changed",
                      UpdateExtraTable, extra_table);
    UpdateExtraTable(music_mode_control, extra_table);
}
Exemplo n.º 28
0
void ConfigDisplay(void)
{
    txt_window_t *window;
    txt_table_t *modes_table;
    txt_separator_t *modes_separator;
    txt_table_t *bpp_table;
    txt_window_action_t *advanced_button;
    txt_checkbox_t *fs_checkbox;
    int i;
    int num_columns;
    int num_rows;
    int window_y;

    // What color depths are supported?  Generate supported_bpps array
    // and set selected_bpp to match the current value of screen_bpp.

    IdentifyPixelDepths();
    SetSelectedBPP();

    // First time in? Initialise selected_screen_{width,height}

    if (selected_screen_width == 0)
    {
        selected_screen_width = screen_width;
        selected_screen_height = screen_height;
    }

    // Open the window

    window = TXT_NewWindow("Display Configuration");

    // Some machines can have lots of video modes.  This tries to
    // keep a limit of six lines by increasing the number of
    // columns.  In extreme cases, the window is moved up slightly.

    BuildFullscreenModesList();

    if (num_screen_modes_fullscreen <= 24)
    {
        num_columns = 3;
    }
    else if (num_screen_modes_fullscreen <= 40)
    {
        num_columns = 4;
    }
    else
    {
        num_columns = 5;
    }

    modes_table = TXT_NewTable(num_columns);

    // Build window:

    TXT_AddWidget(window, 
                  fs_checkbox = TXT_NewCheckBox("Full screen", &fullscreen));

    if (num_supported_bpps > 1)
    {
        TXT_AddWidgets(window,
                       TXT_NewSeparator("Color depth"),
                       bpp_table = TXT_NewTable(4),
                       NULL);

        for (i = 0; i < num_supported_bpps; ++i)
        {
            txt_radiobutton_t *button;

            button = TXT_NewRadioButton(supported_bpps[i],
                                        &selected_bpp, i);

            TXT_AddWidget(bpp_table, button);
            TXT_SignalConnect(button, "selected", UpdateBPP, modes_table);
        }
    }

    TXT_AddWidgets(window,
                   modes_separator = TXT_NewSeparator(""),
                   modes_table,
                   NULL);

    TXT_SignalConnect(fs_checkbox, "changed",
                      GenerateModesTable, modes_table);
    TXT_SignalConnect(fs_checkbox, "changed",
                      UpdateModeSeparator, modes_separator);

    // How many rows high will the configuration window be?
    // Need to take into account number of fullscreen modes, and also
    // number of supported pixel depths.
    // The windowed modes list is four rows, so take the maximum of
    // windowed and fullscreen.

    num_rows = (num_screen_modes_fullscreen + num_columns - 1) / num_columns;

    if (num_rows < 4)
    {
        num_rows = 4;
    }

    if (num_supported_bpps > 1)
    {
        num_rows += 2;
    }

    if (num_rows < 14)
    {
        window_y = 8 - ((num_rows + 1) / 2);
    }
    else
    {
        window_y = 1;
    }

    // The window is set at a fixed vertical position.  This keeps
    // the top of the window stationary when switching between
    // fullscreen and windowed mode (which causes the window's
    // height to change).

    TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, 
                                  TXT_SCREEN_W / 2, window_y);

    GenerateModesTable(NULL, modes_table);
    UpdateModeSeparator(NULL, modes_separator);

    // Button to open "advanced" window.
    // Need to pass a pointer to the modes table, as some of the options
    // in there trigger a rebuild of it.

    advanced_button = TXT_NewWindowAction('a', "Advanced");
    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, advanced_button);
    TXT_SignalConnect(advanced_button, "pressed",
                      AdvancedDisplayConfig, modes_table);
}
Exemplo n.º 29
0
void ConfigSound(TXT_UNCAST_ARG(widget), void *user_data)
{
    txt_window_t *window;
    txt_window_action_t *music_action;

    // Build the window

    window = TXT_NewWindow("Sound configuration");
    TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

    TXT_SetColumnWidths(window, 40);
    TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP,
                                  TXT_SCREEN_W / 2, 3);

    music_action = TXT_NewWindowAction('m', "Music Packs");
    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, music_action);
    TXT_SignalConnect(music_action, "pressed", OpenMusicPackDir, NULL);

    TXT_AddWidgets(window,
        TXT_NewSeparator("Sound effects"),
        TXT_NewRadioButton("Disabled", &snd_sfxdevice, SNDDEVICE_NONE),
        TXT_If(gamemission == doom,
            TXT_NewRadioButton("PC speaker effects", &snd_sfxdevice,
                               SNDDEVICE_PCSPEAKER)),
        TXT_NewRadioButton("Digital sound effects",
                           &snd_sfxdevice,
                           SNDDEVICE_SB),
        TXT_If(gamemission == doom || gamemission == heretic
            || gamemission == hexen,
            TXT_NewConditional(&snd_sfxdevice, SNDDEVICE_SB,
                TXT_NewHorizBox(
                    TXT_NewStrut(4, 0),
                    TXT_NewCheckBox("Pitch-shifted sounds", &snd_pitchshift),
                    NULL))),
        TXT_If(gamemission == strife,
            TXT_NewConditional(&snd_sfxdevice, SNDDEVICE_SB,
                TXT_NewHorizBox(
                    TXT_NewStrut(4, 0),
                    TXT_NewCheckBox("Show text with voices", &show_talk),
                    NULL))),

        TXT_NewSeparator("Music"),
        TXT_NewRadioButton("Disabled", &snd_musicdevice, SNDDEVICE_NONE),

        TXT_NewRadioButton("OPL (Adlib/Soundblaster)", &snd_musicdevice,
                           SNDDEVICE_SB),
        TXT_NewConditional(&snd_musicdevice, SNDDEVICE_SB,
            TXT_NewHorizBox(
                TXT_NewStrut(4, 0),
                TXT_NewLabel("Chip type: "),
                OPLTypeSelector(),
                NULL)),

        TXT_NewRadioButton("GUS (emulated)", &snd_musicdevice, SNDDEVICE_GUS),
        TXT_NewConditional(&snd_musicdevice, SNDDEVICE_GUS,
            TXT_MakeTable(2,
                TXT_NewStrut(4, 0),
                TXT_NewLabel("Path to patch files: "),
                TXT_NewStrut(4, 0),
                TXT_NewFileSelector(&gus_patch_path, 34,
                                    "Select directory containing GUS patches",
                                    TXT_DIRECTORY),
                NULL)),

        TXT_NewRadioButton("Native MIDI", &snd_musicdevice, SNDDEVICE_GENMIDI),
        TXT_NewConditional(&snd_musicdevice, SNDDEVICE_GENMIDI,
            TXT_MakeTable(2,
                TXT_NewStrut(4, 0),
                TXT_NewLabel("Timidity configuration file: "),
                TXT_NewStrut(4, 0),
                TXT_NewFileSelector(&timidity_cfg_path, 34,
                                    "Select Timidity config file",
                                    cfg_extension),
                NULL)),
        NULL);
}
Exemplo n.º 30
0
static void StartGameMenu(const char *window_title, int multiplayer)
{
    txt_window_t *window;
    txt_widget_t *iwad_selector;

    window = TXT_NewWindow(window_title);
    TXT_SetTableColumns(window, 2);
    TXT_SetColumnWidths(window, 12, 6);

    if (multiplayer)
    {
        TXT_SetWindowHelpURL(window, MULTI_START_HELP_URL);
    }
    else
    {
        TXT_SetWindowHelpURL(window, LEVEL_WARP_HELP_URL);
    }

    TXT_SetWindowAction(window, TXT_HORIZ_CENTER, WadWindowAction());
    TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction(multiplayer));

    TXT_AddWidgets(window,
                   TXT_NewLabel("Game"),
                   iwad_selector = IWADSelector(),
                   NULL);

    if (gamemission == hexen)
    {
        txt_dropdown_list_t *cc_dropdown;
        TXT_AddWidgets(window,
                       TXT_NewLabel("Character class "),
                       cc_dropdown = TXT_NewDropdownList(&character_class,
                                                         character_classes, 3),
                       NULL);

        // Update skill level dropdown when the character class is changed:

        TXT_SignalConnect(cc_dropdown, "changed", UpdateWarpType, NULL);
    }

    TXT_AddWidgets(window,
                   TXT_NewLabel("Skill"),
                   skillbutton = TXT_NewDropdownList(&skill, doom_skills, 5),
                   TXT_NewLabel("Level warp"),
                   warpbutton = TXT_NewButton2("?", LevelSelectDialog, NULL),
                   NULL);

    if (multiplayer)
    {
        TXT_AddWidgets(window,
               TXT_NewLabel("Game type"),
               GameTypeDropdown(),
               TXT_NewLabel("Time limit"),
               TXT_NewHorizBox(TXT_NewIntInputBox(&timer, 2),
                               TXT_NewLabel("minutes"),
                               NULL),
               NULL);
    }

    TXT_AddWidgets(window,
                   TXT_NewSeparator("Monster options"),
                   TXT_NewInvertedCheckBox("Monsters enabled", &nomonsters),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   TXT_NewCheckBox("Fast monsters", &fast),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   TXT_NewCheckBox("Respawning monsters", &respawn),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   NULL);

    if (multiplayer)
    {
        TXT_AddWidgets(window,
                       TXT_NewSeparator("Advanced"),
                       TXT_NewLabel("UDP port"),
                       TXT_NewIntInputBox(&udpport, 5),
                       TXT_NewInvertedCheckBox("Register with master server",
                                               &privateserver),
                       TXT_TABLE_OVERFLOW_RIGHT,
                       NULL);
    }

    TXT_AddWidgets(window,
                   TXT_NewButton2("Add extra parameters...",
                                  OpenExtraParamsWindow, NULL),
                   TXT_TABLE_OVERFLOW_RIGHT,
                   NULL);

    TXT_SignalConnect(iwad_selector, "changed", UpdateWarpType, NULL);

    UpdateWarpType(NULL, NULL);
    UpdateWarpButton();
}