- Timestamp:
- Oct 30, 2015, 7:51:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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");
Note: See TracChangeset
for help on using the changeset viewer.