Changeset 11253
- Timestamp:
- Oct 31, 2016, 2:07:50 PM (8 years ago)
- Location:
- code/branches/HUD_HS16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/data/defaultConfig/keybindings.ini
r11252 r11253 70 70 KeyNoConvert= 71 71 KeyNumLock= 72 KeyNumRow0="useUnusePickup "73 KeyNumRow1= 74 KeyNumRow2= 75 KeyNumRow3= 76 KeyNumRow4= 77 KeyNumRow5= 78 KeyNumRow6= 79 KeyNumRow7= 80 KeyNumRow8= 81 KeyNumRow9= 82 KeyNumpad0="useUnusePickup "83 KeyNumpad1= 84 KeyNumpad2= 85 KeyNumpad3= 86 KeyNumpad4= 87 KeyNumpad5= 88 KeyNumpad6= 89 KeyNumpad7= 90 KeyNumpad8= 91 KeyNumpad9= 72 KeyNumRow0="useUnusePickup 0" 73 KeyNumRow1="useUnusePickup 1" 74 KeyNumRow2="useUnusePickup 2" 75 KeyNumRow3="useUnusePickup 3" 76 KeyNumRow4="useUnusePickup 4" 77 KeyNumRow5="useUnusePickup 5" 78 KeyNumRow6="useUnusePickup 6" 79 KeyNumRow7="useUnusePickup 7" 80 KeyNumRow8="useUnusePickup 8" 81 KeyNumRow9="useUnusePickup 9" 82 KeyNumpad0="useUnusePickup 0" 83 KeyNumpad1="useUnusePickup 1" 84 KeyNumpad2="useUnusePickup 2" 85 KeyNumpad3="useUnusePickup 3" 86 KeyNumpad4="useUnusePickup 4" 87 KeyNumpad5="useUnusePickup 5" 88 KeyNumpad6="useUnusePickup 6" 89 KeyNumpad7="useUnusePickup 7" 90 KeyNumpad8="useUnusePickup 8" 91 KeyNumpad9="useUnusePickup 9" 92 92 KeyNumpadAdd= 93 93 KeyNumpadComma= -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11252 r11253 67 67 RegisterAbstractClass(PickupManager).inheritsFrom<PickupListener>(); 68 68 69 SetConsoleCommand 2("useUnusePickup", &PickupManager::useUnusePickup).addShortcut().setActive(true);69 SetConsoleCommand("useUnusePickup", &PickupManager::useUnusePickup).addShortcut().setActive(true); 70 70 71 71 // SetConsoleCommand("HumanController", "fire", &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold); … … 378 378 //This function is called by the command line or by the key binding 379 379 //it uses or unuses the pickup, depending on its current state 380 void PickupManager::useUnusePickup() //uint32_t index 381 { 382 // orxout() << "Hello there i was here " << index << endl; 383 orxout() << "Hello there i was here " << endl; 384 // Pickupable* pickup=pickups_.find(index)->second; 385 // if(pickup==nullptr) return; //pickup does not exist 386 387 // if(pickup->used) 388 // usePickup(pickup, false); 389 // else 390 // usePickup(pickup, true); 380 void PickupManager::useUnusePickup(uint32_t index) //uint32_t index 381 { 382 orxout() << "Hello there I was here " << index << endl; 383 384 PickupManager& manager = PickupManager::getInstance(); 385 386 Pickupable* pickup=manager.pickups_.find(index)->second; 387 if(pickup==nullptr) 388 { 389 orxout() << "The pickup does not exist." << endl; 390 return; //pickup does not exist 391 } 392 393 orxout() << "The pickup is being used: " << pickup->isUsed() << endl; 394 395 if(pickup->isUsed()) 396 manager.usePickup(index, false); 397 else 398 manager.usePickup(index, true); 391 399 } 392 400 -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.h
r11252 r11253 135 135 136 136 void dropPickup(uint32_t pickup); //!< Drop the input Pickupable. 137 //void useUnusePickup(uint32_t index); 138 void useUnusePickup(); //tolua_export 137 static void useUnusePickup(uint32_t index); //tolua_export 139 138 void usePickup(uint32_t pickup, bool use); //!< Use (or unuse) the input Pickupable. 140 139 /**
Note: See TracChangeset
for help on using the changeset viewer.