1 // ============================================================== 2 // This file is part of Glest (www.glest.org) 3 // 4 // Copyright (C) 2001-2005 Marti�o Figueroa 5 // 6 // You can redistribute this code and/or modify it under 7 // the terms of the GNU General Public License as published 8 // by the Free Software Foundation; either version 2 of the 9 // License, or (at your option) any later version 10 // ============================================================== 11 12 #ifndef _GLEST_GAME_MENUSTATEJOINGAME_H_ 13 #define _GLEST_GAME_MENUSTATEJOINGAME_H_ 14 15 #include "properties.h" 16 #include "main_menu.h" 17 18 using Shared::Util::Properties; 19 20 namespace Glest{ namespace Game{ 21 22 class NetworkMessageIntro; 23 24 // =============================== 25 // class MenuStateJoinGame 26 // =============================== 27 28 class MenuStateJoinGame: public MenuState{ 29 private: 30 static const int newServerIndex; 31 static const string serverFileName; 32 33 private: 34 GraphicButton buttonReturn; 35 GraphicButton buttonConnect; 36 GraphicLabel labelServer; 37 GraphicLabel labelServerType; 38 GraphicLabel labelServerIp; 39 GraphicLabel labelStatus; 40 GraphicLabel labelInfo; 41 GraphicListBox listBoxServerType; 42 GraphicListBox listBoxServers; 43 44 bool connected; 45 int playerIndex; 46 Properties servers; 47 48 public: 49 MenuStateJoinGame(Program *program, MainMenu *mainMenu, bool connect= false, Ip serverIp= Ip()); 50 51 void mouseClick(int x, int y, MouseButton mouseButton); 52 void mouseMove(int x, int y, const MouseState *mouseState); 53 void render(); 54 void update(); 55 void keyDown(char key); 56 void keyPress(char c); 57 58 private: 59 void connectToServer(); 60 }; 61 }}//end namespace 62 63 #endif 64