- Timestamp:
- Apr 22, 2011, 11:05:47 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/defaultConfig/keybindings.ini
r8220 r8309 25 25 KeyEscape="keyESC" 26 26 KeyF="scale -1 moveUpDown" 27 KeyF1="OverlayGroup toggleVisibilityDebug"27 KeyF1="OverlayGroup show Debug" 28 28 KeyF10= 29 29 KeyF11= … … 32 32 KeyF14= 33 33 KeyF15= 34 KeyF2="OverlayGroup toggleVisibilityStats"34 KeyF2="OverlayGroup show Stats" 35 35 KeyF3="OrxonoxOverlay toggleVisibility QuestGUI" 36 KeyF4="OrxonoxOverlay toggleVisibilityPickupInventory"36 KeyF4="OrxonoxOverlay show PickupInventory" 37 37 KeyF5="startchat" 38 38 KeyF6= -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r7401 r8309 60 60 SetConsoleCommand("OrxonoxOverlay", "scrollOverlay", &OrxonoxOverlay::scrollOverlay); 61 61 SetConsoleCommand("OrxonoxOverlay", "toggleVisibility", &OrxonoxOverlay::toggleVisibility); 62 SetConsoleCommand("OrxonoxOverlay", "show", &OrxonoxOverlay::showOverlay); 62 63 SetConsoleCommand("OrxonoxOverlay", "rotateOverlay", &OrxonoxOverlay::rotateOverlay); 63 64 … … 341 342 } 342 343 } 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 } 343 364 344 365 /** -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r7401 r8309 77 77 Describes the rotational state of a an overlay. 78 78 Horizontal means 0/180 degrees, Vertical is 90/270 degrees 79 and Inbetween is everything else.79 and in between is everything else. 80 80 */ 81 81 enum RotationState … … 153 153 static void scrollOverlay(const std::string& name, const Vector2& scroll); 154 154 static void toggleVisibility(const std::string& name); 155 static void showOverlay(const std::string& name); 155 156 //! ConsoleCommand: Accesses the overlay by its name and rotates it. 156 157 static void rotateOverlay(const std::string& name, const Degree& angle); -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r7401 r8309 44 44 45 45 SetConsoleCommand("OverlayGroup", "toggleVisibility", &OverlayGroup::toggleVisibility); 46 SetConsoleCommand("OverlayGroup", "show", &OverlayGroup::show); 46 47 SetConsoleCommand("OverlayGroup", "scaleGroup", &OverlayGroup::scaleGroup); 47 48 SetConsoleCommand("OverlayGroup", "scrollGroup", &OverlayGroup::scrollGroup); … … 174 175 } 175 176 } 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 } 176 197 177 198 /** -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r7401 r8309 61 61 62 62 static void toggleVisibility(const std::string& name); 63 static void show(const std::string& name); 63 64 static void scaleGroup(const std::string& name, float scale); 64 65 static void scrollGroup(const std::string& name, const Vector2& scroll);
Note: See TracChangeset
for help on using the changeset viewer.