shithub: choc

Download patch

ref: 1d41349f0326187866c8212fed490f95b9692e47
parent: 0fceea019eb22150b79dfe789c0b0dd2192bb7a3
author: Simon Howard <[email protected]>
date: Thu Jun 29 14:05:32 EDT 2006

Initial mouse configuration window.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 564

--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -5,5 +5,5 @@
 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
 
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -47,6 +47,7 @@
 
 extern void ConfigDisplay();
 extern void ConfigKeyboard();
+extern void ConfigMouse();
 
 void MainMenu(void)
 {
@@ -64,7 +65,10 @@
     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"));
--- /dev/null
+++ b/setup/mouse.c
@@ -1,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));
+
+}
+