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 Class Reference

#include <gamemenu.h>

Inheritance diagram for GameMenu:
WctlBase< GameMenu > WindowController

Public Member Functions

virtual void init (void)
 
virtual void run (void)
 
 GameMenu (bool firsttime)
 
virtual ~GameMenu (void)
 
- Public Member Functions inherited from WctlBase< GameMenu >
virtual bool processWindowCommand (const EventCommandId &command, Control *control)
 
- Public Member Functions inherited from WindowController
virtual void draw (void)
 
virtual Windowwindow (void)
 
virtual void setWindow (Window *w)
 
 WindowController ()
 
virtual ~WindowController (void)
 

Static Public Member Functions

static void createNetworkControls (GroupControl *serverConnGroup, std::vector< unsigned int > *keyboard_input_queue)
 
static void readJoinGameControls (Window *window, string &user, string &pass)
 

Protected Member Functions

bool processSinglePlayerButton (const EventCommandId &command, Control *control)
 
bool processMultiPlayerHostButton (const EventCommandId &command, Control *control)
 
bool processMultiPlayerAcctButton (const EventCommandId &command, Control *control)
 
bool processMultiPlayerButton (const EventCommandId &command, Control *control)
 
bool processExitGameButton (const EventCommandId &command, Control *control)
 
bool processJoinGameButton (const EventCommandId &command, Control *control)
 
bool processMainMenuButton (const EventCommandId &command, Control *control)
 
void createControls ()
 

Protected Attributes

bool m_firstTime
 

Friends

class WctlBase< GameMenu >
 

Additional Inherited Members

- Public Types inherited from WctlBase< GameMenu >
typedef
WindowControllerTableEntry
< GameMenu
WctlTableEntry
 
- Static Protected Attributes inherited from WctlBase< GameMenu >
static const WctlTableEntry WctlCommandTable []
 

Detailed Description

Definition at line 7 of file gamemenu.h.

Constructor & Destructor Documentation

GameMenu::GameMenu ( bool  firsttime)

Definition at line 36 of file gamemenu.cpp.

36  :
37  m_firstTime( firstTime )
38 {}
GameMenu::~GameMenu ( void  )
virtual

Definition at line 40 of file gamemenu.cpp.

40 {}

Member Function Documentation

void GameMenu::createControls ( void  )
protected

Definition at line 277 of file gamemenu.cpp.

References GroupControl::addChild(), Window::addControl(), createNetworkControls(), gamemenu_keyboard_queue, getConfigColor(), GUI_CLEAR(), GUI_OPAQUE_WHITE(), Control::setColor(), NewButton::setCommand(), NewButton::setDownColor(), NewButton::setDownTextColor(), StaticDisplay::setFont(), Control::setFont(), Control::setHidden(), Control::setId(), NewButton::setLabel(), Control::setRect(), StaticDisplay::setRect(), StaticDisplay::setText(), StaticDisplay::setTextColor(), Control::setTextColor(), and WindowController::window().

Referenced by init().

