Changeset 11253 for code/branches/HUD_HS16/src/modules/pickup
- Timestamp:
- Oct 31, 2016, 2:07:50 PM (8 years ago)
- Location:
- code/branches/HUD_HS16/src/modules/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.