diff options
-rw-r--r-- | setup/mainmenu.c | 5 | ||||
-rw-r--r-- | setup/multiplayer.c | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/setup/mainmenu.c b/setup/mainmenu.c index 853bba56..f5351214 100644 --- a/setup/mainmenu.c +++ b/setup/mainmenu.c @@ -71,6 +71,7 @@ extern void ConfigMouse(); extern void ConfigSound(); extern void CompatibilitySettings(); extern void StartMultiGame(); +extern void JoinMultiGame(); extern void MultiplayerConfig(); void MainMenu(void) @@ -108,7 +109,9 @@ void MainMenu(void) TXT_SignalConnect(button, "pressed", StartMultiGame, NULL); TXT_AddWidget(window, button); - TXT_AddWidget(window, TXT_NewButton("Join a Network game")); + button = TXT_NewButton("Join a Network game"); + TXT_SignalConnect(button, "pressed", JoinMultiGame, NULL); + TXT_AddWidget(window, button); button = TXT_NewButton("Multiplayer configuration"); TXT_SignalConnect(button, "pressed", MultiplayerConfig, NULL); diff --git a/setup/multiplayer.c b/setup/multiplayer.c index 08098125..60f2bb3d 100644 --- a/setup/multiplayer.c +++ b/setup/multiplayer.c @@ -68,6 +68,10 @@ warptype_t warptype = WARP_DOOM2; int warpepisode = 1; int warpmap = 1; +// Address to connect to when joining a game + +char *connect_address = NULL; + static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data)) { printf("Now we start the game.\n"); @@ -293,6 +297,28 @@ void StartMultiGame(void) } +void JoinMultiGame(void) +{ + txt_window_t *window; + txt_button_t *button; + + window = TXT_NewWindow("Join multiplayer game"); + + TXT_AddWidget(window, TXT_NewLabel("Connect to address: ")); + TXT_AddWidget(window, TXT_NewInputBox(&connect_address, 40)); + TXT_AddWidget(window, TXT_NewStrut(0, 1)); + + button = TXT_NewButton("Add extra parameters..."); + TXT_SignalConnect(button, "pressed", OpenExtraParamsWindow, NULL); + TXT_AddWidget(window, button); + + button = TXT_NewButton("Add WADs..."); + TXT_SignalConnect(button, "pressed", OpenWadsWindow, NULL); + TXT_AddWidget(window, button); + + TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, StartGameAction()); +} + static void SetChatMacroDefaults(void) { int i; |