- Timestamp:
- Mar 22, 2010, 2:47:10 PM (14 years ago)
- Location:
- code/branches/gamestates2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2
- Property svn:mergeinfo changed
/code/branches/gamestate merged: 6441-6442,6459,6537,6544-6546,6548,6564,6566-6567,6569,6571-6572
- Property svn:mergeinfo changed
-
code/branches/gamestates2/src/libraries/core/GUIManager.h
r6417 r6595 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 76 void loadGUI(const std::string& name); 71 77 static void showGUI(const std::string& name, bool hidePrevious=false, bool showCursor=true); 72 78 void showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious=false, bool showCursor=true); … … 75 81 void setBackground(const std::string& name); 76 82 83 const std::string& createInputState(const std::string& name, TriBool::Value showMouse = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export 84 77 85 void setCamera(Ogre::Camera* camera); 78 86 Ogre::Camera* getCamera() { return this->camera_; } 79 80 static GUIManager* getInstancePtr() { return singletonPtr_s; }81 87 82 88 inline void setPlayer(const std::string& guiname, PlayerInfo* player) … … 87 93 // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work 88 94 static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export 95 96 static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export 89 97 90 98 private: … … 102 110 void mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize); 103 111 void mouseScrolled (int abs, int rel); 104 105 112 scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_; //!< CEGUI's interface to the Ogre Engine 106 113 scoped_ptr<LuaState> luaState_; //!< LuaState, access point to the Lua engine … … 108 115 scoped_ptr<CEGUI::System> guiSystem_; //!< CEGUI's main system 109 116 shared_ptr<ResourceInfo> rootFileInfo_; //!< Resource information about the root script 110 Ogre::RenderWindow* renderWindow_; //!< Ogre's render window to give CEGUI access to it111 117 CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider 112 118 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 gui119 std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each GUI 114 120 Ogre::Camera* camera_; //!< Camera used to render the scene with the GUI 115 121 116 122 static GUIManager* singletonPtr_s; //!< Singleton reference to GUIManager 117 bool bShowIngameGUI_;118 123 119 124 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.