Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 22, 2010, 2:47:10 PM (14 years ago)
Author:
rgrieder
Message:

Merged remaining revisions from gamestate to gamestates2.

Location:
code/branches/gamestates2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2

  • code/branches/gamestates2/src/libraries/core/GUIManager.h

    r6417 r6595  
    4141
    4242#include "util/OgreForwardRefs.h"
     43#include "util/TriBool.h"
    4344#include "util/Singleton.h"
    4445#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*/
    4551
    4652namespace orxonox // tolua_export
     
    5460
    5561        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.
    5762
    5863        Since the GUI needs user input, the GUIManager implements the functions needed to act as a key and/or mouse handler.
     
    6469        friend class Singleton<GUIManager>;
    6570    public:
    66         GUIManager(Ogre::RenderWindow* renderWindow, const std::pair<int, int>& mousePosition, bool bFullScreen);
     71        GUIManager(const std::pair<int, int>& mousePosition);
    6772        ~GUIManager();
    6873
    6974        void preUpdate(const Clock& time);
    7075
     76        void loadGUI(const std::string& name);
    7177        static void showGUI(const std::string& name, bool hidePrevious=false, bool showCursor=true);
    7278        void showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious=false, bool showCursor=true);
     
    7581        void setBackground(const std::string& name);
    7682
     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
    7785        void setCamera(Ogre::Camera* camera);
    7886        Ogre::Camera* getCamera() { return this->camera_; }
    79 
    80         static GUIManager* getInstancePtr() { return singletonPtr_s; }
    8187
    8288        inline void setPlayer(const std::string& guiname, PlayerInfo* player)
     
    8793        // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work
    8894        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
    8997
    9098    private:
     
    102110        void mouseMoved    (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
    103111        void mouseScrolled (int abs, int rel);
    104 
    105112        scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    106113        scoped_ptr<LuaState>                 luaState_;         //!< LuaState, access point to the Lua engine
     
    108115        scoped_ptr<CEGUI::System>            guiSystem_;        //!< CEGUI's main system
    109116        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    110         Ogre::RenderWindow*                  renderWindow_;     //!< Ogre's render window to give CEGUI access to it
    111117        CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
    112118        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
     119        std::map<std::string, PlayerInfo*>   players_;          //!< Stores the player (owner) for each GUI
    114120        Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
    115121
    116122        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
    117         bool                                 bShowIngameGUI_;
    118123
    119124    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.