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/OrxonoxOverlay.cc

    r7401 r8309  
    6060    SetConsoleCommand("OrxonoxOverlay", "scrollOverlay",    &OrxonoxOverlay::scrollOverlay);
    6161    SetConsoleCommand("OrxonoxOverlay", "toggleVisibility", &OrxonoxOverlay::toggleVisibility);
     62    SetConsoleCommand("OrxonoxOverlay", "show",     &OrxonoxOverlay::showOverlay);
    6263    SetConsoleCommand("OrxonoxOverlay", "rotateOverlay",    &OrxonoxOverlay::rotateOverlay);
    6364
     
    341342        }
    342343    }
     344   
     345    /**
     346    @brief
     347        Shows Overlay by it's name.
     348    @param name
     349        The name of the overlay defined BaseObject::setName() (usually done with the "name"
     350        attribute in the xml file).
     351    */
     352    /*static*/ void OrxonoxOverlay::showOverlay(const std::string& name)
     353    {
     354        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
     355        if (it != overlays_s.end())
     356        {
     357            OrxonoxOverlay* overlay= it->second;
     358            if(overlay->isVisible())
     359                overlay->changedVisibility();
     360            else
     361                overlay->show();
     362        }
     363    }
    343364
    344365    /**
Note: See TracChangeset for help on using the changeset viewer.