Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2009, 12:23:51 AM (15 years ago)
Author:
dafrick
Message:

Small changes in QuestManager for the GUI. Added toggleVisibility command to OrxonoxOverlay.

Location:
code/trunk/src/orxonox/overlays
Files:
2 edited

Legend:

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

    r2896 r2993  
    5757    SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User);
    5858    SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User);
     59    SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User);
    5960    SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User);
    6061
     
    311312    /**
    312313    @brief
     314        Toggles the visibility of an Overlay by it's name.
     315    @param name
     316        The name of the overlay defined BaseObject::setName() (usually done with the "name"
     317        attribute in the xml file).
     318    */
     319    /*static*/ void OrxonoxOverlay::toggleVisibility(const std::string& name)
     320    {
     321        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
     322        if (it != overlays_s.end())
     323        {
     324            OrxonoxOverlay* overlay= (*it).second;
     325            if(overlay->isVisible())
     326                overlay->hide();
     327            else
     328                overlay->show();
     329        }
     330    }
     331
     332    /**
     333    @brief
    313334        Scrolls an overlay by its name.
    314335    @param name
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r2896 r2993  
    149149        //! ConsoleCommand: Accesses the overlay by its name and scrolls it.
    150150        static void scrollOverlay(const std::string& name, const Vector2& scroll);
     151        static void toggleVisibility(const std::string& name);
    151152        //! ConsoleCommand: Accesses the overlay by its name and rotates it.
    152153        static void rotateOverlay(const std::string& name, const Degree& angle);
Note: See TracChangeset for help on using the changeset viewer.