Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4410 in orxonox.OLD


Ignore:
Timestamp:
May 31, 2005, 12:43:58 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: prepeared to implement all system wide commands

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4409 r4410  
    422422  orx->getLocalInput()->bind (localPlayer);
    423423
    424   this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_UP);
    425   this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_DOWN);
    426   this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_LEFT);
    427   this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_RIGHT);
     424  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
     425  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);
     426  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
     427  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
    428428 
    429429  // bind camera
  • orxonox/trunk/src/util/event/key_mapper.cc

    r4403 r4410  
    4343int KeyMapper::PEV_VIEW3 = -1;
    4444int KeyMapper::PEV_VIEW4 = -1;
    45 int KeyMapper::PEV_VIEW5 = -1;
     45int KeyMapper::PEV_VIEW5 = -1;
     46
     47int KeyMapper::PEV_NEXT_WORLD = -1;
     48int KeyMapper::PEV_PREVIOUS_WORLD = -1;
     49
     50int KeyMapper::PEV_PAUSE = -1;
     51int KeyMapper::PEV_QUIT = -1;
     52
     53
    4654
    4755
     
    6270                        {&KeyMapper::PEV_VIEW3, "view3"},
    6371                        {&KeyMapper::PEV_VIEW4, "view4"},
    64                         {&KeyMapper::PEV_VIEW5, "view5"},                       
     72                        {&KeyMapper::PEV_VIEW5, "view5"},
     73
     74                        {&KeyMapper::PEV_NEXT_WORLD, "Next-World"},
     75                        {&KeyMapper::PEV_PREVIOUS_WORLD, "Prev-World"},
     76
     77                        {&KeyMapper::PEV_PAUSE, "Pause"},
     78                        {&KeyMapper::PEV_QUIT, "Quit"},
    6579                        {NULL, NULL}};
    6680
  • orxonox/trunk/src/util/event/key_mapper.h

    r4405 r4410  
    5757  static int PEV_VIEW5;
    5858
     59  static int PEV_NEXT_WORLD;
     60  static int PEV_PREVIOUS_WORLD;
     61
     62  static int PEV_PAUSE;
     63  static int PEV_QUIT;
     64
    5965 private:
    6066  Sint32 coord[2];
  • orxonox/trunk/src/util/loading/game_loader.cc

    r4324 r4410  
    2626#include "resource_manager.h"
    2727#include "factory.h"
     28#include "event.h"
     29#include "event_handler.h"
    2830
    2931#include <string.h>
     
    256258
    257259
     260void GameLoader::process(const Event& event)
     261{
     262  if( event.type == KeyMapper::PEV_NEXT_WORLD)
     263    {
     264      if( likely(event.bPressed))
     265        {
     266          this->nextLevel();
     267        }
     268    }
     269  else if( event.type == KeyMapper::PEV_PREVIOUS_WORLD)
     270    {
     271      if( likely(event.bPressed))
     272        {
     273          this->previousLevel();
     274        }
     275    }
     276  else if( event.type == KeyMapper::PEV_PAUSE)
     277    {
     278      if( likely(event.bPressed))
     279        {
     280          if(this->isPaused)
     281            this->resume();
     282          else
     283            this->pause();
     284        }
     285    }
     286  else if( event.type == KeyMapper::PEV_QUIT)
     287    {
     288      if( event.bPressed) this->stop();
     289    }
     290}
     291
    258292/*
    259293  \brief this changes to the next level
  • orxonox/trunk/src/util/loading/game_loader.h

    r4262 r4410  
    1010#include "story_def.h"
    1111#include "comincl.h"
     12#include "event_listener.h"
    1213
    1314
     
    2223class TiXmlElement;
    2324class BaseObject;
     25class Event;
    2426
    2527//! The GameLoader
     
    3537      world. this is done by callaing those StoryEntity::start()
    3638*/
    37 class GameLoader
     39class GameLoader : public EventListener
    3840{
    3941
     
    5860  BaseObject* fabricate( TiXmlElement* data);
    5961
     62  void process(const Event &event);
     63
    6064 private:
    6165  GameLoader ();
Note: See TracChangeset for help on using the changeset viewer.