278 {
279  //Base info title.
280  StaticDisplay *baseTitle = new StaticDisplay;
281  baseTitle->setRect( Rect( -.96, .83, 1.9, .1 ) );
282  baseTitle->setText( "Vega Strike menu" );
283  static GFXColor baseNameColor = getConfigColor( "base_name_color", GFXColor( .1, .8, .1 ) );
284  baseTitle->setTextColor( baseNameColor );
285  baseTitle->setColor( GUI_CLEAR );
286  baseTitle->setFont( Font( .07, 2 ) );
287  baseTitle->setId( "GameTitle" );
288  //Put it on the window.
289 
290  GroupControl *mainMenuGroup = new GroupControl;
291  mainMenuGroup->setId( "MainMenu" );
292  window()->addControl( mainMenuGroup );
293 
294  mainMenuGroup->addChild( baseTitle );
295 
296  NewButton *singlePlayer = new NewButton;
297  singlePlayer->setRect( Rect( -.75, .2, 1.5, .15 ) );
298  singlePlayer->setColor( GFXColor( 0, 1, 1, .1 ) );
299  singlePlayer->setTextColor( GUI_OPAQUE_WHITE() );
300  singlePlayer->setDownColor( GFXColor( 0, 1, 1, .4 ) );
301  singlePlayer->setDownTextColor( GFXColor( .2, .2, .2 ) );
302  singlePlayer->setFont( Font( .07, 1 ) );
303  singlePlayer->setCommand( "SinglePlayer" );
304  singlePlayer->setLabel( "Single Player Game" );
305  mainMenuGroup->addChild( singlePlayer );
306 
307  NewButton *multiPlayer = new NewButton;
308  multiPlayer->setRect( Rect( -.75, 0, 1.5, .15 ) );
309  multiPlayer->setColor( GFXColor( 1, .2, 0, .1 ) );
310  multiPlayer->setTextColor( GUI_OPAQUE_WHITE() );
311  multiPlayer->setDownColor( GFXColor( 1, .2, 0, .4 ) );
312  multiPlayer->setDownTextColor( GFXColor( .2, .2, .2 ) );
313  multiPlayer->setFont( Font( .07, 1 ) );
314  multiPlayer->setCommand( "ShowMultiPlayer" );
315  multiPlayer->setLabel( "MultiPlayer" );
316  mainMenuGroup->addChild( multiPlayer );
317 
318  NewButton *exitGame = new NewButton;
319  exitGame->setRect( Rect( -.75, -.5, 1.5, .15 ) );
320  exitGame->setColor( GFXColor( .7, 0, 1, .1 ) );
321  exitGame->setTextColor( GUI_OPAQUE_WHITE() );
322  exitGame->setDownColor( GFXColor( .7, 0, 1, .4 ) );
323  exitGame->setDownTextColor( GFXColor( .2, .2, .2 ) );
324  exitGame->setFont( Font( .07, 1 ) );
325  exitGame->setCommand( "ExitGame" );
326  exitGame->setLabel( "Exit Game" );
327  mainMenuGroup->addChild( exitGame );
328 
329  GroupControl *serverConnGroup = new GroupControl;
330  serverConnGroup->setId( "MultiPlayerMenu" );
331  serverConnGroup->setHidden( true );
332  window()->addControl( serverConnGroup );
333 
334  StaticDisplay *mplayTitle = new StaticDisplay;
335  mplayTitle->setRect( Rect( -.96, .83, .8, .1 ) );
336  mplayTitle->setText( "MultiPlayer Settings" );
337  mplayTitle->setTextColor( baseNameColor );
338  mplayTitle->setColor( GUI_CLEAR );
339  mplayTitle->setFont( Font( .07, 2 ) );
340  mplayTitle->setId( "GameTitle" );
341  //Put it on the window.
342  serverConnGroup->addChild( mplayTitle );
343 
344  NewButton *returnMainMenu = new NewButton;
345  returnMainMenu->setRect( Rect( .7, .81, .25, .1 ) );
346  returnMainMenu->setColor( GFXColor( 1, .2, 0, .1 ) );
347  returnMainMenu->setTextColor( GUI_OPAQUE_WHITE() );
348  returnMainMenu->setDownColor( GFXColor( 1, .2, 0, .4 ) );
349  returnMainMenu->setDownTextColor( GFXColor( .2, .2, .2 ) );
350  returnMainMenu->setFont( Font( .07, 1 ) );
351  returnMainMenu->setCommand( "ReturnMainMenu" );
352  returnMainMenu->setLabel( "Done" );
353  serverConnGroup->addChild( returnMainMenu );
354 
355  exitGame = new NewButton;
356  exitGame->setRect( Rect( -.95, -.91, .3, .1 ) );
357  exitGame->setColor( GFXColor( .7, 0, 1, .1 ) );
358  exitGame->setTextColor( GUI_OPAQUE_WHITE() );
359  exitGame->setDownColor( GFXColor( .7, 0, 1, .4 ) );
360  exitGame->setDownTextColor( GFXColor( .2, .2, .2 ) );
361  exitGame->setFont( Font( .07, 1 ) );
362  exitGame->setCommand( "ExitGame" );
363  exitGame->setLabel( "Quit Game" );
364  serverConnGroup->addChild( exitGame );
365 
366  createNetworkControls( serverConnGroup, &gamemenu_keyboard_queue );
367 
368  //Make a tab for mode switching...
369  //(Add buttons for acctserver/modname) (acctserver mode is default).
370  //
371  //Add a user/password box (as well as create account button if in acctserver mode).
372  //Connect button
373  //
374  //Scan local network button (I guess...)
375  //Host game menu... also might take plenty of work...
376 
377  //Single Player button
378  //Options button (Requires restart if not done at the beginning... static variables)
379  //Options button requires porting vssetup code to be used inside VS... should be simple to do. Is it worth it?
380  //Network button
381  //About
382  //Exit game
383 
384  //Submenu of single player: (for now, call base computer like it does now))
385  //
386  //New Game (taken from save/load dialog?)
387  //Load Game (save/load dialog without save option?)
388  //Simple space fight (equivalent to mission command line option?)
389 
390  //Submenu of multiplayer:
391  //
392  //Account Server. // Mod name.
393  //No downloading server lists...
394  //User name
395  //Password
396  //Create account... goes through CGI page.
397 }
void GameMenu::createNetworkControls ( GroupControl serverConnGroup,
std::vector< unsigned int > *  keyboard_input_queue 
)
static

