Changeset 11305 for code/branches/HUD_HS16/src/modules/pickup
- Timestamp:
- Nov 21, 2016, 4:18:45 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
r11277 r11305 51 51 #include "CollectiblePickup.h" 52 52 #include "PickupRepresentation.h" 53 //#include "overlays/hud/HUDPickupSystem.h"53 #include "overlays/hud/HUDPickupSystem.h" 54 54 55 55 namespace orxonox … … 70 70 SetConsoleCommand("useUnusePickup", &PickupManager::useUnusePickup).addShortcut().setActive(true); 71 71 72 // SetConsoleCommand("HumanController", "fire", &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold);73 72 /** 74 73 @brief … … 82 81 83 82 orxout(internal_info, context::pickups) << "PickupManager created." << endl; 83 } 84 85 void PickupManager::setPickupSystem(HUDPickupSystem* system) 86 { 87 pickupSystem=system; 84 88 } 85 89 … … 295 299 this->pickups_[index] = pickup; 296 300 297 // //Add pickup keybinding 298 // if( KeyBinderManager::exists() ) 299 // addKeyBindingForNewPickup(pickup, index); 300 // else 301 // orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl; 301 //TODO 302 std::vector<Pickupable*> picks; 303 304 PickupManager& manager = PickupManager::getInstance(); 305 306 Pickupable* pickup = nullptr; 307 308 for(uint32_t i = 0; i!=10; i++) 309 { 310 pickup=manager.pickups_.find(i)->second; 311 picks.push_back(pickup); 312 } 313 // pickupSystem->updatePickupList(picks); 314 302 315 } 303 316 else // If it was dropped, it is removed from the required lists. … … 307 320 index = it->second; 308 321 309 // //Remove pickup keybinding 310 // if( KeyBinderManager::exists() ) 311 // removeKeyBindingForOldPickup(pickup, index); 312 // else 313 // orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl; 314 315 // Remove the Pickupable from the indexes_ and pickups_ list. 322 316 323 this->indexes_.erase(pickup); 317 324 this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex() … … 342 349 343 350 } 344 345 //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9346 //FUNCTION: Adds a keybinding for the new pickup using its index and sets a console command347 // void PickupManager::addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index)348 // {349 // std::string name="Keys.KeyNumpad";350 // std::string binding="useOrUnusePickup";351 352 // name.append(std::to_string(index));353 // binding.append(std::to_string(index));354 355 // SetConsoleCommand(binding, &PickupManager::useUnusePickup(pickup, index));356 // KeyBinderManager::getInstance().getCurrent()->setBinding(binding, name, true);357 358 // orxout() << "Keybinding for item " << index << " has been added on keybinding " << name << endl;359 360 361 // }362 363 //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9364 //FUNCTION: Removes the keybinding of the pickup using its index365 // void PickupManager::removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index)366 // {367 // std::string name="Keys.KeyNumpad";368 // std::string binding="";369 370 // name.append(std::to_string(index));371 372 // SetConsoleCommand(binding, nullptr);373 // KeyBinderManager::getInstance().getCurrent()->setBinding("", name, true);374 375 // orxout() << "Keybinding for item " << index << " has been removed on keybinding " << name << endl;376 377 // }378 351 379 352 //This function is called by the command line or by the key binding -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.h
r11253 r11305 45 45 #include "util/Singleton.h" 46 46 #include "interfaces/PickupListener.h" 47 #include "overlays/hud/HUDPickupSystem.h" 47 48 48 49 namespace orxonox // tolua_export … … 148 149 static void dropPickupNetworked(uint32_t pickup); //!< Helper method to drop the input pickup on the server. 149 150 static void usePickupNetworked(uint32_t pickup, bool use); //!< Helper method to use (or unuse) the input Pickupable on the server. 151 void setPickupSystem(HUDPickupSystem* system); 150 152 151 153 private: 154 HUDPickupSystem* pickupSystem; 152 155 static PickupManager* singletonPtr_s; 153 156 static const std::string guiName_s; //!< The name of the PickupInventory
Note: See TracChangeset
for help on using the changeset viewer.