Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gamemenu.h
Go to the documentation of this file.
1 #ifndef __GAMEMENU_H__
2 #define __GAMEMENU_H__
3 
4 #include "gui/windowcontroller.h"
5 #include "gui/simplepicker.h"
6 
7 class GameMenu : public WctlBase< GameMenu >
8 {
9  friend class WctlBase< GameMenu >;
10 public:
11  virtual void init( void );
12  virtual void run( void );
13 
14  GameMenu( bool firsttime );
15  virtual ~GameMenu( void );
16 
17 protected:
19 
20  bool processSinglePlayerButton( const EventCommandId &command, Control *control );
21  bool processMultiPlayerHostButton( const EventCommandId &command, Control *control );
22  bool processMultiPlayerAcctButton( const EventCommandId &command, Control *control );
23  bool processMultiPlayerButton( const EventCommandId &command, Control *control );
24  bool processExitGameButton( const EventCommandId &command, Control *control );
25  bool processJoinGameButton( const EventCommandId &command, Control *control );
26  bool processMainMenuButton( const EventCommandId &command, Control *control );
27 
28  void createControls();
29 
30 public:
31 //Helper functions for use in a submenu of BaseComputer.
32 
33 //Caller is responsible for making a return button, as well as adding the "JoinGame" WctlTableEntry
34  static void createNetworkControls( GroupControl *serverConnGroup, std::vector< unsigned int > *keyboard_input_queue );
35  static void readJoinGameControls( Window *window, string &user, string &pass );
36 };
37 
39 {
40 public:
42 private:
43  int player;
44  Window *m_parent;
45  string type;
46  string text;
47  string savefile;
48  ActionMode netAction;
49 public:
50 //CONSTRUCTION.
51  NetActionConfirm( int pnum, Window *w, ActionMode action ) :
52  player( pnum )
53  , m_parent( w )
54  , netAction( action ) {}
55  virtual ~NetActionConfirm( void ) {}
56 
57 //Set up the window and get everything ready.
58  virtual void init( void );
59 
60 //Process a command event from the window.
61  virtual bool processWindowCommand( const EventCommandId &command, Control *control );
62 
63  virtual bool finalizeJoinGame( int launchShip = 0 );
64  virtual bool confirmedJoinGame();
65 
66  virtual bool confirmedNetDie();
67  virtual bool confirmedNetSaveGame();
68 };
69 
70 #endif
71