Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6998 in orxonox.OLD for trunk


Ignore:
Timestamp:
Feb 3, 2006, 12:29:57 AM (19 years ago)
Author:
bensch
Message:

trunk: more button definitions

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/globals.h

    r6997 r6998  
    7474#define   CONFIG_NAME_PLAYER_ROLL_RIGHT    "RollR"
    7575#define   CONFIG_NAME_PLAYER_ROLL_LEFT     "RollL"
     76#define   CONFIG_NAME_PLAYER_UP            "Up"
     77#define   CONFIG_NAME_PLAYER_DOWN          "Down"
    7678
    7779#define   CONFIG_NAME_PLAYER_FIRE          "Fire"
    7880#define   CONFIG_NAME_PLAYER_NEXT_WEAPON   "Next"
    7981#define   CONFIG_NAME_PLAYER_PREV_WEAPON   "Prev"
     82#define   CONFIG_NAME_PLAYER_CHANGE_SHIP   "Change_Ship"
     83
    8084#define   CONFIG_NAME_QUIT                 "Quit"
    8185#define   CONFIG_NAME_PAUSE                "Pause"
  • trunk/src/lib/event/key_mapper.cc

    r6997 r6998  
    3737int KeyMapper::PEV_LEFT              = EV_UNKNOWN;
    3838int KeyMapper::PEV_RIGHT             = EV_UNKNOWN;
     39int KeyMapper::PEV_UP                = EV_UNKNOWN;
     40int KeyMapper::PEV_DOWN              = EV_UNKNOWN;
    3941int KeyMapper::PEV_ROLL_LEFT         = EV_UNKNOWN;
    4042int KeyMapper::PEV_ROLL_RIGHT        = EV_UNKNOWN;
     
    4648int KeyMapper::PEV_PREVIOUS_WEAPON   = EV_UNKNOWN;
    4749int KeyMapper::PEV_NEXT_WEAPON       = EV_UNKNOWN;
     50
     51int KeyMapper::PEV_CHANGE_SHIP       = EV_UNKNOWN;
    4852
    4953int KeyMapper::PEV_VIEW0             = EV_UNKNOWN;
     
    6771 */
    6872orxKeyMapping map[] = {
    69   {&KeyMapper::PEV_FORWARD,                   CONFIG_NAME_PLAYER_FORWARD},
    70   {&KeyMapper::PEV_BACKWARD,                 CONFIG_NAME_PLAYER_BACKWARD},
     73  {&KeyMapper::PEV_FORWARD,              CONFIG_NAME_PLAYER_FORWARD},
     74  {&KeyMapper::PEV_BACKWARD,             CONFIG_NAME_PLAYER_BACKWARD},
     75  {&KeyMapper::PEV_UP,                   CONFIG_NAME_PLAYER_UP},
     76  {&KeyMapper::PEV_DOWN,                 CONFIG_NAME_PLAYER_DOWN},
    7177  {&KeyMapper::PEV_LEFT,                 CONFIG_NAME_PLAYER_LEFT},
    7278  {&KeyMapper::PEV_RIGHT,                CONFIG_NAME_PLAYER_RIGHT},
     
    8187  {&KeyMapper::PEV_NEXT_WEAPON,          CONFIG_NAME_PLAYER_NEXT_WEAPON},
    8288  {&KeyMapper::PEV_PREVIOUS_WEAPON,      CONFIG_NAME_PLAYER_PREV_WEAPON},
     89
     90  {&KeyMapper::PEV_CHANGE_SHIP,          CONFIG_NAME_PLAYER_CHANGE_SHIP},
    8391
    8492
  • trunk/src/lib/event/key_mapper.h

    r6997 r6998  
    4343  static int PEV_LEFT;              //!< left button
    4444  static int PEV_RIGHT;             //!< right button
     45  static int PEV_UP;                //!< up button
     46  static int PEV_DOWN;              //!< down button
    4547
    4648  static int PEV_ROLL_LEFT;         //!< rolls left
     
    5456  static int PEV_PREVIOUS_WEAPON;   //!< prev weapon button
    5557  static int PEV_NEXT_WEAPON;       //!< next weapon button
     58
     59  static int PEV_CHANGE_SHIP;       //!< The button to change the Ship.
    5660
    5761  static int PEV_VIEW0;             //!< view 0 button
  • trunk/src/lib/gui/gtk_gui/gui_keys.cc

    r6997 r6998  
    119119        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "a"));
    120120        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "d"));
     121
     122        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "r"));
     123        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "f"));
    121124        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_ROLL_LEFT, "q"));
    122125        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_ROLL_RIGHT, "e"));
     126
    123127        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "BUTTON_LEFT"));
    124128        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m"));
    125129        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n"));
     130        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_CHANGE_SHIP, "g"));
    126131        closeButton = new Button("close");
    127132#ifdef HAVE_GTK2
  • trunk/src/world_entities/player.cc

    r6987 r6998  
    4040  this->hud.show();
    4141
    42   EventHandler::getInstance()->subscribe(this, ES_GAME, SDLK_l);
     42  EventHandler::getInstance()->subscribe(this, ES_GAME, KeyMapper::PEV_CHANGE_SHIP);
    4343}
    4444
     
    9898 void Player::process(const Event &event)
    9999 {
    100    if (event.type == SDLK_l && event.bPressed)
     100   if (event.type == KeyMapper::PEV_CHANGE_SHIP && event.bPressed)
    101101   {
    102102     /// FIXME this should be in the ObjectManager
  • trunk/src/world_entities/space_ships/hover.cc

    r6997 r6998  
    145145  registerEvent(KeyMapper::PEV_LEFT);
    146146  registerEvent(KeyMapper::PEV_RIGHT);
    147   registerEvent(SDLK_e); /// FIXME
    148   registerEvent(SDLK_c); /// FIXME
     147  registerEvent(KeyMapper::PEV_UP);
     148  registerEvent(KeyMapper::PEV_DOWN);
    149149  registerEvent(KeyMapper::PEV_FIRE1);
    150150  registerEvent(KeyMapper::PEV_NEXT_WEAPON);
     
    362362  else if( event.type == KeyMapper::PEV_RIGHT)
    363363    this->bRight = event.bPressed;
    364   else if( event.type == SDLK_e)
     364  else if( event.type == KeyMapper::PEV_UP)
    365365    this->bAscend = event.bPressed; //this->shiftCoor(0,.1,0);
    366   else if( event.type == SDLK_c)
     366  else if( event.type == KeyMapper::PEV_DOWN)
    367367    this->bDescend = event.bPressed; //this->shiftCoor(0,-.1,0);
    368368  else if( event.type == KeyMapper::PEV_FORWARD)
Note: See TracChangeset for help on using the changeset viewer.