Changeset 10724 for code/branches/fabienHS15/src/modules
- Timestamp:
- Oct 30, 2015, 7:51:49 PM (9 years ago)
- Location:
- code/branches/fabienHS15/src/modules
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeapon.cc
r10721 r10724 29 29 #include "HUDWeapon.h" 30 30 31 #include <OgreOverlayManager.h>32 #include <OgrePanelOverlayElement.h>33 34 31 #include "core/CoreIncludes.h" 35 32 #include "core/XMLPort.h" 36 #include "tools/TextureGenerator.h"37 33 #include "util/Convert.h" 38 34 #include "core/class/Super.h" … … 186 182 (*it)->setWeaponIndex(this->weaponIndex_); 187 183 (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_); 188 (*it)->positionHUDChilds();189 184 190 185 ++ positionIndex; -
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeapon.h
r10721 r10724 37 37 38 38 #include <OgreOverlayManager.h> 39 #include <OgreMaterialManager.h>40 #include <OgreTechnique.h>41 #include <OgrePass.h>42 39 #include <OgrePanelOverlayElement.h> 43 40 44 41 #include "overlays/OrxonoxOverlay.h" 45 #include "overlays/OverlayText.h"46 42 #include "tools/interfaces/Tickable.h" 47 43 #include "worldentities/pawns/Pawn.h" … … 79 75 { weaponIndex_ = index; 80 76 this->updatePosition(); 81 } 82 83 virtual void positionHUDChilds(); 77 } 84 78 85 79 private: 86 80 virtual void createHUDChilds(); 87 81 virtual void positionHUDChilds(); 88 82 virtual void destroyHUDChilds(); 89 83 virtual void updateWeaponModeList(); -
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.cc
r10721 r10724 21 21 * 22 22 * Author: 23 * Yuning Chai 24 * Felix Schulthess 23 * Fabien Vultier 25 24 * Co-authors: 26 * Reto Grieder 27 * Wolfgang Roenninger 25 * ... 28 26 * 29 27 */ 30 28 31 29 #include "HUDWeaponMode.h" 32 33 #include <OgreOverlayManager.h>34 #include <OgrePanelOverlayElement.h>35 30 36 31 #include "core/CoreIncludes.h" 37 32 #include "core/XMLPort.h" 38 #include "tools/TextureGenerator.h"39 #include "weaponsystem/WeaponMode.h"40 #include "weaponsystem/Munition.h"41 33 #include "util/Convert.h" 34 #include "core/class/Super.h" 42 35 43 36 namespace orxonox … … 87 80 textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0)); 88 81 textOverlayLeft_->setAspectCorrection(false); 82 textOverlayLeft_->setZOrder(600); 89 83 90 84 this->textOverlayRight_ = new OverlayText(this->getContext()); … … 97 91 textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0)); 98 92 textOverlayRight_->setAspectCorrection(false); 93 textOverlayRight_->setZOrder(600); 99 94 100 95 materialNameState_ = "Orxonox/WSHUD_Reloading"; … … 137 132 if (munition != NULL) 138 133 { 139 bool useSeparateMagazines = munition->getUseSeparateMagazines(); 140 bool stackMunition = munition->getStackMunition(); 141 142 if (!useSeparateMagazines && !stackMunition) 134 MunitionDeployment::Value deployment = munition->getMunitionDeployment(); 135 136 if (deployment == MunitionDeployment::Share) 143 137 { 144 138 this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_))); 145 139 this->textOverlayRight_->setCaption(multi_cast<std::string>(munition->getNumMagazines())); 146 140 } 147 else if ( !useSeparateMagazines && stackMunition)141 else if (deployment == MunitionDeployment::Stack) 148 142 { 149 143 this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunition(weaponMode_))); 150 144 this->textOverlayRight_->setCaption(""); 151 145 } 152 else if ( useSeparateMagazines && !stackMunition)146 else if (deployment == MunitionDeployment::Separate) 153 147 { 154 148 this->textOverlayLeft_->setCaption(multi_cast<std::string>(munition->getNumMunitionInCurrentMagazine(weaponMode_))); … … 245 239 if (munition != NULL) 246 240 { 247 bool useSeparateMagazines = munition->getUseSeparateMagazines(); 248 bool stackMunition = munition->getStackMunition(); 249 250 if (!useSeparateMagazines && !stackMunition) 241 MunitionDeployment::Value deployment = munition->getMunitionDeployment(); 242 243 if (deployment == MunitionDeployment::Share) 251 244 { 252 245 overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionShare"); 253 246 } 254 else if ( !useSeparateMagazines && stackMunition)247 else if (deployment == MunitionDeployment::Stack) 255 248 { 256 249 overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionStack"); 257 250 } 258 else if ( useSeparateMagazines && !stackMunition)251 else if (deployment == MunitionDeployment::Separate) 259 252 { 260 253 overlayElementMunition_->setMaterialName("Orxonox/WSHUD_MunitionSeparate"); -
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponMode.h
r10721 r10724 38 38 39 39 #include <OgreOverlayManager.h> 40 #include <OgreMaterialManager.h>41 #include <OgreTechnique.h>42 #include <OgrePass.h>43 40 #include <OgrePanelOverlayElement.h> 44 41 … … 49 46 #include "overlays/OverlayGroup.h" 50 47 #include "weaponsystem/ReplenishingMunition.h" 48 #include "weaponsystem/WeaponMode.h" 49 #include "weaponsystem/Munition.h" 51 50 52 51 namespace orxonox … … 84 83 } 85 84 86 virtual void positionHUDChilds();87 88 85 private: 89 86 virtual void updateSize(); 90 87 virtual void updatePosition(); 88 virtual void positionHUDChilds(); 91 89 92 90 WeakPtr<Pawn> owner_; -
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponSystem.cc
r10721 r10724 21 21 * 22 22 * Author: 23 * Yuning Chai 24 * Felix Schulthess 23 * Fabien Vultier 25 24 * Co-authors: 26 * Reto Grieder 27 * Wolfgang Roenninger 25 * ... 28 26 * 29 27 */ … … 31 29 #include "HUDWeaponSystem.h" 32 30 33 #include <OgreOverlayManager.h>34 #include <OgrePanelOverlayElement.h>35 36 31 #include "core/CoreIncludes.h" 37 32 #include "core/XMLPort.h" 38 #include "tools/TextureGenerator.h"39 33 #include "weaponsystem/WeaponSystem.h" 40 34 #include "weaponsystem/WeaponPack.h" … … 73 67 } 74 68 75 void HUDWeaponSystem::tick(float dt)76 {77 SUPER(HUDWeaponSystem, tick, dt);78 79 if (this->owner_)80 {81 82 }83 }84 85 69 void HUDWeaponSystem::positionChanged() 86 70 { … … 111 95 { 112 96 SUPER(HUDWeaponSystem, changedOverlayGroup); 113 114 //this->getOverlayGroup()->addElement(this->textOverlay_.get());115 97 } 116 98 … … 118 100 { 119 101 SUPER(HUDWeaponSystem, changedVisibility); 120 121 //this->textOverlay_->setVisible(this->isVisible());122 102 } 123 103 … … 125 105 { 126 106 SUPER(HUDWeaponSystem, changedName); 127 128 //this->textOverlay_->setName(this->getName() + "text");129 107 } 130 108 … … 178 156 { 179 157 int positionIndex = 0; 180 //this->setSize(weaponModeHUDSize_);181 // this->weaponModeHUDActualSize_ = this->getActualSize();182 158 183 159 for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it) … … 185 161 (*it)->setWeaponIndex(positionIndex); 186 162 (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_); 187 (*it)->positionHUDChilds();188 163 189 164 ++ positionIndex; -
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponSystem.h
r10721 r10724 36 36 #include <string> 37 37 38 #include <OgreOverlayManager.h>39 #include <OgreMaterialManager.h>40 #include <OgreTechnique.h>41 #include <OgrePass.h>42 #include <OgrePanelOverlayElement.h>43 44 38 #include "overlays/OrxonoxOverlay.h" 45 #include "overlays/OverlayText.h"46 #include "tools/interfaces/Tickable.h"47 39 #include "worldentities/pawns/Pawn.h" 48 40 #include "overlays/OverlayGroup.h" … … 51 43 namespace orxonox 52 44 { 53 class _OverlaysExport HUDWeaponSystem : public OrxonoxOverlay , public Tickable45 class _OverlaysExport HUDWeaponSystem : public OrxonoxOverlay 54 46 { 55 47 public: … … 58 50 59 51 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 60 virtual void tick(float dt);61 52 virtual void changedOwner(); 62 53 virtual void changedOverlayGroup(); -
code/branches/fabienHS15/src/modules/pickup/items/CMakeLists.txt
r10715 r10724 8 8 ShrinkPickup.cc 9 9 DamageBoostPickup.cc 10 BoostPickup.cc 10 11 MunitionPickup.cc 11 12 MunitionContainer.cc -
code/branches/fabienHS15/src/modules/pickup/items/MunitionPickup.cc
r10721 r10724 111 111 this->Pickupable::destroy(); 112 112 113 114 113 // If the pickup has transited to used. 115 114 if(this->isUsed()) -
code/branches/fabienHS15/src/modules/weapons/munitions/LaserMunition.cc
r10713 r10724 43 43 RegisterObject(LaserMunition); 44 44 45 this->maxMunitionPerMagazine_ = 10;45 this->maxMunitionPerMagazine_ = 20; 46 46 this->maxMagazines_ = 10; 47 47 this->magazines_ = 10; … … 55 55 this->replenishMunitionAmount_ = 1; 56 56 57 this->reloadTime_ = 0. 8f;57 this->reloadTime_ = 0.5f; 58 58 } 59 59 }
Note: See TracChangeset
for help on using the changeset viewer.