Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 22, 2011, 11:05:47 PM (13 years ago)
Author:
dafrick
Message:

Replacing toggleVisibility with show, since the OrxonoxOverlay (& OrxonoxOverlayGroup) doesn't know when the GUI is closed, and toggling doesn't work anyway, since we have no regular keybindings when the GUI is showing.

File:
1 edited

Legend:

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

    r7401 r8309  
    4444
    4545    SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility);
     46    SetConsoleCommand("OverlayGroup", "show", &OverlayGroup::show);
    4647    SetConsoleCommand("OverlayGroup", "scaleGroup",       &OverlayGroup::scaleGroup);
    4748    SetConsoleCommand("OverlayGroup", "scrollGroup",      &OverlayGroup::scrollGroup);
     
    174175        }
    175176    }
     177   
     178    /**
     179    @brief
     180        Shows an overlay group by its name.
     181    @param name
     182        The name of the group defined BaseObject::setName() (usually done with the "name" attribute in the xml file).
     183    */
     184    /*static*/ void OverlayGroup::show(const std::string& name)
     185    {
     186        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
     187        {
     188            if ((*it)->getName() == name)
     189            {
     190                if((*it)->isVisible())
     191                    (*it)->changedVisibility();
     192                else
     193                    (*it)->setVisible(!((*it)->isVisible()));
     194            }
     195        }
     196    }
    176197
    177198    /**
Note: See TracChangeset for help on using the changeset viewer.