Changeset 6746 for code/trunk/src/libraries/core/GUIManager.h
- Timestamp:
- Apr 16, 2010, 2:50:16 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/GUIManager.h
r6417 r6746 41 41 42 42 #include "util/OgreForwardRefs.h" 43 #include "util/TriBool.h" 43 44 #include "util/Singleton.h" 44 45 #include "input/InputHandler.h" 46 47 // Tolua includes (have to be relative to the current directory) 48 /* 49 $cfile "../util/TriBool.h" // tolua_export 50 */ 45 51 46 52 namespace orxonox // tolua_export … … 54 60 55 61 The GUIManager is a singleton and can be called anywhere when access on the GUI is needed. 56 Creation of the GUIManager is therefore not possible and the cunstructor is private.57 62 58 63 Since the GUI needs user input, the GUIManager implements the functions needed to act as a key and/or mouse handler. … … 64 69 friend class Singleton<GUIManager>; 65 70 public: 66 GUIManager( Ogre::RenderWindow* renderWindow, const std::pair<int, int>& mousePosition, bool bFullScreen);71 GUIManager(const std::pair<int, int>& mousePosition); 67 72 ~GUIManager(); 68 73 69 74 void preUpdate(const Clock& time); 70 75 71 static void showGUI(const std::string& name, bool hidePrevious=false, bool showCursor=true); 72 void showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious=false, bool showCursor=true); 76 void loadGUI(const std::string& name); 77 static void showGUI(const std::string& name, bool bHidePrevious = false); 78 void showGUIExtra(const std::string& name, const std::string& ptr, bool bHidePrevious = false); 73 79 static void hideGUI(const std::string& name); 74 80 void keyESC(); 75 void setBackground(const std::string& name); 81 void setBackgroundImage(const std::string& imageSet, const std::string imageName); // tolua_export 82 void setBackgroundImage(const std::string& image); 83 84 //! Creates a new InputState to be used with a GUI Sheet 85 const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export 86 87 //! Returns the root window for all menu sheets 88 CEGUI::Window* getMenuRootWindow() { return this->menuRootWindow_; } // tolua_export 89 //! Returns the root window for all HUD sheets 90 CEGUI::Window* getHUDRootWindow() { return this->hudRootWindow_; } // tolua_export 76 91 77 92 void setCamera(Ogre::Camera* camera); 78 93 Ogre::Camera* getCamera() { return this->camera_; } 79 80 static GUIManager* getInstancePtr() { return singletonPtr_s; }81 94 82 95 inline void setPlayer(const std::string& guiname, PlayerInfo* player) … … 88 101 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export 89 102 103 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export 104 90 105 private: 91 106 GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class) 92 107 93 108 void executeCode(const std::string& str); 109 110 template <typename FunctionType> 111 bool protectedCall(FunctionType function); 94 112 95 113 // keyHandler functions … … 102 120 void mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize); 103 121 void mouseScrolled (int abs, int rel); 104 105 122 scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_; //!< CEGUI's interface to the Ogre Engine 106 123 scoped_ptr<LuaState> luaState_; //!< LuaState, access point to the Lua engine … … 108 125 scoped_ptr<CEGUI::System> guiSystem_; //!< CEGUI's main system 109 126 shared_ptr<ResourceInfo> rootFileInfo_; //!< Resource information about the root script 110 Ogre::RenderWindow* renderWindow_; //!< Ogre's render window to give CEGUI access to it111 127 CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider 112 128 CEGUI::Logger* ceguiLogger_; //!< CEGUI's logger to be able to log CEGUI errors in our log 113 std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each gui 129 CEGUI::Window* rootWindow_; //!< Root node for all windows 130 CEGUI::Window* hudRootWindow_; //!< Root node for the HUD sheets 131 CEGUI::Window* menuRootWindow_; //!< Root node for the menu sheets (used by Lua) 132 std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each GUI 114 133 Ogre::Camera* camera_; //!< Camera used to render the scene with the GUI 115 134 116 135 static GUIManager* singletonPtr_s; //!< Singleton reference to GUIManager 117 bool bShowIngameGUI_;118 136 119 137 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.