// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // Copyright(C) 2005 Simon Howard // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. // // Graphical stuff related to the networking code: // // * The client waiting screen when we are waiting for the server to // start the game. // #include #include #include #include "config.h" #include "doomkeys.h" #include "i_system.h" #include "i_timer.h" #include "i_video.h" #include "net_client.h" #include "net_gui.h" #include "net_server.h" #include "textscreen.h" static txt_window_t *window; static txt_label_t *player_labels[MAXPLAYERS]; static txt_label_t *ip_labels[MAXPLAYERS]; static txt_label_t *drone_label; static boolean had_warning; static void EscapePressed(TXT_UNCAST_ARG(widget), void *unused) { TXT_Shutdown(); I_Quit(); } static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(settings)) { TXT_CAST_ARG(net_gamesettings_t, settings); NET_CL_StartGame(settings); } static void BuildGUI(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..."); table = TXT_NewTable(3); TXT_AddWidget(window, table); // Add spacers TXT_AddWidget(table, NULL); TXT_AddWidget(table, TXT_NewStrut(25, 1)); TXT_AddWidget(table, TXT_NewStrut(17, 1)); // Player labels for (i=0; i 0) { sprintf(buf, " (+%i observer clients)", net_drones_in_game); TXT_SetLabel(drone_label, buf); } else { TXT_SetLabel(drone_label, ""); } if (net_client_controller) { startgame = TXT_NewWindowAction(' ', "Start game"); TXT_SignalConnect(startgame, "pressed", StartGame, settings); } else { startgame = NULL; } TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, startgame); } static void PrintMD5Digest(char *s, byte *digest) { unsigned int i; printf("%s: ", s); for (i=0; i