Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 17, 2016, 4:35:27 PM (8 years ago)
Author:
patricwi
Message:

Key binding added when user picks up an item(pickup).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc

    r11099 r11240  
    4141#include "network/Host.h"
    4242#include "network/NetworkFunctionIncludes.h"
     43#include "core/input/KeyBinderManager.h"    //for keybinding
     44#include "core/input/KeyBinder.h"           //for keybinding
    4345
    4446#include "infos/PlayerInfo.h"
     
    7476        this->defaultRepresentation_ = new PickupRepresentation();
    7577
    76         orxout(internal_info, context::pickups) << "PickupManager created." << endl;
     78        orxout() << "PickupManager created." << endl;
    7779    }
    7880
     
    287289            this->indexes_[pickup] = index;
    288290            this->pickups_[index] = pickup;
     291            // TODO: Add pickup keybinding -------------------------------------------
     292            if( KeyBinderManager::exists() )
     293                KeyBinderManager::getInstance().getCurrent()->setBinding("KeyESC", "Keys.KeyNumpad0",true);
     294            else
     295                orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl;
     296            //----------------------------
     297
    289298        }
    290299        else // If it was dropped, it is removed from the required lists.
     
    297306            this->indexes_.erase(it);
    298307            this->pickups_.erase(index);
     308            // TODO: Remove pickup keybinding ------------------------------------
     309            if( KeyBinderManager::exists() )
     310                  KeyBinderManager::getInstance().getCurrent()->setBinding("", "Keys.KeyNumpad0",true);
     311            else
     312                orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl;
     313            //----------------------------
    299314        }
    300315
Note: See TracChangeset for help on using the changeset viewer.