[Orxonox-commit 6600] r11240 - in code/branches/HUD_HS16/src/modules/pickup: . items

patricwi at orxonox.net patricwi at orxonox.net
Mon Oct 17 16:35:27 CEST 2016


Author: patricwi
Date: 2016-10-17 16:35:27 +0200 (Mon, 17 Oct 2016)
New Revision: 11240

Modified:
   code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
   code/branches/HUD_HS16/src/modules/pickup/items/SpeedPickup.h
Log:
Key binding added when user picks up an item(pickup).

Modified: code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	2016-10-17 14:08:32 UTC (rev 11239)
+++ code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	2016-10-17 14:35:27 UTC (rev 11240)
@@ -40,6 +40,8 @@
 #include "core/singleton/ScopedSingletonIncludes.h"
 #include "network/Host.h"
 #include "network/NetworkFunctionIncludes.h"
+#include "core/input/KeyBinderManager.h"    //for keybinding
+#include "core/input/KeyBinder.h"           //for keybinding
 
 #include "infos/PlayerInfo.h"
 #include "interfaces/PickupCarrier.h"
@@ -73,7 +75,7 @@
 
         this->defaultRepresentation_ = new PickupRepresentation();
 
-        orxout(internal_info, context::pickups) << "PickupManager created." << endl;
+        orxout() << "PickupManager created." << endl;
     }
 
     /**
@@ -286,6 +288,13 @@
             // Add the Pickupable to the indexes_ and pickups_ lists.
             this->indexes_[pickup] = index;
             this->pickups_[index] = pickup;
+            // TODO: Add pickup keybinding -------------------------------------------
+            if( KeyBinderManager::exists() )
+                KeyBinderManager::getInstance().getCurrent()->setBinding("KeyESC", "Keys.KeyNumpad0",true);
+            else
+                orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl;
+            //----------------------------
+
         }
         else // If it was dropped, it is removed from the required lists.
         {
@@ -296,6 +305,12 @@
             // Remove the Pickupable from the indexes_ and pickups_ list.
             this->indexes_.erase(it);
             this->pickups_.erase(index);
+            // TODO: Remove pickup keybinding ------------------------------------
+            if( KeyBinderManager::exists() )
+                  KeyBinderManager::getInstance().getCurrent()->setBinding("", "Keys.KeyNumpad0",true);
+            else
+                orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl;
+            //----------------------------
         }
 
         // If we're either in standalone mode or this is the host whom the change of the pickup's status concerns.

Modified: code/branches/HUD_HS16/src/modules/pickup/items/SpeedPickup.h
===================================================================
--- code/branches/HUD_HS16/src/modules/pickup/items/SpeedPickup.h	2016-10-17 14:08:32 UTC (rev 11239)
+++ code/branches/HUD_HS16/src/modules/pickup/items/SpeedPickup.h	2016-10-17 14:35:27 UTC (rev 11240)
@@ -47,7 +47,7 @@
     @brief
         A Pickup which can manipulate the Speed of a Pawn.
 
-        There are 5 parameters that can be cosen:
+        There are 5 parameters that can be chosen:
         - The @b speedMultiply, specifies a factor by which the Spaceships speed is multiplied. The default is 1.
         - The @b speedAdd, specifies a value that is added to the speed of the Spaceship. The default is 0.
         - The @b activationType <em>immediate</em> or <em>onUse</em>, defines if the SpeedPickup is used when it's picked up or only after the player chooses to use it. The default is <em>immediate</em>.




More information about the Orxonox-commit mailing list