Changeset 9965 in orxonox.OLD for branches/playability/src/util
- Timestamp:
- Nov 28, 2006, 11:54:34 PM (18 years ago)
- Location:
- branches/playability/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/hud.cc
r9869 r9965 45 45 //this->setSize2D( 46 46 this->weaponManager = NULL; 47 this->weaponManagerSecondary = NULL; 47 48 this->energyWidget = NULL; 48 49 this->shieldWidget = NULL; … … 118 119 {} 119 120 120 void Hud::setWeaponManager(WeaponManager* weaponMan )121 void Hud::setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec) 121 122 { 122 123 if (this->weaponManager != NULL) … … 133 134 } 134 135 136 if (this->weaponManagerSecondary != NULL) 137 { 138 for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++) 139 { 140 Weapon* weapon = this->weaponManagerSecondary->getWeapon(i); 141 if (weapon != NULL) 142 { 143 weapon->getEnergyWidget()->hide(); 144 this->weaponsWidgets.remove(weapon->getEnergyWidget()); 145 } 146 } 147 } 148 135 149 this->weaponManager = weaponMan; 150 this->weaponManagerSecondary = weaponManSec; 136 151 137 152 this->updateWeaponManager(); … … 164 179 } 165 180 } 181 182 if (this->weaponManagerSecondary != NULL) 183 for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++) 184 { 185 Weapon* weapon = this->weaponManagerSecondary->getWeapon(i); 186 if (weapon != NULL) 187 { 188 //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName()); 189 weapon->getEnergyWidget()->show(); 190 weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1)); 191 weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6)); 192 // weapon->getEnergyWidget()->frontMaterial().setTransparency(.6); 193 this->weaponsWidgets.push_back(weapon->getEnergyWidget()); 194 } 195 } 196 166 197 this->updateResolution(); 198 167 199 } 168 200 -
branches/playability/src/util/hud.h
r9869 r9965 39 39 void setShiledWidget(OrxGui::GLGuiWidget* widget); 40 40 void setArmorWidget(OrxGui::GLGuiWidget* widget); 41 void setWeaponManager(WeaponManager* weaponMan );41 void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL); 42 42 43 43 void addWeaponWidget(OrxGui::GLGuiWidget* widget); … … 68 68 69 69 WeaponManager* weaponManager; 70 WeaponManager* weaponManagerSecondary; 70 71 71 72 std::list<OrxGui::GLGuiWidget*> weaponsWidgets; //!< WeaponWidgets will be displayed one after another
Note: See TracChangeset
for help on using the changeset viewer.