Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 16, 2010, 1:49:16 PM (14 years ago)
Author:
rgrieder
Message:

Linked every GUI sheet to exactly one InputState.
Also added util/TriBool that has states {true, false, Dontcare}.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/src/libraries/core/GUIManager.h

    r6441 r6537  
    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
     
    7681        void setBackground(const std::string& name);
    7782
     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
    7885        void setCamera(Ogre::Camera* camera);
    7986        Ogre::Camera* getCamera() { return this->camera_; }
    80 
    81         static GUIManager* getInstancePtr() { return singletonPtr_s; }
    8287
    8388        inline void setPlayer(const std::string& guiname, PlayerInfo* player)
     
    8893        // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work
    8994        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
    9097
    9198    private:
     
    103110        void mouseMoved    (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize);
    104111        void mouseScrolled (int abs, int rel);
    105 
    106112        scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;      //!< CEGUI's interface to the Ogre Engine
    107113        scoped_ptr<LuaState>                 luaState_;         //!< LuaState, access point to the Lua engine
     
    109115        scoped_ptr<CEGUI::System>            guiSystem_;        //!< CEGUI's main system
    110116        shared_ptr<ResourceInfo>             rootFileInfo_;     //!< Resource information about the root script
    111         Ogre::RenderWindow*                  renderWindow_;     //!< Ogre's render window to give CEGUI access to it
    112117        CEGUI::ResourceProvider*             resourceProvider_; //!< CEGUI's resource provider
    113118        CEGUI::Logger*                       ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
    114         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
    115120        Ogre::Camera*                        camera_;           //!< Camera used to render the scene with the GUI
    116121
    117122        static GUIManager*                   singletonPtr_s;    //!< Singleton reference to GUIManager
    118         bool                                 bShowIngameGUI_;
    119123
    120124    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.