summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-06-29 18:05:32 +0000
committerSimon Howard2006-06-29 18:05:32 +0000
commit1d41349f0326187866c8212fed490f95b9692e47 (patch)
tree65ed1eecbd1356cd03fbc425a96b1514352e71a5
parent0fceea019eb22150b79dfe789c0b0dd2192bb7a3 (diff)
downloadchocolate-doom-1d41349f0326187866c8212fed490f95b9692e47.tar.gz
chocolate-doom-1d41349f0326187866c8212fed490f95b9692e47.tar.bz2
chocolate-doom-1d41349f0326187866c8212fed490f95b9692e47.zip
Initial mouse configuration window.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 564
-rw-r--r--setup/Makefile.am2
-rw-r--r--setup/mainmenu.c6
-rw-r--r--setup/mouse.c36
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));
+
+}
+