Definition at line 72 of file gamemenu.cpp.

References GroupControl::addChild(), GFXColor::b, GFXColor::g, VegaConfig::getVariable(), GUI_CLEAR(), GUI_OPAQUE_BLACK(), GUI_OPAQUE_MEDIUM_GRAY(), GUI_OPAQUE_WHITE(), XMLSupport::parse_bool(), GFXColor::r, Control::setColor(), NewButton::setCommand(), NewButton::setDownColor(), NewButton::setDownTextColor(), StaticDisplay::setFont(), Control::setFont(), Control::setHidden(), NewButton::setHighlightColor(), Control::setId(), NewButton::setLabel(), StaticDisplay::setMultiLine(), Control::setOutlineColor(), TextInputDisplay::setPassword(), Control::setRect(), StaticDisplay::setRect(), StaticDisplay::setText(), StaticDisplay::setTextColor(), Control::setTextColor(), StaticDisplay::setTextMargins(), and vs_config.

Referenced by BaseComputer::constructControls(), and createControls().

73 {
74  GFXColor color( 1, .5, 0, .1 );
75  //Account Server button.
76  NewButton *joinAcct = new NewButton;
77  joinAcct->setRect( Rect( -.50, .7, .37, .09 ) );
78  joinAcct->setLabel( "Online Account Server" );
79  joinAcct->setCommand( "ShowJoinAccount" );
80 
81  joinAcct->setColor( GFXColor( color.r, color.g, color.b, .25 ) );
82  joinAcct->setTextColor( GUI_OPAQUE_WHITE() );
83  joinAcct->setDownColor( GFXColor( color.r, color.g, color.b, .5 ) );
84  joinAcct->setDownTextColor( GUI_OPAQUE_BLACK() );
85  joinAcct->setHighlightColor( GFXColor( color.r, color.g, color.b, .4 ) );
86  joinAcct->setFont( Font( .07 ) );
87  serverConnGroup->addChild( joinAcct );
88 
89  //Ship Stats button.
90  NewButton *joinServer = new NewButton;
91  joinServer->setRect( Rect( .05, .7, .37, .09 ) );
92  joinServer->setLabel( "Independent Server" );
93  joinServer->setCommand( "ShowJoinServer" );
94  joinServer->setColor( GFXColor( color.r, color.g, color.b, .25 ) );
95  joinServer->setTextColor( GUI_OPAQUE_WHITE() );
96  joinServer->setDownColor( GFXColor( color.r, color.g, color.b, .5 ) );
97  joinServer->setDownTextColor( GUI_OPAQUE_BLACK() );
98  joinServer->setHighlightColor( GFXColor( color.r, color.g, color.b, .4 ) );
99  joinServer->setFont( Font( .07 ) );
100  serverConnGroup->addChild( joinServer );
101 
102  bool useacctserver = XMLSupport::parse_bool( vs_config->getVariable( "network", "use_account_server", "true" ) );
103 
104  GroupControl *acctConnGroup = new GroupControl;
105  acctConnGroup->setId( "MultiPlayerAccountServer" );
106  acctConnGroup->setHidden( !useacctserver );
107  serverConnGroup->addChild( acctConnGroup );
108 
109  GroupControl *hostConnGroup = new GroupControl;
110  hostConnGroup->setId( "MultiPlayerHostPort" );
111  hostConnGroup->setHidden( useacctserver );
112  serverConnGroup->addChild( hostConnGroup );
113  StaticDisplay *mplayTitle = new StaticDisplay;
114  mplayTitle->setRect( Rect( -.7, .6, 1, .1 ) );
115  mplayTitle->setText( "Independent Server IP Address:" );
116  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
117  mplayTitle->setColor( GUI_CLEAR );
118  mplayTitle->setFont( Font( .07, 2 ) );
119  mplayTitle->setId( "HostTitle" );
120  hostConnGroup->addChild( mplayTitle );
121 
122  //Description box.
123  StaticDisplay *serverInputText = new TextInputDisplay( inputqueue, "\x1b\n \t\r*?\\/|:<>\"^" );
124  serverInputText->setRect( Rect( -.6, .42, 1.2, .15 ) );
125  serverInputText->setColor( GFXColor( 1, .5, 0, .1 ) );
126  serverInputText->setOutlineColor( GUI_OPAQUE_MEDIUM_GRAY() );
127  serverInputText->setFont( Font( .07 ) );
128  serverInputText->setMultiLine( false );
129  serverInputText->setTextColor( GUI_OPAQUE_WHITE() );
130  serverInputText->setTextMargins( Size( .02, .01 ) );
131  serverInputText->setId( "VegaserverHost" );
132  serverInputText->setText( vs_config->getVariable( "network", "server_ip", "" ) );
133  hostConnGroup->addChild( serverInputText );
134 
135  mplayTitle = new StaticDisplay;
136  mplayTitle->setRect( Rect( -.7, .3, 1, .1 ) );
137  mplayTitle->setText( "Server Port: (default 6777)" );
138  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
139  mplayTitle->setColor( GUI_CLEAR );
140  mplayTitle->setFont( Font( .07, 2 ) );
141  mplayTitle->setId( "PortTitle" );
142  hostConnGroup->addChild( mplayTitle );
143 
144  StaticDisplay *portInputText = new TextInputDisplay( inputqueue, "\x1b\n \t\r*?\\/|:<>\"!@#$%^&*()[]{},.=_-+`~"
145  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" );
146  portInputText->setRect( Rect( -.6, .12, .4, .15 ) );
147  portInputText->setColor( GFXColor( 1, .5, 0, .1 ) );
148  portInputText->setOutlineColor( GUI_OPAQUE_MEDIUM_GRAY() );
149  portInputText->setFont( Font( .07 ) );
150  portInputText->setMultiLine( false );
151  portInputText->setTextColor( GUI_OPAQUE_WHITE() );
152  portInputText->setTextMargins( Size( .02, .01 ) );
153  portInputText->setId( "VegaserverPort" );
154  portInputText->setText( vs_config->getVariable( "network", "server_port", "6777" ) );
155  hostConnGroup->addChild( portInputText );
156 
157  mplayTitle = new StaticDisplay;
158  mplayTitle->setRect( Rect( -.7, .6, 1, .1 ) );
159  mplayTitle->setText( "Account Server URL:" );
160  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
161  mplayTitle->setColor( GUI_CLEAR );
162  mplayTitle->setFont( Font( .07, 2 ) );
163  mplayTitle->setId( "AcctserverTitle" );
164  acctConnGroup->addChild( mplayTitle );
165 
166  StaticDisplay *acctserverInput = new TextInputDisplay( inputqueue, "\x1b\n \t\r*\\|<>\"^" );
167  acctserverInput->setRect( Rect( -.6, .42, 1.2, .15 ) );
168  acctserverInput->setColor( GFXColor( 1, .5, 0, .1 ) );
169  acctserverInput->setOutlineColor( GUI_OPAQUE_MEDIUM_GRAY() );
170  acctserverInput->setFont( Font( .07 ) );
171  acctserverInput->setMultiLine( false );
172  acctserverInput->setTextColor( GUI_OPAQUE_WHITE() );
173  acctserverInput->setTextMargins( Size( .02, .01 ) );
174  acctserverInput->setId( "AccountServer" );
175  acctserverInput->setText( vs_config->getVariable( "network", "account_server_url",
176  "http://vegastrike.sourceforge.net/cgi-bin/accountserver.py?" ) );
177  acctConnGroup->addChild( acctserverInput );
178 
179  mplayTitle = new StaticDisplay;
180  mplayTitle->setRect( Rect( -.7, 0, 1, .1 ) );
181  mplayTitle->setText( "Callsign:" );
182  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
183  mplayTitle->setColor( GUI_CLEAR );
184  mplayTitle->setFont( Font( .07, 2 ) );
185  mplayTitle->setId( "UsernameTitle" );
186  serverConnGroup->addChild( mplayTitle );
187 
188  string origpass( vs_config->getVariable( "player", "password", "" ) );
189  StaticDisplay *usernameInput = new TextInputDisplay( inputqueue, "\x1b\n\t\r*\\|<>\"^" );
190  usernameInput->setRect( Rect( -.6, -.18, 1.2, .15 ) );
191  usernameInput->setColor( GFXColor( 1, .5, 0, .1 ) );
192  usernameInput->setOutlineColor( GUI_OPAQUE_MEDIUM_GRAY() );
193  usernameInput->setFont( Font( .07 ) );
194  usernameInput->setMultiLine( false );
195  usernameInput->setTextColor( GUI_OPAQUE_WHITE() );
196  usernameInput->setTextMargins( Size( .02, .01 ) );
197  usernameInput->setId( "Username" );
198  if ( !origpass.empty() ) usernameInput->setText( vs_config->getVariable( "player", "callsign", "" ) );
199  serverConnGroup->addChild( usernameInput );
200 
201  mplayTitle = new StaticDisplay;
202  mplayTitle->setRect( Rect( -.7, -.3, 1, .1 ) );
203  mplayTitle->setText( "Password: (Server password is usually blank on local games)" );
204  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
205  mplayTitle->setColor( GUI_CLEAR );
206  mplayTitle->setFont( Font( .07, 2 ) );
207  mplayTitle->setId( "PasswordTitleHost" );
208  hostConnGroup->addChild( mplayTitle );
209 
210  mplayTitle = new StaticDisplay;
211  mplayTitle->setRect( Rect( -.7, -.3, 1, .1 ) );
212  mplayTitle->setText( "Password:" );
213  mplayTitle->setTextColor( GUI_OPAQUE_WHITE() );
214  mplayTitle->setColor( GUI_CLEAR );
215  mplayTitle->setFont( Font( .07, 2 ) );
216  mplayTitle->setId( "PasswordTitle" );
217  acctConnGroup->addChild( mplayTitle );
218 
219  TextInputDisplay *passwordInput = new TextInputDisplay( inputqueue, "\x1b\n\t\r" );
220  passwordInput->setPassword( '*' );
221  passwordInput->setRect( Rect( -.6, -.48, 1.2, .15 ) );
222  passwordInput->setColor( GFXColor( 1, .5, 0, .1 ) );
223  passwordInput->setOutlineColor( GUI_OPAQUE_MEDIUM_GRAY() );
224  passwordInput->setFont( Font( .07 ) );
225  passwordInput->setMultiLine( false );
226  passwordInput->setTextColor( GUI_OPAQUE_WHITE() );
227  passwordInput->setTextMargins( Size( .02, .01 ) );
228  passwordInput->setId( "Password" );
229  passwordInput->setText( origpass );
230  serverConnGroup->addChild( passwordInput );
231 
232  NewButton *multiStart = new NewButton;
233  multiStart->setRect( Rect( -.25, -.65, .5, .15 ) );
234  multiStart->setColor( GFXColor( 1, .2, 0, .1 ) );
235  multiStart->setTextColor( GUI_OPAQUE_WHITE() );
236  multiStart->setDownColor( GFXColor( 1, .2, 0, .4 ) );
237  multiStart->setDownTextColor( GFXColor( .2, .2, .2 ) );
238  multiStart->setFont( Font( .07, 1 ) );
239  multiStart->setCommand( "JoinGame" );
240  multiStart->setLabel( "Join Game" );
241  serverConnGroup->addChild( multiStart );
242 }
void GameMenu::init ( void  )
virtual

Implements WindowController.

Definition at line 265 of file gamemenu.cpp.

References createControls(), GUI_CLEAR(), Window::setColor(), Window::setFullScreen(), Window::setTexture(), WindowController::setWindow(), and WindowController::window().

Referenced by UniverseUtil::startMenuInterface().

266 {
267  Window *w = new Window;
268  setWindow( w );
269 
270  window()->setFullScreen();
271  window()->setColor( GUI_CLEAR );
272  window()->setTexture( "basecomputer.png" );
273 
274  createControls();
275 }
bool GameMenu::processExitGameButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 448 of file gamemenu.cpp.

References winsys_exit().

449 {
450  winsys_exit( 0 );
451  return true;
452 }
bool GameMenu::processJoinGameButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 691 of file gamemenu.cpp.

References NetActionConfirm::confirmedJoinGame(), NetActionConfirm::JOINGAME, and WindowController::window().

692 {
694  nak->confirmedJoinGame();
695 
696  return true;
697 }
bool GameMenu::processMainMenuButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 441 of file gamemenu.cpp.

References Window::findControlById(), Control::setHidden(), and WindowController::window().

442 {
443  window()->findControlById( "MainMenu" )->setHidden( false );
444  window()->findControlById( "MultiPlayerMenu" )->setHidden( true );
445  return true;
446 }
bool GameMenu::processMultiPlayerAcctButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 425 of file gamemenu.cpp.

References Window::findControlById(), Control::setHidden(), and WindowController::window().

426 {
427  window()->findControlById( "MainMenu" )->setHidden( true );
428  window()->findControlById( "MultiPlayerMenu" )->setHidden( false );
429  window()->findControlById( "MultiPlayerAccountServer" )->setHidden( false );
430  window()->findControlById( "MultiPlayerHostPort" )->setHidden( true );
431  return true;
432 }
bool GameMenu::processMultiPlayerButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 434 of file gamemenu.cpp.

References Window::findControlById(), Control::setHidden(), and WindowController::window().

435 {
436  window()->findControlById( "MainMenu" )->setHidden( true );
437  window()->findControlById( "MultiPlayerMenu" )->setHidden( false );
438  return true;
439 }
bool GameMenu::processMultiPlayerHostButton ( const EventCommandId command,
Control control 
)
protected

Definition at line 416 of file gamemenu.cpp.

References Window::findControlById(), Control::setHidden(), and WindowController::window().

417 {
418  window()->findControlById( "MainMenu" )->setHidden( true );
419  window()->findControlById( "MultiPlayerMenu" )->setHidden( false );
420  window()->findControlById( "MultiPlayerAccountServer" )->setHidden( true );
421  window()->findControlById( "MultiPlayerHostPort" )->setHidden( false );
422  return true;
423 }
bool GameMenu::processSinglePlayerButton ( const EventCommandId command,
Control control 
)
protected
void GameMenu::readJoinGameControls ( Window window,
string &  user,
string &  pass 
)
static

Definition at line 563 of file gamemenu.cpp.

References _Universe, enableNetwork(), Window::findControlById(), Control::hidden(), i, Network, Universe::numPlayers(), VegaConfig::setVariable(), and vs_config.

Referenced by NetActionConfirm::confirmedJoinGame().

564 {
565  //Magic goes here!
566  user = static_cast< TextInputDisplay* > ( window->findControlById( "Username" ) )->text();
567  string::size_type pos = user.find( ' ' );
568  while (pos != string::npos) {
569  user[pos] = '_';
570  pos = user.find( ' ', pos );
571  }
572  pass = static_cast< TextInputDisplay* > ( window->findControlById( "Password" ) )->text();
573  vs_config->setVariable( "player", "callsign", user );
574  vs_config->setVariable( "player", "password", pass );
575  if ( window->findControlById( "MultiPlayerAccountServer" )->hidden() ) {
576  vs_config->setVariable( "network", "use_account_server", "false" );
577  vs_config->setVariable( "network", "server_ip",
578  static_cast< TextInputDisplay* > ( window->findControlById( "VegaserverHost" ) )->text() );
579  vs_config->setVariable( "network", "server_port",
580  static_cast< TextInputDisplay* > ( window->findControlById( "VegaserverPort" ) )->text() );
581  } else {
582  vs_config->setVariable( "network", "use_account_server", "true" );
583  vs_config->setVariable( "network", "account_server_url",
584  static_cast< TextInputDisplay* > ( window->findControlById( "AccountServer" ) )->text() );
585  }
586  enableNetwork( true );
587  if (Network != NULL)
588  for (unsigned int i = 0; i < _Universe->numPlayers(); i++)
589  Network[i].Reinitialize();
590  else
591  Network = new NetClient[_Universe->numPlayers()]; //Hardcode 1 player anyway.
592 }
void GameMenu::run ( void  )
virtual

Reimplemented from WindowController.

Definition at line 42 of file gamemenu.cpp.

References WindowController::run().

Referenced by UniverseUtil::startMenuInterface().

43 {
45 }

Friends And Related Function Documentation

friend class WctlBase< GameMenu >
friend

Definition at line 9 of file gamemenu.h.

Member Data Documentation

bool GameMenu::m_firstTime
protected

Definition at line 18 of file gamemenu.h.

Referenced by processSinglePlayerButton().


The documentation for this class was generated from the following files: