Index: code/branches/menu/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/menu/src/libraries/core/CMakeLists.txt	(revision 5944)
+++ code/branches/menu/src/libraries/core/CMakeLists.txt	(revision 6024)
@@ -85,4 +85,5 @@
   TOLUA_FILES
     CommandExecutor.h
+    Game.h
     Loader.h
     LuaState.h
Index: code/branches/menu/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/menu/src/libraries/core/GUIManager.cc	(revision 5944)
+++ code/branches/menu/src/libraries/core/GUIManager.cc	(revision 6024)
@@ -50,8 +50,11 @@
 
 #include "util/Clock.h"
+#include "util/Convert.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
 #include "util/OrxAssert.h"
+#include "ConsoleCommand.h"
 #include "Core.h"
+#include "input/InputManager.h"
 #include "LuaState.h"
 #include "PathConfig.h"
@@ -86,4 +89,7 @@
     GUIManager* GUIManager::singletonPtr_s = 0;
 
+    SetConsoleCommandShortcut(GUIManager, showGUI).accessLevel(AccessLevel::User).defaultValue(1, true);
+    SetConsoleCommandShortcut(GUIManager, hideGUI).accessLevel(AccessLevel::User);
+
     /**
     @brief
@@ -204,7 +210,51 @@
         For more details check out loadGUI_2.lua where the function presides.
     */
-    void GUIManager::showGUI(const std::string& name)
-    {
-        this->luaState_->doString("showGUI(\"" + name + "\")", rootFileInfo_);
+    /*static*/ void GUIManager::showGUI(const std::string& name, bool showCursor)
+    {
+        std::pair<std::set<std::string>::iterator,bool> result = GUIManager::getInstance().showingGUIs_.insert(name);
+        if(result.second == false) //!< GUI already showing.
+            return;
+        if(GUIManager::getInstance().showingGUIs_.size() == 1 && result.second == true) //!< If it's the first GUI.
+        {
+//             GUIManager::getInstance().executeCode("showCursor()");
+            InputManager::getInstance().enterState("guiMouseOnly");
+        }
+        GUIManager::getInstance().executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ")");
+    }
+
+    /**
+    @brief
+        Hack-ish. Needed for GUIOverlay.
+    */
+    void GUIManager::showGUIExtra(const std::string& name, const std::string& ptr, bool showCursor)
+    {
+        std::pair<std::set<std::string>::iterator,bool> result = this->showingGUIs_.insert(name);
+        if(result.second == false) //!< GUI already showing.
+            return;
+        if(this->showingGUIs_.size() == 1 && result.second == true) //!< If it's the first GUI.
+        {
+            this->executeCode("showCursor()");
+            InputManager::getInstance().enterState("guiMouseOnly");
+        }
+        this->executeCode("showGUI(\"" + name + "\", " + multi_cast<std::string>(showCursor) + ", " + ptr + ")");
+    }
+
+    /**
+    @brief
+        Hides specified GUI.
+    @param name
+        The name of the GUI.
+    */
+    /*static*/ void GUIManager::hideGUI(const std::string& name)
+    {
+        bool present = GUIManager::getInstance().showingGUIs_.erase(name);
+        if(!present) //!< If there was nothing to erase.
+            return;
+        GUIManager::getInstance().executeCode("hideGUI(\"" + name + "\")");
+        if(GUIManager::getInstance().showingGUIs_.size() == 0)
+        {
+            GUIManager::getInstance().executeCode("hideCursor()");
+            InputManager::getInstance().leaveState("guiMouseOnly");
+        }
     }
 
Index: code/branches/menu/src/libraries/core/GUIManager.h
===================================================================
--- code/branches/menu/src/libraries/core/GUIManager.h	(revision 5944)
+++ code/branches/menu/src/libraries/core/GUIManager.h	(revision 6024)
@@ -34,4 +34,5 @@
 
 #include <map>
+#include <set>
 #include <string>
 #include <CEGUIForwardRefs.h>
@@ -65,8 +66,9 @@
         ~GUIManager();
 
-        void update(const Clock& time);
+        void update(const Clock& time); 
 
-        void showGUI(const std::string& name);
-        void executeCode(const std::string& str);
+        static void showGUI(const std::string& name, bool showCursor=true);
+        void showGUIExtra(const std::string& name, const std::string& ptr, bool showCursor=true);
+        static void hideGUI(const std::string& name);
 
         void setCamera(Ogre::Camera* camera);
@@ -82,4 +84,8 @@
     private:
         GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
+
+        std::set<std::string> showingGUIs_; //!< Keeps track of all the GUIs that are currently showing.
+
+        void executeCode(const std::string& str);
 
         // keyHandler functions
Index: code/branches/menu/src/libraries/core/Game.h
===================================================================
--- code/branches/menu/src/libraries/core/Game.h	(revision 5944)
+++ code/branches/menu/src/libraries/core/Game.h	(revision 6024)
@@ -58,7 +58,8 @@
 #define DeclareGameState(className, stateName, bIgnoreTickTime, bGraphicsMode) \
     static bool BOOST_PP_CAT(bGameStateDummy_##className, __LINE__) = orxonox::Game::declareGameState<className>(#className, stateName, bIgnoreTickTime, bGraphicsMode)
-
+// tolua_begin
 namespace orxonox
 {
+// tolua_end
     class GameConfiguration;
 
@@ -78,6 +79,9 @@
         You should only create this singleton once because it owns the Core class! (see remark there)
     */
-    class _CoreExport Game : public Singleton<Game>
+// tolua_begin
+    class _CoreExport Game
+        : public Singleton<Game>
     {
+// tolua_end
         friend class Singleton<Game>;
         typedef std::vector<shared_ptr<GameState> > GameStateVector;
@@ -95,7 +99,9 @@
         void stop();
 
-        void requestState(const std::string& name);
-        void requestStates(const std::string& names);
-        void popState();
+        static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export
+
+        void requestState(const std::string& name); //tolua_export
+        void requestStates(const std::string& names); //tolua_export
+        void popState(); //tolua_export
 
         const Clock& getGameClock() { return *this->gameClock_; }
@@ -183,5 +189,5 @@
         static std::map<std::string, GameStateInfo> gameStateDeclarations_s;
         static Game* singletonPtr_s;        //!< Pointer to the Singleton
-    };
+    }; //tolua_export
 
     template <class T>
@@ -209,5 +215,5 @@
         return true;
     }
-}
+} //tolua_export
 
 #endif /* _Game_H__ */
Index: code/branches/menu/src/libraries/core/LuaState.cc
===================================================================
--- code/branches/menu/src/libraries/core/LuaState.cc	(revision 5944)
+++ code/branches/menu/src/libraries/core/LuaState.cc	(revision 6024)
@@ -164,5 +164,5 @@
             if (sourceFileInfo != NULL)
                 origin = " originating from " + sourceFileInfo_->filename;
-            COUT(2) << "Error in Lua-script" << origin << ": " << lua_tostring(luaState_, -1) << std::endl;
+            COUT(1) << "Error in Lua-script" << origin << ": " << lua_tostring(luaState_, -1) << std::endl;
             // return value is nil
             lua_pushnil(luaState_);
