summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-09-20 11:47:24 +0000
committerSimon Howard2006-09-20 11:47:24 +0000
commit0ef3db9af6b98e70658c3d6f997493dcc680c63f (patch)
tree43818fe995700898d7460a7a57b96d84a9dcdac7
parent12ae015f192be46361060efb8fa727c033aec048 (diff)
downloadchocolate-doom-0ef3db9af6b98e70658c3d6f997493dcc680c63f.tar.gz
chocolate-doom-0ef3db9af6b98e70658c3d6f997493dcc680c63f.tar.bz2
chocolate-doom-0ef3db9af6b98e70658c3d6f997493dcc680c63f.zip
Add multiplayer configuration dialog.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 633
-rw-r--r--setup/mainmenu.c5
-rw-r--r--setup/multiplayer.c39
2 files changed, 44 insertions, 0 deletions
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);
+}
+