Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9235 in orxonox.OLD for trunk/src/story_entities/menu/game_menu.cc


Ignore:
Timestamp:
Jul 5, 2006, 4:39:02 PM (18 years ago)
Author:
bensch
Message:

merged the presentation back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/menu/game_menu.cc

    r9110 r9235  
    4040
    4141#include "network_manager.h"
     42
     43#include "preferences.h"
    4244
    4345//! This creates a Factory to fabricate a GameMenu
     
    126128  this->levelsBox = NULL;
    127129  this->networkBox = NULL;
    128  
     130
    129131  this->clientNetworkBox = NULL;
    130132  this->serverNetworkBox = NULL;
     
    239241    {
    240242      OrxGui::GLGuiBox * box = new OrxGui::GLGuiBox();
    241      
     243
    242244      OrxGui::GLGuiButton* clientButton = new OrxGui::GLGuiPushButton("Client");
    243245      box->pack(clientButton);
     
    247249      box->pack(serverButton);
    248250      serverButton->connect(SIGNAL(serverButton, released), this, SLOT(GameMenu, showServerMenu));
    249      
     251
    250252      networkBox->pack( box );
    251253    }
     
    340342  OrxGui::GLGuiHandler::getInstance()->activateCursor();
    341343  OrxGui::GLGuiHandler::getInstance()->activate();
    342   OrxGui::GLGuiHandler::getInstance()->cursor()->loadTextureSequence(ResourceManager::getInstance()->getDataDir() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);
    343344
    344345  /* now call the underlying*/
     
    518519    //this->serverNetworkBox = NULL;
    519520  }
    520  
     521
    521522  if ( !this->clientNetworkBox )
    522523  {
     
    526527      text->setText( "Host:" );
    527528      this->clientNetworkBox->pack( text );
    528      
     529
    529530      this->ipInputLine = new OrxGui::GLGuiInputLine( );
    530       this->ipInputLine->setText( "tardis-d08" );
     531      this->ipInputLine->setText( Preferences::getInstance()->getString( "multiplayer", "lastVisitedServer", "localhost" ) );
    531532      this->clientNetworkBox->pack( this->ipInputLine );
    532533      this->ipInputLine->connect(SIGNAL(ipInputLine, enterPushed), this, SLOT(GameMenu, connectToServer));
    533534      this->ipInputLine->select();
    534      
     535
    535536      OrxGui::GLGuiButton* connectButton = new OrxGui::GLGuiPushButton("Connect");
    536537      clientNetworkBox->pack(connectButton);
     
    538539    }
    539540  }
    540  
     541
    541542  this->networkBox->pack( this->clientNetworkBox );
    542  
     543
    543544  this->clientNetworkBox->showAll();
    544  
     545
    545546  //this->clientNetworkBox->setAbsCoor2D( 300.0f, 100.0f );
    546547}
     
    558559    //this->clientNetworkBox = NULL;
    559560  }
    560  
     561
    561562  if ( !this->serverNetworkBox )
    562563  {
     
    566567      text->setText( "Map:" );
    567568      this->serverNetworkBox->pack( text );
    568      
     569
    569570      OrxGui::GLGuiText * text2 = new OrxGui::GLGuiText();
    570571      text2->setText( "Multiplayer TeamDeathMatch Arena" );
    571572      this->serverNetworkBox->pack( text2 );
    572      
     573
    573574      OrxGui::GLGuiButton* createButton = new OrxGui::GLGuiPushButton("Create Server");
    574575      serverNetworkBox->pack(createButton);
     
    576577    }
    577578  }
    578  
     579
    579580  this->networkBox->pack( this->serverNetworkBox );
    580  
     581
    581582  this->serverNetworkBox->showAll();
    582  
     583
    583584  //this->serverNetworkBox->setAbsCoor2D( 300.0f, 100.0f );
    584585}
     
    590591{
    591592  PRINTF(0)("Connecting to %s\n", this->ipInputLine->_getText().c_str() );
    592  
     593
    593594  State::setOnline(true);
    594595  NetworkManager::getInstance()->establishConnection( this->ipInputLine->_getText(), 9999 );
    595  
     596
     597  Preferences::getInstance()->setString( "multiplayer", "lastVisitedServer", this->ipInputLine->_getText() );
     598
    596599  this->startLevel( 5 );
    597600}
     
    600603{
    601604  PRINTF(0)("Create server\n" );
    602  
     605
    603606  State::setOnline(true);
    604607  NetworkManager::getInstance()->createServer( 9999 );
    605  
     608
    606609  this->startLevel( 5 );
    607610}
Note: See TracChangeset for help on using the changeset viewer.