Changeset 11252 for code/branches/HUD_HS16
- Timestamp:
- Oct 31, 2016, 1:02:46 PM (8 years ago)
- Location:
- code/branches/HUD_HS16
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/data/defaultConfig/keybindings.ini
r10622 r11252 70 70 KeyNoConvert= 71 71 KeyNumLock= 72 KeyNumRow0= 73 KeyNumRow1= "toggleFormationFlight"74 KeyNumRow2= "FFChangeMode"72 KeyNumRow0="useUnusePickup" 73 KeyNumRow1= 74 KeyNumRow2= 75 75 KeyNumRow3= 76 76 KeyNumRow4= … … 80 80 KeyNumRow8= 81 81 KeyNumRow9= 82 KeyNumpad0= 82 KeyNumpad0="useUnusePickup" 83 83 KeyNumpad1= 84 84 KeyNumpad2= … … 96 96 KeyNumpadPeriod= 97 97 KeyNumpadSubtract= 98 KeyO= 99 KeyP= 98 KeyO="toggleFormationFlight" 99 KeyP="FFChangeMode" 100 100 KeyPageDown="scale -1 rotateRoll" 101 101 KeyPageUp= -
code/branches/HUD_HS16/data/gui/scripts/KeyBindMenu.lua
r8232 r11252 36 36 table.insert(commandList, "pause") 37 37 table.insert(commandList, "printScreen") 38 table.insert(commandList, "useUnusePickup") 38 39 if orxonox.GUIManager:inDevMode() then 39 40 table.insert(commandList, "printScreenHD") … … 71 72 table.insert(nameList, "Pause") 72 73 table.insert(nameList, "Screenshot") 74 table.insert(nameList, "Pickup 0") 73 75 if orxonox.GUIManager:inDevMode() then 74 76 table.insert(nameList, "HD screenshot") -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11241 r11252 43 43 #include "core/input/KeyBinderManager.h" //for keybinding 44 44 #include "core/input/KeyBinder.h" //for keybinding 45 #include "core/command/ConsoleCommandIncludes.h" 45 46 46 47 #include "infos/PlayerInfo.h" … … 66 67 RegisterAbstractClass(PickupManager).inheritsFrom<PickupListener>(); 67 68 69 SetConsoleCommand2("useUnusePickup", &PickupManager::useUnusePickup).addShortcut().setActive(true); 70 71 // SetConsoleCommand("HumanController", "fire", &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold); 68 72 /** 69 73 @brief … … 290 294 this->pickups_[index] = pickup; 291 295 292 //Add pickup keybinding293 if( KeyBinderManager::exists() )294 addKeyBindingForNewPickup(pickup, index);295 else296 orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl;296 // //Add pickup keybinding 297 // if( KeyBinderManager::exists() ) 298 // addKeyBindingForNewPickup(pickup, index); 299 // else 300 // orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl; 297 301 } 298 302 else // If it was dropped, it is removed from the required lists. … … 302 306 index = it->second; 303 307 304 // Remove pickup keybinding305 if( KeyBinderManager::exists() )306 removeKeyBindingForOldPickup(pickup, index);307 else308 orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl;308 // //Remove pickup keybinding 309 // if( KeyBinderManager::exists() ) 310 // removeKeyBindingForOldPickup(pickup, index); 311 // else 312 // orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl; 309 313 310 314 // Remove the Pickupable from the indexes_ and pickups_ list. 311 315 this->indexes_.erase(pickup); 312 this->pickups_.find(index)->second=nullptr; //set to null, so that can be i ndentified as free slot by getPickupIndex()316 this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex() 313 317 } 314 318 … … 339 343 340 344 //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9 341 //FUNCTION: Adds a keybinding for the new pickup using its index 342 void PickupManager::addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index) 343 { 344 std::string name="Keys.KeyNumpad"; 345 std::string binding=""; 346 347 name.append(std::to_string(index)); 348 349 KeyBinderManager::getInstance().getCurrent()->setBinding("KeyESC", name, true); // TODO do not set all bindings to ESC 350 351 orxout() << "Keybinding for item " << index << " has been added on keybinding " << name << endl; 352 353 354 } 345 //FUNCTION: Adds a keybinding for the new pickup using its index and sets a console command 346 // void PickupManager::addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index) 347 // { 348 // std::string name="Keys.KeyNumpad"; 349 // std::string binding="useOrUnusePickup"; 350 351 // name.append(std::to_string(index)); 352 // binding.append(std::to_string(index)); 353 354 // SetConsoleCommand(binding, &PickupManager::useUnusePickup(pickup, index)); 355 // KeyBinderManager::getInstance().getCurrent()->setBinding(binding, name, true); 356 357 // orxout() << "Keybinding for item " << index << " has been added on keybinding " << name << endl; 358 359 360 // } 355 361 356 362 //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9 357 363 //FUNCTION: Removes the keybinding of the pickup using its index 358 void PickupManager::removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index) 359 { 360 std::string name="Keys.KeyNumpad"; 361 std::string binding=""; 362 363 name.append(std::to_string(index)); 364 365 KeyBinderManager::getInstance().getCurrent()->setBinding("", name, true); 366 367 orxout() << "Keybinding for item " << index << " has been removed on keybinding " << name << endl; 368 369 } 364 // void PickupManager::removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index) 365 // { 366 // std::string name="Keys.KeyNumpad"; 367 // std::string binding=""; 368 369 // name.append(std::to_string(index)); 370 371 // SetConsoleCommand(binding, nullptr); 372 // KeyBinderManager::getInstance().getCurrent()->setBinding("", name, true); 373 374 // orxout() << "Keybinding for item " << index << " has been removed on keybinding " << name << endl; 375 376 // } 377 378 //This function is called by the command line or by the key binding 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); 391 } 392 370 393 371 394 /** -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.h
r11241 r11252 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 139 void usePickup(uint32_t pickup, bool use); //!< Use (or unuse) the input Pickupable. 138 140 /** -
code/branches/HUD_HS16/src/orxonox/controllers/HumanController.h
r11071 r11252 69 69 void stopBoosting(void); 70 70 71 72 71 static void greet(); 73 72 static void switchCamera();
Note: See TracChangeset
for help on using the changeset viewer.