Changeset 9029 in orxonox.OLD for branches/multi_player_map/src
- Timestamp:
- Jul 3, 2006, 12:22:30 PM (19 years ago)
- Location:
- branches/multi_player_map/src/story_entities/menu
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/multi_player_map/src/story_entities/menu/game_menu.cc
r8742 r9029 36 36 #include "glgui.h" 37 37 #include "menu/glgui_imagebutton.h" 38 39 #include "glgui_text.h" 38 40 39 41 //! This creates a Factory to fabricate a GameMenu … … 122 124 this->levelsBox = NULL; 123 125 this->networkBox = NULL; 126 127 this->clientNetworkBox = NULL; 128 this->serverNetworkBox = NULL; 124 129 125 130 this->optionsBox = NULL; … … 224 229 OrxGui::GLGuiButton* clientButton = new OrxGui::GLGuiPushButton("Client"); 225 230 networkBox->pack(clientButton); 231 clientButton->connect(SIGNAL(clientButton, released), this, SLOT(GameMenu, showClientMenu)); 226 232 227 233 OrxGui::GLGuiButton* serverButton = new OrxGui::GLGuiPushButton("Server"); 228 234 networkBox->pack(serverButton); 235 serverButton->connect(SIGNAL(serverButton, released), this, SLOT(GameMenu, showServerMenu)); 229 236 230 237 … … 481 488 } 482 489 483 484 490 /** 491 * show controls to join network game 492 */ 493 void GameMenu::showClientMenu( ) 494 { 495 if ( this->serverNetworkBox ) 496 { 497 delete this->serverNetworkBox; 498 this->serverNetworkBox = NULL; 499 } 500 501 if ( !this->clientNetworkBox ) 502 { 503 this->clientNetworkBox = new OrxGui::GLGuiBox(); 504 { 505 OrxGui::GLGuiText * text = new OrxGui::GLGuiText(); 506 text->setText( "Host:" ); 507 this->clientNetworkBox->pack( text ); 508 509 this->ipInputLine = new OrxGui::GLGuiInputLine( ); 510 this->clientNetworkBox->pack( this->ipInputLine ); 511 this->ipInputLine->connect(SIGNAL(ipInputLine, enterPushed), this, SLOT(GameMenu, connectToServer)); 512 this->ipInputLine->select(); 513 514 OrxGui::GLGuiButton* connectButton = new OrxGui::GLGuiPushButton("connect to server"); 515 clientNetworkBox->pack(connectButton); 516 connectButton->connect(SIGNAL(connectButton, released), this, SLOT(GameMenu, connectToServer)); 517 } 518 } 519 520 this->clientNetworkBox->showAll(); 521 522 this->clientNetworkBox->setAbsCoor2D( 300.0f, 100.0f ); 523 } 524 525 /** 526 * show controls to create new network game 527 */ 528 void GameMenu::showServerMenu( ) 529 { 530 if ( this->clientNetworkBox ) 531 { 532 delete this->clientNetworkBox; 533 this->clientNetworkBox = NULL; 534 } 535 536 if ( !this->serverNetworkBox ) 537 { 538 this->serverNetworkBox = new OrxGui::GLGuiBox(); 539 { 540 OrxGui::GLGuiText * text = new OrxGui::GLGuiText(); 541 text->setText( "Map:" ); 542 this->serverNetworkBox->pack( text ); 543 544 OrxGui::GLGuiText * text2 = new OrxGui::GLGuiText(); 545 text2->setText( "Multiplayer TeamDeathMatch Arena" ); 546 this->serverNetworkBox->pack( text2 ); 547 548 OrxGui::GLGuiButton* createButton = new OrxGui::GLGuiPushButton("create server"); 549 serverNetworkBox->pack(createButton); 550 createButton->connect(SIGNAL(createButton, released), this, SLOT(GameMenu, createServer)); 551 } 552 } 553 554 this->serverNetworkBox->showAll(); 555 556 this->serverNetworkBox->setAbsCoor2D( 300.0f, 100.0f ); 557 } 558 559 /** 560 * connect to host 561 */ 562 void GameMenu::connectToServer( ) 563 { 564 PRINTF(0)("Connecting to %s\n", this->ipInputLine->_getText().c_str() ); 565 566 //TODO connect :D 567 } 568 569 void GameMenu::createServer( ) 570 { 571 PRINTF(0)("Create server\n" ); 572 573 //TODO create server :D 574 } 575 576 577 -
branches/multi_player_map/src/story_entities/menu/game_menu.h
r8717 r9029 45 45 void showMultiPlayer(); 46 46 void showOptionsMenu(); 47 48 void showClientMenu(); 49 void connectToServer(); 50 51 void showServerMenu(); 52 void createServer(); 47 53 48 54 … … 63 69 void setSelectorSound(const std::string& selectorSound); 64 70 71 72 65 73 66 74 private: … … 68 76 OrxGui::GLGuiBox* levelsBox; 69 77 OrxGui::GLGuiBox* networkBox; 78 79 OrxGui::GLGuiBox* clientNetworkBox; 80 OrxGui::GLGuiInputLine* ipInputLine; 81 82 OrxGui::GLGuiBox* serverNetworkBox; 70 83 71 84 OrxGui::GLGuiBox* optionsBox;
Note: See TracChangeset
for help on using the changeset viewer.