diff options
Diffstat (limited to 'setup')
-rw-r--r-- | setup/Makefile.am | 2 | ||||
-rw-r--r-- | setup/mainmenu.c | 6 | ||||
-rw-r--r-- | setup/mouse.c | 36 |
3 files changed, 42 insertions, 2 deletions
diff --git a/setup/Makefile.am b/setup/Makefile.am index 9e0dbfdb..67207e72 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -5,5 +5,5 @@ gamesdir = $(prefix)/games games_PROGRAMS = chocolate-setup chocolate_setup_LDADD = @LDFLAGS@ @SDL_LIBS@ ../textscreen/libtextscreen.a -chocolate_setup_SOURCES = mainmenu.c keyboard.c display.c +chocolate_setup_SOURCES = mainmenu.c keyboard.c display.c mouse.c diff --git a/setup/mainmenu.c b/setup/mainmenu.c index 4fbea079..2167bb4d 100644 --- a/setup/mainmenu.c +++ b/setup/mainmenu.c @@ -47,6 +47,7 @@ void QuitConfirm(void *unused1, void *unused2) extern void ConfigDisplay(); extern void ConfigKeyboard(); +extern void ConfigMouse(); void MainMenu(void) { @@ -64,7 +65,10 @@ void MainMenu(void) TXT_AddWidget(window, button); TXT_SignalConnect(button, "pressed", ConfigKeyboard, NULL); - TXT_AddWidget(window, TXT_NewButton("Configure mouse")); + button = TXT_NewButton("Configure mouse"); + TXT_AddWidget(window, button); + TXT_SignalConnect(button, "pressed", ConfigMouse, NULL); + TXT_AddWidget(window, TXT_NewButton("Save parameters and launch DOOM")); TXT_AddWidget(window, TXT_NewStrut(0, 1)); TXT_AddWidget(window, TXT_NewButton("Start a Network game")); diff --git a/setup/mouse.c b/setup/mouse.c new file mode 100644 index 00000000..f87eb390 --- /dev/null +++ b/setup/mouse.c @@ -0,0 +1,36 @@ + +#include <stdlib.h> +#include "textscreen.h" + +int novert; +int speed; +int accel; +int threshold; + +void ConfigMouse(void) +{ + txt_window_t *window; + txt_table_t *table; + + window = TXT_NewWindow("Mouse configuration"); + + TXT_AddWidget(window, TXT_NewSeparator("Mouse motion")); + + table = TXT_NewTable(2); + + TXT_AddWidget(table, TXT_NewLabel("Speed: ")); + TXT_AddWidget(table, TXT_NewIntInputBox(&speed, 8)); + TXT_AddWidget(table, TXT_NewLabel("Acceleration: ")); + TXT_AddWidget(table, TXT_NewIntInputBox(&accel, 8)); + TXT_AddWidget(table, TXT_NewLabel("Acceleration threshold: ")); + TXT_AddWidget(table, TXT_NewIntInputBox(&threshold, 8)); + + TXT_AddWidget(window, table); + + TXT_AddWidget(window, TXT_NewSeparator(NULL)); + + TXT_AddWidget(window, + TXT_NewInvertedCheckBox("Allow vertical mouse movement", &novert)); + +} + |