Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8635 in orxonox.OLD


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

mini shell works

Location:
branches/network/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/message_manager.cc

    r8623 r8635  
    328328
    329329      it->second.messages.push_back( msg );
    330      
    331      
    332330    }
    333331  }
  • 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
  • branches/network/src/util/multiplayer_team_deathmatch.h

    r8623 r8635  
    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.