From 845a5d31b27c15f5b61f15e1cfc5f5d305b4878c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 19 Oct 2011 18:48:53 +0000 Subject: Send MAXPLAYERS value for game on connect to server. Make server adapt its player limit to match. Update GUI code to adjust waiting screen list size appropriately. Subversion-branch: /branches/v2-branch Subversion-revision: 2442 --- src/net_gui.c | 58 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 16 deletions(-) (limited to 'src/net_gui.c') diff --git a/src/net_gui.c b/src/net_gui.c index 781d27c6..7fff33f6 100644 --- a/src/net_gui.c +++ b/src/net_gui.c @@ -42,6 +42,7 @@ #include "textscreen.h" static txt_window_t *window; +static int old_max_players; static txt_label_t *player_labels[NET_MAXPLAYERS]; static txt_label_t *ip_labels[NET_MAXPLAYERS]; static txt_label_t *drone_label; @@ -60,18 +61,31 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(settings)) NET_CL_StartGame(settings); } -static void BuildGUI(void) +static void OpenWaitDialog(void) { - char buf[50]; - txt_table_t *table; txt_window_action_t *cancel; - int i; - - had_warning = false; TXT_SetDesktopTitle(PACKAGE_STRING); - + window = TXT_NewWindow("Waiting for game start..."); + + TXT_AddWidget(window, TXT_NewLabel("\nPlease wait...\n\n")); + + cancel = TXT_NewWindowAction(KEY_ESCAPE, "Cancel"); + TXT_SignalConnect(cancel, "pressed", EscapePressed, NULL); + + TXT_SetWindowAction(window, TXT_HORIZ_LEFT, cancel); + + old_max_players = 0; +} + +static void BuildWindow(void) +{ + char buf[50]; + txt_table_t *table; + int i; + + TXT_ClearTable(window); table = TXT_NewTable(3); TXT_AddWidget(window, table); @@ -82,8 +96,8 @@ static void BuildGUI(void) TXT_AddWidget(table, TXT_NewStrut(17, 1)); // Player labels - - for (i=0; i