- Timestamp:
- Nov 7, 2016, 5:08:11 PM (8 years ago)
- Location:
- code/branches/HUD_HS16
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/HUD_HS16/data/overlays/HUDTemplates3.oxo
r11262 r11277 188 188 name = "PickupSystem" 189 189 correctaspect = true 190 position = "0. 45, 0.95"190 position = "0.32, 0.81" 191 191 pickpoint = "0.0, 0.0" 192 192 visible = "true" … … 195 195 <HUDTimer 196 196 name = "Timer" 197 position = "0.5, 0. 85"197 position = "0.5, 0.25" 198 198 font = "VeraMono" 199 199 textsize = 0.1 -
code/branches/HUD_HS16/data/overlays/HUDTemplatesFPS.oxo
r11104 r11277 104 104 /> 105 105 106 <HUDPickupSystem 107 name = "PickupSystem" 108 correctaspect = true 109 position = "0.45, 0.95" 110 pickpoint = "0.0, 0.0" 111 visible = "true" 112 /> 113 106 114 <HUDTimer 107 115 name = "Timer" -
code/branches/HUD_HS16/src/modules/overlays/OverlaysPrereqs.h
r11052 r11277 104 104 class PauseNotice; 105 105 class TeamBaseMatchScore; 106 class HUDPickupSystem; 107 class HUDPickupItem; 106 108 107 109 // stats -
code/branches/HUD_HS16/src/modules/overlays/hud/CMakeLists.txt
r11052 r11277 14 14 HUDWeapon.cc 15 15 HUDWeaponSystem.cc 16 HUDPickupItem.cc 17 HUDPickupSystem.cc 16 18 ChatOverlay.cc 17 19 AnnounceMessage.cc -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc
r11264 r11277 29 29 #include "HUDPickupItem.h" 30 30 31 #include <string> 32 33 34 #include <OgreOverlayManager.h> 35 #include <OgrePanelOverlayElement.h> 36 31 37 #include "core/CoreIncludes.h" 32 38 #include "core/XMLPort.h" 33 39 #include "util/Convert.h" 34 40 #include "core/class/Super.h" 41 #include "HUDPickupItem.h" 35 42 36 43 namespace orxonox 37 44 { 38 45 RegisterClass(HUDPickupItem); 46 Ogre::PanelOverlayElement* overlayElement_; 39 47 40 48 HUDPickupItem::HUDPickupItem(Context* context) : OrxonoxOverlay(context) … … 43 51 44 52 overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDPickupItem" + getUniqueNumberString())); 45 overlayElement_->setMaterialName("Orxonox/WSHUD_Weapon"); //TODO be switched53 46 54 overlayElement_->setPosition(0.0f,0.0f); 47 overlayElement_->setDimensions( 1.0f,1.0f);55 overlayElement_->setDimensions(0.5f,0.5f); 48 56 this->background_->addChild(overlayElement_); 49 57 } … … 53 61 if (this->isInitialized()) 54 62 { 55 destroyHUDChilds();63 overlayElement_=nullptr; 56 64 } 65 } 66 67 void initializeMaterial(std::string s) 68 { 69 overlayElement_->setMaterialName(s); 57 70 } 58 71 -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h
r11264 r11277 16 16 #include "worldentities/pawns/Pawn.h" 17 17 #include "overlays/OverlayGroup.h" 18 #include "weaponsystem/Weapon.h" 19 #include "weaponsystem/WeaponMode.h" 20 #include "HUDWeaponMode.h" 18 #include "pickup/Pickup.h" 21 19 22 20 namespace orxonox … … 28 26 virtual ~HUDPickupItem(); 29 27 30 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;31 virtual void tick(float dt) override;32 virtual void changedOwner() override;33 virtual void changedOverlayGroup() override;34 virtual void changedVisibility() override;35 virtual void changedName() override;36 virtual void positionChanged() override;37 virtual void sizeChanged() override;28 // virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 29 // virtual void tick(float dt) override; 30 // virtual void changedOwner() override; 31 // virtual void changedOverlayGroup() override; 32 // virtual void changedVisibility() override; 33 // virtual void changedName() override; 34 // virtual void positionChanged() override; 35 // virtual void sizeChanged() override; 38 36 39 void setPickup(Pickup* pickup); 37 // void setPickup(Pickup* pickup); 38 void initializeMaterial(std::string s); 40 39 41 40 private: … … 50 49 WeakPtr<Pickup> pickup_; 51 50 52 Ogre::PanelOverlayElement* overlayElement_;53 51 }; 54 52 } -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
r11263 r11277 27 27 */ 28 28 29 #include <vector> 30 #include <string> 31 29 32 #include "core/CoreIncludes.h" 30 33 #include "core/XMLPort.h" 31 34 #include "util/Convert.h" 32 35 #include "core/class/Super.h" 36 #include "HUDPickupSystem.h" 37 #include "pickup/Pickup.h" 38 #include "HUDPickupItem.h" 33 39 34 40 namespace orxonox … … 39 45 { 40 46 RegisterObject(HUDPickupSystem); 47 48 overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDPickupSystem" + getUniqueNumberString())); 49 overlayElement_->setMaterialName("PickupBar"); 50 overlayElement_->setPosition(0.0f,0.0f); 51 overlayElement_->setDimensions(0.70f,0.15f); 52 orxout() << "hello HUDPickupSystem" << endl; 53 this->background_->addChild(overlayElement_); 41 54 42 55 } … … 52 65 //TODO: XMLPort 53 66 54 void HUDPickupSystem::updatePickupList( )67 void HUDPickupSystem::updatePickupList(std::vector<Pickup> picks) 55 68 { 56 69 for(Pickup p : picks) 70 { 71 HUDPickupItem item = new HUDPickupItem(this->getContext()); 72 item.initializeMaterial(p.getRepresentationName()); 73 } 57 74 } 58 75 -
code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h
r11263 r11277 32 32 #include <string> 33 33 34 35 #include <OgreOverlayManager.h> 36 #include <OgrePanelOverlayElement.h> 37 34 38 #include "overlays/OrxonoxOverlay.h" 35 39 #include "worldentities/pawns/Pawn.h" 36 40 #include "overlays/OverlayGroup.h" 41 #include "pickup/Pickup.h" 42 #include "pickup/PickupRepresentation.h" 37 43 38 44 namespace orxonox … … 51 57 // virtual void positionChanged() override; 52 58 // virtual void sizeChanged() override; 53 pr otected:54 void updatePickupList( );59 private: 60 void updatePickupList(std::vector<Pickup> picks); 55 61 void createPickupList(); 56 62 void destroyAll(); 63 64 Ogre::PanelOverlayElement* overlayElement_; 65 WeakPtr<Pawn> owner_; 66 67 std::vector<PickupRepresentation> pickupRepresentations_; 57 68 }; 58 69 } -
code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
r11253 r11277 51 51 #include "CollectiblePickup.h" 52 52 #include "PickupRepresentation.h" 53 // #include "overlays/hud/HUDPickupSystem.h" 53 54 54 55 namespace orxonox … … 378 379 //This function is called by the command line or by the key binding 379 380 //it uses or unuses the pickup, depending on its current state 380 void PickupManager::useUnusePickup(uint32_t index) //uint32_t index381 void PickupManager::useUnusePickup(uint32_t index) 381 382 { 382 383 orxout() << "Hello there I was here " << index << endl;
Note: See TracChangeset
for help on using the changeset viewer.