- Timestamp:
- Oct 29, 2015, 11:27:32 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/modules/overlays/hud/HUDWeaponSystem.cc
r10688 r10721 51 51 RegisterObject(HUDWeaponSystem); 52 52 53 weaponModeHUDSize_ = Vector2(0.0f,0.0f); 54 weaponModeHUDActualSize_ = Vector2(0.0f,0.0f); 55 53 56 weapons_.clear(); 54 57 hudWeapons_.clear(); … … 67 70 SUPER(HUDWeaponSystem, XMLPort, xmlelement, mode); 68 71 69 /*XMLPortParam(HUDWeaponSystem, "sensitivity", setRadarSensitivity, getRadarSensitivity, xmlelement, mode); 70 XMLPortParam(HUDWeaponSystem, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlelement, mode);*/ 72 XMLPortParam(HUDWeaponSystem, "weaponModeHUDSize", setWeaponModeHUDSize, getWeaponModeHUDSize, xmlelement, mode); 71 73 } 72 74 … … 86 88 87 89 positionHUDChilds(); 88 } 90 } 91 92 void HUDWeaponSystem::sizeChanged() 93 { 94 OrxonoxOverlay::sizeChanged(); 95 96 weaponModeHUDActualSize_ = this->getActualSize(); 97 98 positionHUDChilds(); 99 } 89 100 90 101 void HUDWeaponSystem::changedOwner() … … 142 153 143 154 createHUDChilds(); 144 positionHUDChilds(); 155 positionHUDChilds(); 145 156 } 146 157 147 158 void HUDWeaponSystem::createHUDChilds() 148 159 { 160 int positionIndex = 0; 161 149 162 for (std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it) 150 163 { 151 HUDWeapon* hudWeapon = new HUDWeapon(this->getContext()); 164 HUDWeapon* hudWeapon = new HUDWeapon(this->getContext()); 152 165 hudWeapon->setOwner(owner_); 166 hudWeapon->setOverlayGroup(this->getOverlayGroup()); 153 167 hudWeapon->setWeapon(*it); 168 hudWeapon->setAspectCorrection(false); 169 hudWeapon->setPickPoint(Vector2(0.0f,0.0f)); 170 154 171 hudWeapons_.push_back(hudWeapon); 155 } 172 173 ++ positionIndex; 174 } 156 175 } 157 176 … … 159 178 { 160 179 int positionIndex = 0; 180 //this->setSize(weaponModeHUDSize_); 181 // this->weaponModeHUDActualSize_ = this->getActualSize(); 161 182 162 183 for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it) 163 184 { 164 (*it)->setOverlayGroup(this->getOverlayGroup()); 165 (*it)->setAspectCorrection(this->getAspectCorrection()); 166 (*it)->setPosition(this->getPosition() + Vector2(0.15f*positionIndex,0.0f)); 167 (*it)->setSize(Vector2(0.15f,0.10f)); 168 (*it)->setPickPoint(Vector2(0.0f,0.0f)); 185 (*it)->setWeaponIndex(positionIndex); 186 (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_); 187 (*it)->positionHUDChilds(); 169 188 170 189 ++ positionIndex; 171 } 190 } 172 191 } 173 192 … … 180 199 181 200 hudWeapons_.clear(); 182 } 201 } 183 202 }
Note: See TracChangeset
for help on using the changeset viewer.