Skip to content

Commit

Permalink
setup: Rearrange mouse config dialog.
Browse files Browse the repository at this point in the history
This previously showed the fire/use/move forward controls, which are
the original controls provided by Doom's setup.exe.

However, the reality is that nowadays most people play with the WASD&mouse
arrangement (or something similar) and are unlikely to be using the mouse
to move forwards. So it makes more sense if we reserve the main mouse
dialog for "action" buttons (fire/use) and move the "move forward" button
into the more buttons dialog. This also makes the more buttons dialog match
the arrangements for keyboard and gamepad controls.

As part of this, also tweak the mouse button minimum width so that it has a
consistent size that can describe high-numbered mouse buttons (eg.
"BUTTON #10").
  • Loading branch information
fragglet committed Mar 29, 2019
1 parent c714c41 commit a96f19f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/setup/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,23 @@ static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
TXT_SetWindowHelpURL(window, WINDOW_HELP_URL);

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

TXT_SetColumnWidths(buttons_table, 24, 5);
TXT_SetColumnWidths(buttons_table, 16, 11, 14, 10);

AddMouseControl(buttons_table, "Move backward", &mousebbackward);
AddMouseControl(buttons_table, "Use", &mousebuse);
AddMouseControl(buttons_table, "Move forward", &mousebforward);
AddMouseControl(buttons_table, "Strafe left", &mousebstrafeleft);
AddMouseControl(buttons_table, "Move backward", &mousebbackward);
AddMouseControl(buttons_table, "Strafe right", &mousebstraferight);
AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon);
AddMouseControl(buttons_table, "Strafe on", &mousebstrafe);
AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);

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

AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon);
AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);
}

void ConfigMouse(TXT_UNCAST_ARG(widget), void *user_data)
Expand Down Expand Up @@ -145,8 +145,7 @@ void ConfigMouse(TXT_UNCAST_ARG(widget), void *user_data)
NULL);

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

TXT_AddWidget(window,
TXT_NewButton2("More controls...", ConfigExtraButtons, NULL));
Expand Down
3 changes: 2 additions & 1 deletion src/setup/txt_mouseinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include "txt_utf8.h"
#include "txt_window.h"

#define MOUSE_INPUT_WIDTH 8
// eg. "BUTTON #10"
#define MOUSE_INPUT_WIDTH 10

static int MousePressCallback(txt_window_t *window,
int x, int y, int b,
Expand Down

0 comments on commit a96f19f

Please sign in to comment.