Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2006, 3:38:37 PM (18 years ago)
Author:
rennerc
Message:

mini shell works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/util/multiplayer_team_deathmatch.cc

    r8623 r8635  
    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->input = new OrxGui::GLGuiInputLine();
     90  this->input->connect(SIGNAL(input, enterPushed), this, SLOT(MultiplayerTeamDeathmatch, onInputEnter));
    8291}
    8392
     
    91100 
    92101  unsubscribeEvent( ES_GAME, SDLK_o );
     102  unsubscribeEvent( ES_GAME, SDLK_TAB );
     103 
     104  if ( this->notifier )
     105  {
     106    delete this->notifier;
     107    this->notifier = NULL;
     108  }
     109 
     110  if ( this->input )
     111  {
     112    delete this->input;
     113    this->input = NULL;
     114  }
    93115}
    94116
     
    539561      this->bShowTeamChange = true;
    540562  }
     563  else if ( event.type == SDLK_TAB )
     564  {
     565    if ( !event.bPressed )
     566    {
     567      EventHandler::getInstance()->pushState( ES_MENU );
     568      OrxGui::GLGuiHandler::getInstance()->activateCursor();
     569      OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
     570      input->show();
     571      input->giveFocus();
     572      input->setText("say ");
     573    }
     574  }
    541575}
    542576
     
    564598 
    565599  PRINTF(0)("CHATMESSAGE %s: %s\n", name.c_str(), message.c_str() );
    566 }
    567 
    568 
    569 
    570 
     600  notifier->pushNotifyMessage(name + ": " + message);
     601}
     602
     603void MultiplayerTeamDeathmatch::onInputEnter( const std::string & text )
     604{
     605  EventHandler::getInstance()->popState();
     606  input->breakFocus();
     607  input->hide();
     608  input->setText("");
     609 
     610  OrxShell::ShellCommand::execute( text );
     611}
     612
     613
     614
     615
Note: See TracChangeset for help on using the changeset viewer.