Changeset 9235 in orxonox.OLD for trunk/src/story_entities/menu
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/menu/game_menu.cc
r9110 r9235 40 40 41 41 #include "network_manager.h" 42 43 #include "preferences.h" 42 44 43 45 //! This creates a Factory to fabricate a GameMenu … … 126 128 this->levelsBox = NULL; 127 129 this->networkBox = NULL; 128 130 129 131 this->clientNetworkBox = NULL; 130 132 this->serverNetworkBox = NULL; … … 239 241 { 240 242 OrxGui::GLGuiBox * box = new OrxGui::GLGuiBox(); 241 243 242 244 OrxGui::GLGuiButton* clientButton = new OrxGui::GLGuiPushButton("Client"); 243 245 box->pack(clientButton); … … 247 249 box->pack(serverButton); 248 250 serverButton->connect(SIGNAL(serverButton, released), this, SLOT(GameMenu, showServerMenu)); 249 251 250 252 networkBox->pack( box ); 251 253 } … … 340 342 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 341 343 OrxGui::GLGuiHandler::getInstance()->activate(); 342 OrxGui::GLGuiHandler::getInstance()->cursor()->loadTextureSequence(ResourceManager::getInstance()->getDataDir() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);343 344 344 345 /* now call the underlying*/ … … 518 519 //this->serverNetworkBox = NULL; 519 520 } 520 521 521 522 if ( !this->clientNetworkBox ) 522 523 { … … 526 527 text->setText( "Host:" ); 527 528 this->clientNetworkBox->pack( text ); 528 529 529 530 this->ipInputLine = new OrxGui::GLGuiInputLine( ); 530 this->ipInputLine->setText( "tardis-d08");531 this->ipInputLine->setText( Preferences::getInstance()->getString( "multiplayer", "lastVisitedServer", "localhost" ) ); 531 532 this->clientNetworkBox->pack( this->ipInputLine ); 532 533 this->ipInputLine->connect(SIGNAL(ipInputLine, enterPushed), this, SLOT(GameMenu, connectToServer)); 533 534 this->ipInputLine->select(); 534 535 535 536 OrxGui::GLGuiButton* connectButton = new OrxGui::GLGuiPushButton("Connect"); 536 537 clientNetworkBox->pack(connectButton); … … 538 539 } 539 540 } 540 541 541 542 this->networkBox->pack( this->clientNetworkBox ); 542 543 543 544 this->clientNetworkBox->showAll(); 544 545 545 546 //this->clientNetworkBox->setAbsCoor2D( 300.0f, 100.0f ); 546 547 } … … 558 559 //this->clientNetworkBox = NULL; 559 560 } 560 561 561 562 if ( !this->serverNetworkBox ) 562 563 { … … 566 567 text->setText( "Map:" ); 567 568 this->serverNetworkBox->pack( text ); 568 569 569 570 OrxGui::GLGuiText * text2 = new OrxGui::GLGuiText(); 570 571 text2->setText( "Multiplayer TeamDeathMatch Arena" ); 571 572 this->serverNetworkBox->pack( text2 ); 572 573 573 574 OrxGui::GLGuiButton* createButton = new OrxGui::GLGuiPushButton("Create Server"); 574 575 serverNetworkBox->pack(createButton); … … 576 577 } 577 578 } 578 579 579 580 this->networkBox->pack( this->serverNetworkBox ); 580 581 581 582 this->serverNetworkBox->showAll(); 582 583 583 584 //this->serverNetworkBox->setAbsCoor2D( 300.0f, 100.0f ); 584 585 } … … 590 591 { 591 592 PRINTF(0)("Connecting to %s\n", this->ipInputLine->_getText().c_str() ); 592 593 593 594 State::setOnline(true); 594 595 NetworkManager::getInstance()->establishConnection( this->ipInputLine->_getText(), 9999 ); 595 596 597 Preferences::getInstance()->setString( "multiplayer", "lastVisitedServer", this->ipInputLine->_getText() ); 598 596 599 this->startLevel( 5 ); 597 600 } … … 600 603 { 601 604 PRINTF(0)("Create server\n" ); 602 605 603 606 State::setOnline(true); 604 607 NetworkManager::getInstance()->createServer( 9999 ); 605 608 606 609 this->startLevel( 5 ); 607 610 }
Note: See TracChangeset
for help on using the changeset viewer.