Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8708 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Jun 22, 2006, 12:48:01 PM (19 years ago)
Author:
bensch
Message:

merged network back
merged with command:
svn merge -r8625:HEAD https://svn.orxonox.net/orxonox/branches/network .
no conflicts

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r8623 r8708  
    4343
    4444#include "story_entity.h"
     45
     46#include "shell_command.h"
    4547
    4648
     
    8082 
    8183  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));
    8294}
    8395
     
    91103 
    92104  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  }
    93118}
    94119
     
    539564      this->bShowTeamChange = true;
    540565  }
     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  }
    541578}
    542579
     
    563600  }
    564601 
    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
     606void 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  
    1313
    1414#include "glgui.h"
     15#include "specials/glgui_notifier.h"
    1516
    1617class TiXmlElement;
     
    8283    OrxGui::GLGuiBox* box;
    8384   
     85    OrxGui::GLGuiNotifier* notifier;
     86    OrxGui::GLGuiInputLine* input;
     87   
    8488    void calculateTeamScore();
    8589    void nextGameState();
     
    9498    void onButtonCancel();
    9599    void onButtonExit();
     100   
     101    void onInputEnter( const std::string & text );
    96102};
    97103
Note: See TracChangeset for help on using the changeset viewer.