Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2008, 2:35:24 PM (16 years ago)
Author:
rgrieder
Message:
  • Dots on the Radar actually disappear now when a Ship gets destroyed…
  • svn save to keep History of HUDText when renaming AND moving
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/OverlayGroup.cc

    r1609 r1614  
    4141
    4242  SetConsoleCommand(OverlayGroup, toggleVisibility, false).setAccessLevel(AccessLevel::User);
    43 
    44   OverlayGroup* OverlayGroup::hudInstance_s = 0;
     43  SetConsoleCommand(OverlayGroup, scaleGroup, false).setAccessLevel(AccessLevel::User);
    4544
    4645  using namespace Ogre;
     
    5049  {
    5150    RegisterObject(OverlayGroup);
    52 
    53     // Singleton like in Ogre. Constructor and destructor are public,
    54     // but the assert prevents from having multiple instances.
    55     assert(hudInstance_s == 0);
    56     hudInstance_s = this;
    5751  }
    5852
    5953  OverlayGroup::~OverlayGroup()
    6054  {
    61     if (this->isInitialized())
    62     {
    63     }
    64 
    65     hudInstance_s = 0;
    6655  }
    6756
     
    10493  }
    10594
    106   /*static*/ OverlayGroup& OverlayGroup::getHUD()
    107   {
    108     assert(hudInstance_s);
    109     return *hudInstance_s;
    110   }
    11195
    11296  /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
    11397  {
    114     if (OverlayGroup::getHUD().hudElements_.find(name) != OverlayGroup::getHUD().hudElements_.end())
     98    for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
    11599    {
    116       OverlayGroup::getHUD().hudElements_[name]->setVisibility(!OverlayGroup::getHUD().hudElements_[name]->isVisible());
     100        if ((*it)->getName() == name)
     101            (*it)->setVisibility(!((*it)->isVisible()));
    117102    }
    118103  }
    119104
     105  /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
     106  {
     107    for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
     108    {
     109        if ((*it)->getName() == name)
     110            (*it)->scale(Vector2(scale, scale));
     111    }
     112  }
    120113}
Note: See TracChangeset for help on using the changeset viewer.