Changeset 3337
- Timestamp:
- Jul 23, 2009, 1:34:31 PM (15 years ago)
- Location:
- code/branches/resource/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/orxonox/gui/GUIManager.cc
r3327 r3337 287 287 /** 288 288 @brief 289 Registers a GUIOverlay with the GUIManager so that the GUIOverlay can be accessed by it's name through the GUIManager.290 @param name291 The name of the GUI.292 @param overlay293 A pointer to the GUIOverlay of the GUI.294 @return295 Returns false if the Overlay was already present.296 */297 bool GUIManager::registerOverlay(const std::string& name, GUIOverlay* overlay)298 {299 return (this->guiOverlays_.insert(std::pair<std::string, GUIOverlay*>(name, overlay))).second;300 }301 302 /**303 @brief304 Get the GUIOverlay of the GUI with the given name.305 @param name306 The name of the GUI.307 @return308 Returns a pointer to the GUIOverlay.309 */310 GUIOverlay* GUIManager::getOverlay(const std::string& name)311 {312 return (this->guiOverlays_.find(name))->second;313 }314 315 /**316 @brief317 289 Tells the GUIManager which SceneManager to use 318 290 @param camera … … 321 293 In fact the GUIManager needs the SceneManager and not the Camera to display the GUI. 322 294 This means the GUI is not bound to a camera but rather to the SceneManager. 323 Hid ding the GUI when needed can therefore not besolved by just NOT setting the current camera.295 Hiding the GUI when needed can therefore not be resolved by just NOT setting the current camera. 324 296 */ 325 297 void GUIManager::setCamera(Ogre::Camera* camera) -
code/branches/resource/src/orxonox/gui/GUIManager.h
r3327 r3337 88 88 void executeCode(const std::string& str); 89 89 90 bool registerOverlay(const std::string& name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.91 GUIOverlay* getOverlay(const std::string& name); // Get the GUIOverlay of the GUI with the given name.92 93 90 void setCamera(Ogre::Camera* camera); 94 91 … … 123 120 State state_; //!< reflects state of the GUIManager 124 121 125 std::map<std::string, GUIOverlay*> guiOverlays_;//!< A list of all GUIOverlay's.126 127 122 static GUIManager* singletonRef_s; //!< Singleton reference to GUIManager 128 123 -
code/branches/resource/src/orxonox/objects/quest/QuestManager.cc
r3325 r3337 36 36 #include "util/Exception.h" 37 37 #include "core/CoreIncludes.h" 38 #include "gui/GUIManager.h"39 38 40 39 #include "objects/infos/PlayerInfo.h" … … 225 224 QuestContainer* QuestManager::getQuestTree(std::string & name) 226 225 { 227 GUIOverlay* gui = GUIManager::getInstance().getOverlay(name); 226 GUIOverlay* gui = NULL; 227 for (ObjectList<GUIOverlay>::iterator it = ObjectList<GUIOverlay>::begin(); it != ObjectList<GUIOverlay>::end(); ++it) 228 if (it->getGUIName() == name) 229 gui = *it; 228 230 229 231 PlayerInfo* player; -
code/branches/resource/src/orxonox/overlays/GUIOverlay.cc
r3327 r3337 55 55 56 56 XMLPortParam(GUIOverlay, "guiname", setGUIName, getGUIName, xmlElement, mode); 57 58 GUIManager::getInstance().registerOverlay(this->guiName_, this);59 57 } 60 58
Note: See TracChangeset
for help on using the changeset viewer.