Changeset 2993 for code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
- Timestamp:
- May 20, 2009, 12:23:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r2896 r2993 57 57 SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User); 58 58 SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User); 59 SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User); 59 60 SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User); 60 61 … … 311 312 /** 312 313 @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 313 334 Scrolls an overlay by its name. 314 335 @param name
Note: See TracChangeset
for help on using the changeset viewer.