From 0ef3db9af6b98e70658c3d6f997493dcc680c63f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 20 Sep 2006 11:47:24 +0000 Subject: Add multiplayer configuration dialog. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 633 --- setup/mainmenu.c | 5 +++++ setup/multiplayer.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/setup/mainmenu.c b/setup/mainmenu.c index a4727519..e73a8eb2 100644 --- a/setup/mainmenu.c +++ b/setup/mainmenu.c @@ -69,6 +69,7 @@ extern void ConfigDisplay(); extern void ConfigKeyboard(); extern void ConfigMouse(); extern void StartMultiGame(); +extern void MultiplayerConfig(); void MainMenu(void) { @@ -99,6 +100,10 @@ void MainMenu(void) TXT_AddWidget(window, TXT_NewButton("Join a Network game")); + button = TXT_NewButton("Multiplayer configuration"); + TXT_SignalConnect(button, "pressed", MultiplayerConfig, NULL); + TXT_AddWidget(window, button); + quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit"); TXT_SignalConnect(quit_action, "pressed", QuitConfirm, NULL); TXT_SetWindowAction(window, TXT_HORIZ_LEFT, quit_action); diff --git a/setup/multiplayer.c b/setup/multiplayer.c index 86ee07f7..49321225 100644 --- a/setup/multiplayer.c +++ b/setup/multiplayer.c @@ -47,6 +47,9 @@ static char *gamemodes[] = "Deathmatch 2.0", }; +char *player_name; +char *chatmacros[10]; + char *wads[NUM_WADS] = {}; int skill = 0; int nomonsters = 0; @@ -255,3 +258,39 @@ void StartMultiGame(void) } +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_AddWidget(window, TXT_NewStrut(0, 1)); + + table = TXT_NewTable(2); + + TXT_AddWidget(table, TXT_NewLabel("Player name: ")); + TXT_AddWidget(table, TXT_NewInputBox(&player_name, 25)); + + TXT_AddWidget(window, table); + TXT_AddWidget(window, TXT_NewStrut(0, 1)); + TXT_AddWidget(window, TXT_NewSeparator("Chat macros")); + + 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_AddWidget(table, label); + TXT_AddWidget(table, TXT_NewInputBox(&chatmacros[i], 40)); + } + + TXT_AddWidget(window, table); +} + -- cgit v1.2.3