[Orxonox-commit 6387] r11044 - code/branches/presentationHS15/src/modules/overlays/hud

landauf at orxonox.net landauf at orxonox.net
Tue Jan 5 09:13:31 CET 2016


Author: landauf
Date: 2016-01-05 09:13:31 +0100 (Tue, 05 Jan 2016)
New Revision: 11044

Modified:
   code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.cc
   code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.cc
   code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.cc
Log:
fixed visibility of weapon hud:
 - propagate changedVisibility to all child overlays (necessary if the containing overlaygroup changes its visibility)
 - initialize the visibility of child overlays (necessary if the visibility of the weaponsystem is 'false' in the hud definition)

Modified: code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.cc
===================================================================
--- code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.cc	2016-01-04 19:59:19 UTC (rev 11043)
+++ code/branches/presentationHS15/src/modules/overlays/hud/HUDWeapon.cc	2016-01-05 08:13:31 UTC (rev 11044)
@@ -116,6 +116,7 @@
 
         for (std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)
         {
+            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
             (*it)->setVisible(visible);
         }
     }
@@ -167,6 +168,7 @@
             HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext());
             hudWeaponMode->setOwner(owner_);
             hudWeaponMode->setOverlayGroup(this->getOverlayGroup());
+            hudWeaponMode->setVisible(this->isVisible());
             hudWeaponMode->setWeaponMode(it->second);
             hudWeaponMode->setWeaponIndex(this->weaponIndex_);                    
             hudWeaponMode->setAspectCorrection(false);

Modified: code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.cc
===================================================================
--- code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.cc	2016-01-04 19:59:19 UTC (rev 11043)
+++ code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponMode.cc	2016-01-05 08:13:31 UTC (rev 11044)
@@ -217,14 +217,6 @@
 
         this->textOverlayLeft_->setVisible(visible);
         this->textOverlayRight_->setVisible(visible);
-
-        if (visible)
-        {
-            overlayElementIcon_->show();
-            overlayElementReplenish_->show();
-            overlayElementMunition_->show();
-            overlayElementState_->show();
-        }
     }
 
     void HUDWeaponMode::changedName()
@@ -294,4 +286,4 @@
     {
         this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,weaponModeHUDActualSize_.y*weaponModeIndex_) + this->positionOffset_);
     }      
-}
\ No newline at end of file
+}

Modified: code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.cc
===================================================================
--- code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.cc	2016-01-04 19:59:19 UTC (rev 11043)
+++ code/branches/presentationHS15/src/modules/overlays/hud/HUDWeaponSystem.cc	2016-01-05 08:13:31 UTC (rev 11044)
@@ -104,6 +104,7 @@
 
         for (std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)
         {
+            (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed
             (*it)->setVisible(visible);
         }
     }
@@ -149,6 +150,7 @@
             HUDWeapon* hudWeapon = new HUDWeapon(this->getContext());
             hudWeapon->setOwner(owner_);
             hudWeapon->setOverlayGroup(this->getOverlayGroup());
+            hudWeapon->setVisible(this->isVisible());
             hudWeapon->setWeapon(*it);
             hudWeapon->setAspectCorrection(false);
             hudWeapon->setPickPoint(Vector2(0.0f,0.0f));




More information about the Orxonox-commit mailing list