Changeset 8708 in orxonox.OLD for trunk/src/util
- Timestamp:
- Jun 22, 2006, 12:48:01 PM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/multiplayer_team_deathmatch.cc
r8623 r8708 43 43 44 44 #include "story_entity.h" 45 46 #include "shell_command.h" 45 47 46 48 … … 80 82 81 83 subscribeEvent( ES_GAME, SDLK_o ); 84 subscribeEvent( ES_GAME, SDLK_TAB ); 85 86 this->notifier = new OrxGui::GLGuiNotifier(); 87 this->notifier->show(); 88 this->notifier->setAbsCoor2D(5, 30); 89 this->notifier->setFadeAge( 6.0 ); 90 this->notifier->setHideAge( 8.0 ); 91 this->input = new OrxGui::GLGuiInputLine(); 92 this->input->setAbsCoor2D(180, 5); 93 this->input->connect(SIGNAL(input, enterPushed), this, SLOT(MultiplayerTeamDeathmatch, onInputEnter)); 82 94 } 83 95 … … 91 103 92 104 unsubscribeEvent( ES_GAME, SDLK_o ); 105 unsubscribeEvent( ES_GAME, SDLK_TAB ); 106 107 if ( this->notifier ) 108 { 109 delete this->notifier; 110 this->notifier = NULL; 111 } 112 113 if ( this->input ) 114 { 115 delete this->input; 116 this->input = NULL; 117 } 93 118 } 94 119 … … 539 564 this->bShowTeamChange = true; 540 565 } 566 else if ( event.type == SDLK_TAB ) 567 { 568 if ( !event.bPressed ) 569 { 570 EventHandler::getInstance()->pushState( ES_MENU ); 571 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 572 OrxGui::GLGuiHandler::getInstance()->deactivateCursor(); 573 input->show(); 574 input->giveFocus(); 575 input->setText("say "); 576 } 577 } 541 578 } 542 579 … … 563 600 } 564 601 565 PRINTF(0)("CHATMESSAGE %s: %s\n", name.c_str(), message.c_str() ); 566 } 567 568 569 570 602 PRINTF(0)("CHATMESSAGE %s (%d): %s\n", name.c_str(), userId, message.c_str() ); 603 notifier->pushNotifyMessage(name + ": " + message); 604 } 605 606 void MultiplayerTeamDeathmatch::onInputEnter( const std::string & text ) 607 { 608 EventHandler::getInstance()->popState(); 609 input->breakFocus(); 610 input->hide(); 611 input->setText(""); 612 613 std::string command = text; 614 615 //HACK insert " in say commands so user doesn't have to type them 616 if ( command.length() >= 4 && command[0] == 's' && command[1] == 'a' && command[2] == 'y' && command[3] == ' ' ) 617 { 618 command.insert( 4, "\"" ); 619 command = command + "\""; 620 } 621 622 OrxShell::ShellCommand::execute( command ); 623 } 624 625 626 627 -
trunk/src/util/multiplayer_team_deathmatch.h
r8623 r8708 13 13 14 14 #include "glgui.h" 15 #include "specials/glgui_notifier.h" 15 16 16 17 class TiXmlElement; … … 82 83 OrxGui::GLGuiBox* box; 83 84 85 OrxGui::GLGuiNotifier* notifier; 86 OrxGui::GLGuiInputLine* input; 87 84 88 void calculateTeamScore(); 85 89 void nextGameState(); … … 94 98 void onButtonCancel(); 95 99 void onButtonExit(); 100 101 void onInputEnter( const std::string & text ); 96 102 }; 97 103
Note: See TracChangeset
for help on using the changeset viewer.