Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10632 in orxonox.OLD


Ignore:
Timestamp:
Apr 12, 2007, 7:52:28 PM (17 years ago)
Author:
snellen
Message:

finished… testing needed

Location:
branches/inputdevice/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/inputdevice/src/defs/orxonox_globals.h

    r10618 r10632  
    8080#define   CONFIG_NAME_PLAYER_UP            "Up"
    8181#define   CONFIG_NAME_PLAYER_DOWN          "Down"
    82 
     82#define   CONFIG_NAME_PLAYER_STRAFE_LEFT   "StrafeLeft"
     83#define   CONFIG_NAME_PLAYER_STRAFE_RIGHT  "StrafeRight"
     84#define   CONFIG_NAME_PLAYER_JUMP          "Jump"
     85
     86#define   CONFIG_NAME_PLAYER_ACTION        "Action"
    8387#define   CONFIG_NAME_PLAYER_FIRE          "Fire"
     88#define   CONFIG_NAME_PLAYER_FIRE2         "Fire2"
    8489#define   CONFIG_NAME_PLAYER_NEXT_WEAPON   "Next-Weapon"
    8590#define   CONFIG_NAME_PLAYER_PREV_WEAPON   "Previous-Weapon"
  • branches/inputdevice/src/lib/event/key_mapper.cc

    r10618 r10632  
    4646int KeyMapper::PEV_STRAFE_RIGHT      = EV_UNKNOWN;
    4747int KeyMapper::PEV_JUMP              = EV_UNKNOWN;
     48int KeyMapper::PEV_ACTION            = EV_UNKNOWN;
    4849
    4950int KeyMapper::PEV_FIRE1             = EV_UNKNOWN;
     
    8283      {&KeyMapper::PEV_ROLL_RIGHT,           CONFIG_NAME_PLAYER_ROLL_LEFT,       SDLK_z},
    8384      {&KeyMapper::PEV_ROLL_LEFT,            CONFIG_NAME_PLAYER_ROLL_RIGHT,      SDLK_c},
    84       {&KeyMapper::PEV_STRAFE_LEFT,          "StrafeLeft",                       SDLK_q},
    85       {&KeyMapper::PEV_STRAFE_RIGHT,         "StrafeRight",                      SDLK_e},
    86       {&KeyMapper::PEV_JUMP,                 "Jump",                             SDLK_SPACE},
     85      {&KeyMapper::PEV_STRAFE_LEFT,          CONFIG_NAME_PLAYER_STRAFE_LEFT,     SDLK_q},
     86      {&KeyMapper::PEV_STRAFE_RIGHT,         CONFIG_NAME_PLAYER_STRAFE_RIGHT,    SDLK_e},
     87      {&KeyMapper::PEV_JUMP,                 CONFIG_NAME_PLAYER_JUMP,            SDLK_SPACE},
     88      {&KeyMapper::PEV_ACTION,               CONFIG_NAME_PLAYER_ACTION,          SDLK_u},
    8789
    8890      {&KeyMapper::PEV_FIRE1,                CONFIG_NAME_PLAYER_FIRE,            EV_MOUSE_BUTTON_LEFT},
    89       {&KeyMapper::PEV_FIRE2,                "Fire2",                            EV_MOUSE_BUTTON_RIGHT},
     91      {&KeyMapper::PEV_FIRE2,                CONFIG_NAME_PLAYER_FIRE2,           EV_MOUSE_BUTTON_RIGHT},
    9092      {&KeyMapper::PEV_NEXT_WEAPON,          CONFIG_NAME_PLAYER_NEXT_WEAPON,     EV_MOUSE_BUTTON_WHEELUP},
    9193      {&KeyMapper::PEV_PREVIOUS_WEAPON,      CONFIG_NAME_PLAYER_PREV_WEAPON,     EV_MOUSE_BUTTON_WHEELDOWN},
  • branches/inputdevice/src/lib/event/key_mapper.h

    r9869 r10632  
    5757
    5858  static int PEV_JUMP;              //!< jump
     59  static int PEV_ACTION;            //!< the action (or use) key
    5960
    6061  static int PEV_FIRE1;             //!< fire button 1
  • branches/inputdevice/src/world_entities/player.cc

    r10516 r10632  
    1717#include "playable.h"
    1818#include "space_ships/space_ship.h"
     19#include "script_triggers/action_trigger.h"
    1920
    2021#include "event_handler.h"
     
    4041
    4142  this->subscribeEvent(ES_GAME, KeyMapper::PEV_CHANGE_SHIP);
     43  this->subscribeEvent(ES_GAME, KeyMapper::PEV_ACTION);
    4244}
    4345
     
    132134    this->enterNewPlayable();
    133135  }
     136  else if(event.type == KeyMapper::PEV_ACTION && event.bPressed)
     137  {
     138   for (ObjectList<ActionTrigger>::const_iterator it = ActionTrigger::objectList().begin();
     139       it != ActionTrigger::objectList().end();
     140       ++it)
     141      (*it)->executeAction();
     142  }
    134143
    135144  if (likely(this->playable != NULL))
  • branches/inputdevice/src/world_entities/script_triggers/action_trigger.cc

    r10631 r10632  
    137137    }
    138138  }
     139
     140  actionScheduled = false;
    139141}
    140142
Note: See TracChangeset for help on using the changeset viewer.