Index: code/branches/gui/src/core/Game.cc
===================================================================
--- code/branches/gui/src/core/Game.cc	(revision 2849)
+++ code/branches/gui/src/core/Game.cc	(revision 2850)
@@ -40,4 +40,5 @@
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/SubString.h"
 #include "Clock.h"
 #include "CommandLine.h"
@@ -247,5 +248,5 @@
         // Check parent and all its grand parents
         GameStateTreeNode* currentNode = lastRequestedNode;
-        while (requestedNode == NULL && currentNode->parent_ != NULL)
+        while (requestedNode == NULL && currentNode != NULL)
         {
             if (currentNode->state_ == state)
@@ -260,4 +261,11 @@
     }
 
+    void Game::requestStates(const std::string& names)
+    {
+        SubString tokens(names, ",;", " ");
+        for (unsigned int i = 0; i < tokens.size(); ++i)
+            this->requestState(tokens[i]);
+    }
+
     void Game::popState()
     {
@@ -270,5 +278,5 @@
     GameState* Game::getState(const std::string& name)
     {
-        std::map<std::string, GameState*>::const_iterator it = allStates_s.find(name);
+        std::map<std::string, GameState*>::const_iterator it = allStates_s.find(getLowercase(name));
         if (it != allStates_s.end())
             return it->second;
@@ -356,5 +364,8 @@
     void Game::loadState(GameState* state)
     {
+        if (!this->activeStates_.empty())
+            this->activeStates_.back()->activity_.topState = false;
         state->activate();
+        state->activity_.topState = true;
         this->activeStates_.push_back(state);
     }
@@ -362,13 +373,16 @@
     void Game::unloadState(orxonox::GameState* state)
     {
+        state->activity_.topState = false;
         state->deactivate();
         this->activeStates_.pop_back();
+        if (!this->activeStates_.empty())
+            this->activeStates_.back()->activity_.topState = true;
     }
 
     /*static*/ bool Game::addGameState(GameState* state)
     {
-        std::map<std::string, GameState*>::const_iterator it = allStates_s.find(state->getName());
+        std::map<std::string, GameState*>::const_iterator it = allStates_s.find(getLowercase(state->getName()));
         if (it == allStates_s.end())
-            allStates_s[state->getName()] = state;
+            allStates_s[getLowercase(state->getName())] = state;
         else
             ThrowException(GameState, "Cannot add two GameStates with the same name to 'Game'.");
Index: code/branches/gui/src/core/Game.h
===================================================================
--- code/branches/gui/src/core/Game.h	(revision 2849)
+++ code/branches/gui/src/core/Game.h	(revision 2850)
@@ -66,4 +66,5 @@
 
         void requestState(const std::string& name);
+        void requestStates(const std::string& names);
         void popState();
 
Index: code/branches/gui/src/core/GameState.cc
===================================================================
--- code/branches/gui/src/core/GameState.cc	(revision 2849)
+++ code/branches/gui/src/core/GameState.cc	(revision 2850)
@@ -49,6 +49,10 @@
         , parent_(0)
     {
-        State temp = {false, false, false, false, false};
-        this->activity_ = temp;
+        this->activity_.activating   = false;
+        this->activity_.active       = false;
+        this->activity_.deactivating = false;
+        this->activity_.suspended    = false;
+        this->activity_.topState     = false;
+        this->activity_.updating     = false;
     }
 
Index: code/branches/gui/src/core/GameState.h
===================================================================
--- code/branches/gui/src/core/GameState.h	(revision 2849)
+++ code/branches/gui/src/core/GameState.h	(revision 2850)
@@ -74,4 +74,5 @@
             unsigned updating     : 1;
             unsigned suspended    : 1;
+            unsigned topState     : 1;
         };
 
@@ -81,5 +82,5 @@
 
         const std::string& getName() const { return name_; }
-        const State getActivity() const    { return this->activity_; }
+        State getActivity() const    { return this->activity_; }
         GameState* getParent() const       { return this->parent_; }
 
Index: code/branches/gui/src/orxonox/CameraManager.cc
===================================================================
--- code/branches/gui/src/orxonox/CameraManager.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/CameraManager.cc	(revision 2850)
@@ -142,5 +142,5 @@
 
         this->viewport_->setCamera(camera);
-        GUIManager::getInstancePtr()->setCamera(camera);
+        GUIManager::getInstance().setCamera(camera);
 
         // reactivate all visible compositors
Index: code/branches/gui/src/orxonox/GraphicsManager.cc
===================================================================
--- code/branches/gui/src/orxonox/GraphicsManager.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/GraphicsManager.cc	(revision 2850)
@@ -216,4 +216,9 @@
     }
 
+    void GraphicsManager::setCamera(Ogre::Camera* camera)
+    {
+        this->viewport_->setCamera(camera);
+    }
+
     /**
     @brief
Index: code/branches/gui/src/orxonox/GraphicsManager.h
===================================================================
--- code/branches/gui/src/orxonox/GraphicsManager.h	(revision 2849)
+++ code/branches/gui/src/orxonox/GraphicsManager.h	(revision 2850)
@@ -66,6 +66,4 @@
             { return this->detailLevelParticle_; }
 
-        inline void setViewport(Ogre::Viewport* viewport)
-            { this->viewport_ = viewport; }
         inline Ogre::Viewport* getViewport() const
             { return this->viewport_; }
@@ -73,6 +71,7 @@
             { return this->renderWindow_; }
 
+        void setCamera(Ogre::Camera* camera);
+
         static GraphicsManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
-
 
     private:
Index: code/branches/gui/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/branches/gui/src/orxonox/gamestates/CMakeLists.txt	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/CMakeLists.txt	(revision 2850)
@@ -1,9 +1,9 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  GSClient.cc
   GSDedicated.cc
-  GSClient.cc
   GSGraphics.cc
-  GSGUI.cc
   GSIOConsole.cc
   GSLevel.cc
+  GSMainMenu.cc
   GSRoot.cc
   GSServer.cc
Index: code/branches/gui/src/orxonox/gamestates/GSGUI.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSGUI.cc	(revision 2849)
+++ 	(revision )
@@ -1,96 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "GSGUI.h"
-
-#include <OgreViewport.h>
-#include "core/Clock.h"
-#include "core/ConsoleCommand.h"
-#include "core/Game.h"
-#include "core/input/InputManager.h"
-#include "core/input/SimpleInputState.h"
-#include "gui/GUIManager.h"
-#include "GraphicsManager.h"
-
-namespace orxonox
-{
-    AddGameState(GSGUI, "mainMenu");
-
-    GSGUI::GSGUI(const std::string& name)
-        : GameState(name)
-    {
-    }
-
-    GSGUI::~GSGUI()
-    {
-    }
-
-    void GSGUI::activate()
-    {
-        guiManager_ = GUIManager::getInstancePtr();
-
-        // show main menu
-        //guiManager_->loadScene("MainMenu");
-        guiManager_->showGUI("MainMenu", 0);
-        GraphicsManager::getInstance().getViewport()->setCamera(guiManager_->getCamera());
-
-        {
-            // time factor console command
-            FunctorMember<GSGUI>* functor = createFunctor(&GSGUI::startGame);
-            functor->setObject(this);
-            this->ccStartGame_ = createConsoleCommand(functor, "startGame");
-            CommandExecutor::addConsoleCommandShortcut(this->ccStartGame_);
-        }
-    }
-
-    void GSGUI::deactivate()
-    {
-        if (this->ccStartGame_)
-        {
-            delete this->ccStartGame_;
-            this->ccStartGame_ = 0;
-        }
-
-        guiManager_->hideGUI();
-    }
-
-    void GSGUI::update(const Clock& time)
-    {
-        // tick CEGUI
-        guiManager_->update(time);
-    }
-
-    void GSGUI::startGame()
-    {
-        // HACK - HACK
-        Game::getInstance().popState();
-        Game::getInstance().requestState("standalone");
-        Game::getInstance().requestState("level");
-    }
-}
Index: code/branches/gui/src/orxonox/gamestates/GSGUI.h
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSGUI.h	(revision 2849)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _GSGUI_H__
-#define _GSGUI_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/GameState.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport GSGUI : public GameState
-    {
-    public:
-        GSGUI(const std::string& name);
-        ~GSGUI();
-
-        void activate();
-        void deactivate();
-        void update(const Clock& time);
-
-        void startGame();
-
-    private:
-        GUIManager* guiManager_;
-
-        // console commands
-        ConsoleCommand* ccStartGame_;
-    };
-}
-
-#endif /* _GSGUI_H__ */
Index: code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSGraphics.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSGraphics.cc	(revision 2850)
@@ -35,4 +35,5 @@
 #include "util/Debug.h"
 #include "core/ConfigValueIncludes.h"
+#include "core/Clock.h"
 #include "core/Core.h"
 #include "core/CoreIncludes.h"
@@ -146,4 +147,5 @@
         this->inputManager_->update(time);        // tick console
         this->console_->update(time);
+        this->guiManager_->update(time);
 
         uint64_t timeAfterTick = time.getRealMicroseconds();
@@ -152,4 +154,5 @@
         Game::getInstance().addTickTime(timeAfterTick - timeBeforeTick);
 
+        // Render
         this->graphicsManager_->update(time);
     }
Index: code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc	(revision 2850)
@@ -53,15 +53,33 @@
     void GSIOConsole::activate()
     {
+        {
+            FunctorMember<GSIOConsole>* functor = createFunctor(&GSIOConsole::loadMenu);
+            functor->setObject(this);
+            this->ccLoadMenu_ = createConsoleCommand(functor, "loadMenu");
+            CommandExecutor::addConsoleCommandShortcut(this->ccLoadMenu_);
+        }
     }
 
     void GSIOConsole::deactivate()
     {
+        if (this->ccLoadMenu_)
+        {
+            delete this->ccLoadMenu_;
+            this->ccLoadMenu_ = 0;
+        }
     }
 
     void GSIOConsole::update(const Clock& time)
     {
+        std::cout << ">";
         std::string command;
         std::getline(std::cin, command);
         CommandExecutor::execute(command, true);
     }
+
+    void GSIOConsole::loadMenu()
+    {
+        Game::getInstance().popState();
+        Game::getInstance().requestStates("graphics, mainMenu");
+    }
 }
Index: code/branches/gui/src/orxonox/gamestates/GSIOConsole.h
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSIOConsole.h	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSIOConsole.h	(revision 2850)
@@ -46,5 +46,8 @@
 
     private:
+        void loadMenu();
 
+        // console commands
+        ConsoleCommand* ccLoadMenu_;
     };
 }
Index: code/branches/gui/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSLevel.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSLevel.cc	(revision 2850)
@@ -49,4 +49,5 @@
 #include "LevelManager.h"
 #include "PlayerManager.h"
+#include "gui/GUIManager.h"
 
 namespace orxonox
@@ -86,4 +87,11 @@
         if (GameMode::showsGraphics())
         {
+            {
+                FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::toggleGUI);
+                functor->setObject(this);
+                this->ccToggleGUI_ = createConsoleCommand(functor, "toggleGUI");
+                CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
+            }
+
             inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game");
             keyBinder_ = new KeyBinder();
@@ -110,7 +118,4 @@
         if (GameMode::showsGraphics())
         {
-            // TODO: insert slomo console command with
-            // .accessLevel(AccessLevel::Offline).defaultValue(0, 1.0).axisParamIndex(0).isAxisRelative(false);
-
             // keybind console command
             FunctorMember<GSLevel>* functor1 = createFunctor(&GSLevel::keybind);
@@ -125,4 +130,7 @@
             InputManager::getInstance().setKeyDetectorCallback(std::string("keybind ") + keyDetectorCallbackCode_);
 
+            // InGame GUI test
+            GUIManager::getInstance().showGUI("inGameTest");
+
             // level is loaded: we can start capturing the input
             InputManager::getInstance().requestEnterState("game");
@@ -143,4 +151,10 @@
             this->ccTkeybind_ = 0;
         }
+        if (this->ccToggleGUI_)
+        {
+            delete this->ccToggleGUI_;
+            this->ccToggleGUI_ = 0;
+        }
+
 
         // this call will delete every BaseObject!
@@ -219,4 +233,12 @@
 
         delete this->startFile_;
+    }
+
+    void GSLevel::toggleGUI()
+    {
+        if (GameMode::showsGraphics())
+        {
+            GUIManager::getInstance().executeCode("toggleGUI()");
+        }
     }
 
Index: code/branches/gui/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSLevel.h	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSLevel.h	(revision 2850)
@@ -47,4 +47,6 @@
         void update(const Clock& time);
 
+        void toggleGUI();
+
     protected:
         void loadLevel();
@@ -70,5 +72,5 @@
         ConsoleCommand*       ccKeybind_;
         ConsoleCommand*       ccTkeybind_;
-
+        ConsoleCommand*       ccToggleGUI_;
     };
 }
Index: code/branches/gui/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSMainMenu.cc	(revision 2850)
+++ code/branches/gui/src/orxonox/gamestates/GSMainMenu.cc	(revision 2850)
@@ -0,0 +1,107 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "GSMainMenu.h"
+
+//#include <OgreViewport.h>
+#include <OgreSceneManager.h>
+#include "core/Clock.h"
+#include "core/ConsoleCommand.h"
+#include "core/Game.h"
+#include "core/input/InputManager.h"
+#include "core/input/SimpleInputState.h"
+#include "gui/GUIManager.h"
+#include "objects/Scene.h"
+#include "GraphicsManager.h"
+
+namespace orxonox
+{
+    AddGameState(GSMainMenu, "mainMenu");
+
+    GSMainMenu::GSMainMenu(const std::string& name)
+        : GameState(name)
+        , inputState_(0)
+    {
+    }
+
+    GSMainMenu::~GSMainMenu()
+    {
+    }
+
+    void GSMainMenu::activate()
+    {
+        inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("mainMenu");
+        inputState_->setHandler(GUIManager::getInstancePtr());
+        inputState_->setJoyStickHandler(&InputManager::EMPTY_HANDLER);
+
+        // create an empty Scene
+        this->scene_ = new Scene(0);
+        // and a Camera
+        this->camera_ = this->scene_->getSceneManager()->createCamera("mainMenu/Camera");
+
+        // show main menu
+        GUIManager::getInstance().showGUI("mainMenu");
+        GUIManager::getInstance().setCamera(this->camera_);
+        GraphicsManager::getInstance().setCamera(this->camera_);
+
+        {
+            FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startGame);
+            functor->setObject(this);
+            this->ccStartGame_ = createConsoleCommand(functor, "startGame");
+            CommandExecutor::addConsoleCommandShortcut(this->ccStartGame_);
+        }
+        
+        InputManager::getInstance().requestEnterState("mainMenu");
+    }
+
+    void GSMainMenu::deactivate()
+    {
+        InputManager::getInstance().requestLeaveState("game");
+        InputManager::getInstance().requestDestroyState("game");
+
+        if (this->ccStartGame_)
+        {
+            delete this->ccStartGame_;
+            this->ccStartGame_ = 0;
+        }
+
+        GUIManager::getInstance().executeCode("hideGUI()");
+    }
+
+    void GSMainMenu::update(const Clock& time)
+    {
+    }
+
+    void GSMainMenu::startGame()
+    {
+        // HACK - HACK
+        Game::getInstance().popState();
+        Game::getInstance().requestStates("standalone, level");
+    }
+}
Index: code/branches/gui/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSMainMenu.h	(revision 2850)
+++ code/branches/gui/src/orxonox/gamestates/GSMainMenu.h	(revision 2850)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _GSMainMenu_H__
+#define _GSMainMenu_H__
+
+#include "OrxonoxPrereqs.h"
+#include <OgrePrerequisites.h>
+#include "core/GameState.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport GSMainMenu : public GameState
+    {
+    public:
+        GSMainMenu(const std::string& name);
+        ~GSMainMenu();
+
+        void activate();
+        void deactivate();
+        void update(const Clock& time);
+
+        void startGame();
+
+    private:
+        SimpleInputState* inputState_;
+        Scene*            scene_;
+        Ogre::Camera*     camera_;
+
+        // console commands
+        ConsoleCommand* ccStartGame_;
+    };
+}
+
+#endif /* _GSMainMenu_H__ */
Index: code/branches/gui/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/gui/src/orxonox/gamestates/GSRoot.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/gamestates/GSRoot.cc	(revision 2850)
@@ -44,5 +44,10 @@
 {
     AddGameState(GSRoot, "root");
-    SetCommandLineSwitch(startWithConsole);
+    SetCommandLineSwitch(console);
+    // Shortcuts for easy direct loading
+    SetCommandLineSwitch(server);
+    SetCommandLineSwitch(client);
+    SetCommandLineSwitch(dedicated);
+    SetCommandLineSwitch(standalone);
 
     GSRoot::GSRoot(const std::string& name)
@@ -63,5 +68,5 @@
     {
         // reset game speed to normal
-        timeFactor_ = 1.0f;
+        this->timeFactor_ = 1.0f;
 
         {
@@ -81,17 +86,41 @@
         }
 
+        // Load level directly?
+        bool loadLevel = false;
+        if (CommandLine::getValue("standalone").getBool())
+        {
+            Game::getInstance().requestStates("graphics, standalone, level");
+            loadLevel = true;
+        }
+        if (CommandLine::getValue("server").getBool())
+        {
+            Game::getInstance().requestStates("graphics, server, level");
+            loadLevel = true;
+        }
+        if (CommandLine::getValue("client").getBool())
+        {
+            Game::getInstance().requestStates("graphics, standalone, level");
+            loadLevel = true;
+        }
+        if (CommandLine::getValue("dedicated").getBool())
+        {
+            Game::getInstance().requestStates("dedicated, level");
+            loadLevel = true;
+        }
+        
         // Determine where to start
-        if (CommandLine::getValue("startWithConsole").getBool())
-        {
-            // Start the game in the console
-            Game::getInstance().requestState("ioConsole");
-        }
-        else
-        {
-            // Start in GUI main menu
-            Game::getInstance().requestState("graphics");
-            Game::getInstance().requestState("mainMenu");
-        }
-
+        if (!loadLevel)
+        {
+            if (CommandLine::getValue("console").getBool())
+            {
+                // Start the game in the console without 3D graphics
+                Game::getInstance().requestState("ioConsole");
+            }
+            else
+            {
+                // Start in GUI mode
+                Game::getInstance().requestStates("graphics, mainMenu");
+            }
+        }
     }
 
@@ -113,4 +142,11 @@
     void GSRoot::update(const Clock& time)
     {
+        if (this->getActivity().topState)
+        {
+            // This state can not 'survive' on its own.
+            // Load a user interface therefore
+            Game::getInstance().requestState("ioConsole");
+        }
+
         uint64_t timeBeforeTick = time.getRealMicroseconds();
 
@@ -132,5 +168,5 @@
         uint64_t timeAfterTick = time.getRealMicroseconds();
 
-        // Also add our tick time to the list in GSRoot
+        // Also add our tick time
         Game::getInstance().addTickTime(timeAfterTick - timeBeforeTick);
     }
Index: code/branches/gui/src/orxonox/gui/GUIManager.cc
===================================================================
--- code/branches/gui/src/orxonox/gui/GUIManager.cc	(revision 2849)
+++ code/branches/gui/src/orxonox/gui/GUIManager.cc	(revision 2850)
@@ -36,7 +36,6 @@
 #include "GUIManager.h"
 
-#include <boost/filesystem.hpp>
+#include <boost/filesystem/path.hpp>
 #include <OgreRenderWindow.h>
-#include <OgreRoot.h>
 #include <CEGUI.h>
 #include <CEGUIDefaultLogger.h>
@@ -50,8 +49,7 @@
 
 #include "util/Exception.h"
-#include "core/input/InputManager.h"
-#include "core/input/SimpleInputState.h"
 #include "core/ConsoleCommand.h"
 #include "core/Core.h"
+#include "core/Clock.h"
 #include "ToluaBindCore.h"
 #include "ToluaBindOrxonox.h"
@@ -63,15 +61,8 @@
 namespace orxonox
 {
-    SetConsoleCommandShortcut(GUIManager, toggleGUI).keybindMode(KeybindMode::OnPress);
-
     GUIManager* GUIManager::singletonRef_s = 0;
 
     GUIManager::GUIManager()
-        //: emptySceneManager_(0)
-        : backgroundSceneManager_(0)
-        //, emptyCamera_(0)
-        , backgroundCamera_(0)
-        //, viewport_(0)
-        , renderWindow_(0)
+        : renderWindow_(0)
         , guiRenderer_(0)
         , resourceProvider_(0)
@@ -86,18 +77,4 @@
     GUIManager::~GUIManager()
     {
-        if (backgroundCamera_)
-            backgroundSceneManager_->destroyCamera(backgroundCamera_);
-
-        if (backgroundSceneManager_)
-        {
-            // We have to make sure the SceneManager is not anymore referenced.
-            // For the case that the target SceneManager was yet another one, it
-            // wouldn't matter anyway since this is the destructor.
-            guiRenderer_->setTargetSceneManager(0);
-            Ogre::Root::getSingleton().destroySceneManager(backgroundSceneManager_);
-        }
-
-        InputManager::getInstance().requestDestroyState("gui");
-
         if (guiSystem_)
             delete guiSystem_;
@@ -110,8 +87,4 @@
 	        lua_pushnil(luaState_);
 	        lua_setglobal(luaState_, "Core");
-            // TODO: deleting the script module fails an assertion.
-            // However there is not much we can do about it since it occurs too when
-            // we don't open Core or Orxonox. Might be a CEGUI issue.
-            // The memory leak is not a problem anyway..
             delete scriptModule_;
         }
@@ -134,11 +107,4 @@
                 // save the render window
                 renderWindow_ = renderWindow;
-
-                // Full screen viewport with Z order = 0 (top most). Don't yet feed a camera (so nothing gets rendered)
-                //this->viewport_ = renderWindow_->addViewport(0, 3);
-                //this->viewport_->setOverlaysEnabled(false);
-                //this->viewport_->setShadowsEnabled(false);
-                //this->viewport_->setSkiesEnabled(false);
-                //this->viewport_->setClearEveryFrame(false);
 
                 // Note: No SceneManager specified yet
@@ -166,13 +132,6 @@
                 tolua_Orxonox_open(this->scriptModule_->getLuaState());
 
-                // register us as input handler
-                SimpleInputState* state = InputManager::getInstance().createInputState<SimpleInputState>("gui");
-                state->setHandler(this);
-                state->setJoyStickHandler(&InputManager::EMPTY_HANDLER);
-
-                // load the background scene
-                loadScenes();
-                //CEGUI::KeyEventArgs e;
-                //e.codepoint
+                // initialise the basic lua code
+                loadLuaCode();
             }
             catch (CEGUI::Exception& ex)
@@ -187,5 +146,4 @@
 
             state_ = Ready;
-
         }
 
@@ -193,58 +151,6 @@
     }
 
-    void GUIManager::loadScene(const std::string& name)
-    {
-        if (name.compare("IngameMenu") == 0)
-        {
-            try
-            {
-                /*this->scriptModule_ = new LuaScriptModule();
-                this->luaState_ = this->scriptModule_->getLuaState();
-                this->guiSystem_ = new System(this->guiRenderer_, this->resourceProvider_, 0, this->scriptModule_);
-                tolua_Core_open(this->scriptModule_->getLuaState());
-                tolua_Orxonox_open(this->scriptModule_->getLuaState());
-                */
-                this->scriptModule_->executeScriptFile("loadGUI_2.lua", "GUI");
-            }
-            catch (CEGUI::Exception& ex)
-            {
-#if CEGUI_VERSION_MINOR < 6
-                throw GeneralException(ex.getMessage().c_str());
-#else
-                throw GeneralException(ex.getMessage().c_str(), ex.getLine(),
-                                       ex.getFileName().c_str(), ex.getName().c_str());
-#endif
-            }
-        }
-        else
-        {
-            loadScenes();
-        }
-    }
-
-    void GUIManager::loadScenes()
-    {
-        // first of all, we need to have our own SceneManager for the GUI. The reason
-        // is that we might have multiple viewports when in play mode (e.g. the view of
-        // a camera fixed at the back of the ship). That forces us to create our own
-        // full screen viewport that is on top of all the others, but doesn't clear the
-        // port before rendering, so everything from the GUI gets on top eventually.
-        // But in order to realise that, we also need a SceneManager with an empty scene,
-        // because the SceneManager is responsible for the render queue.
-        //this->emptySceneManager_ = Ogre::Root::getSingleton()
-        //    .createSceneManager(Ogre::ST_GENERIC, "GUI/EmptySceneManager");
-
-        // we also need a camera or we won't see anything at all.
-        // The camera settings don't matter at all for an empty scene since the GUI
-        // gets rendered on top of the screen rather than into the scene.
-        //this->emptyCamera_ = this->emptySceneManager_->createCamera("GUI/EmptyCamera");
-
-        // Create another SceneManager that enables to display some 3D
-        // scene in the background of the main menu.
-        this->backgroundSceneManager_ = Ogre::Root::getSingleton()
-            .createSceneManager(Ogre::ST_GENERIC, "GUI/BackgroundSceneManager");
-        this->backgroundCamera_ = backgroundSceneManager_->createCamera("GUI/BackgroundCamera");
-
-        // TODO: create something 3D
+    void GUIManager::loadLuaCode()
+    {
         try
         {
@@ -264,11 +170,13 @@
     }
 
-    void GUIManager::toggleGUI()
-    {
-        //COUT(0) << "********* TOGGLE TOGGLE **********" << std::endl;
-        if (getInstance().scriptModule_->executeScriptGlobal("toggleGUI"))
-            InputManager::getInstance().requestEnterState("gui");
-        else
-            InputManager::getInstance().requestLeaveState("gui");
+    void GUIManager::update(const Clock& time)
+    {
+        assert(guiSystem_);
+        guiSystem_->injectTimePulse(time.getDeltaTime());
+    }
+
+    void GUIManager::executeCode(const std::string& str)
+    {
+        this->scriptModule_->executeString(str);
     }
 
@@ -278,44 +186,12 @@
     }
 
-    void GUIManager::showGUI(const std::string& name, Ogre::SceneManager* sceneManager)// bool showBackground)
+    void GUIManager::showGUI(const std::string& name)
     {
         if (state_ != Uninitialised)
         {
-            if (state_ == OnDisplay)
-                hideGUI();
-
             COUT(3) << "Loading GUI " << name << std::endl;
             try
             {
-		// COUT (0) << "************* sceneManager: " << sceneManager << std::endl;
-                if (!sceneManager)
-                {
-                    // currently, only an image is loaded. We could do 3D, see loadBackground.
-                    //this->viewport_->setClearEveryFrame(true);
-                    this->guiRenderer_->setTargetSceneManager(this->backgroundSceneManager_);
-                    //this->viewport_->setCamera(this->backgroundCamera_);
-
-                    lua_pushboolean(this->scriptModule_->getLuaState(), true);
-                    lua_setglobal(this->scriptModule_->getLuaState(), "showBackground");
-                }
-                else
-                {
-                    //this->viewport_->setClearEveryFrame(false);
-                    this->guiRenderer_->setTargetSceneManager(sceneManager);
-                    currentSceneManager_ = sceneManager;
-                    //this->viewport_->setCamera(this->emptyCamera_);
-
-                    lua_pushboolean(this->scriptModule_->getLuaState(), false);
-                    lua_setglobal(this->scriptModule_->getLuaState(), "showBackground");
-                }
-
-                lua_pushfstring(this->scriptModule_->getLuaState(), "mainmenu.lua");
-                lua_setglobal(this->scriptModule_->getLuaState(), "filename");
-
-                this->scriptModule_->executeScriptGlobal("showGUI");
-
-                InputManager::getInstance().requestEnterState("gui");
-
-                this->state_ = OnDisplay;
+                this->scriptModule_->executeString(std::string("showGUI(\"") + name + "\")");
             }
             catch (CEGUI::Exception& ex)
@@ -332,26 +208,4 @@
             COUT(2) << "Warning: GUI Manager not yet initialised, cannot load a GUI" << std::endl;
         }
-    }
-
-    /*void GUIManager::testFct()
-    {
-        //COUT(0) << "**** " << currentSceneManager_ << std::endl;
-        this->showGUI("IngameMenu", currentSceneManager_);
-    }
-
-    void GUIManager::testOutput(const std::string& str)
-    {
-        COUT(0) << "***" << str << "***" << std::endl;
-    }*/
-
-    void GUIManager::hideGUI()
-    {
-        if (this->state_ != OnDisplay)
-            return;
-        //this->viewport_->setCamera(0);
-        // has no effect since you cannot assign 0 as SceneManager
-        //this->guiRenderer_->setTargetSceneManager(0);
-        this->state_ = Ready;
-        InputManager::getInstance().requestLeaveState("gui");
     }
 
Index: code/branches/gui/src/orxonox/gui/GUIManager.h
===================================================================
--- code/branches/gui/src/orxonox/gui/GUIManager.h	(revision 2849)
+++ code/branches/gui/src/orxonox/gui/GUIManager.h	(revision 2850)
@@ -40,5 +40,4 @@
 #include <CEGUIInputEvent.h>
 #include <CEGUISystem.h>
-#include "core/Clock.h"
 #include "core/input/InputInterfaces.h"
 
@@ -71,26 +70,11 @@
 
         bool initialise(Ogre::RenderWindow* renderWindow);
-        void loadScene(const std::string& name);
-        void update(const Clock& time)
-        {
-            assert(guiSystem_);
-            guiSystem_->injectTimePulse(time.getDeltaTime());
-        }
-        void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export
-        void hideGUI(); // tolua_export
-        //void testOutput(const std::string& str); // tolua_export
 
-        static void toggleGUI();
+        void update(const Clock& time);
+
+        void showGUI(const std::string& name);
+        void executeCode(const std::string& str);
 
         void setCamera(Ogre::Camera* camera);
-        Ogre::Camera* getCamera() { return this->backgroundCamera_; }
-
-        static void showGUI_s(const std::string& name, Ogre::SceneManager* sceneManager)//bool showBackground)
-        {
-            getInstance().showGUI(name, sceneManager);
-        }
-
-        // please remove
-        //void testFct();
 
         static GUIManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; } // tolua_export
@@ -99,4 +83,6 @@
     private:
         GUIManager(const GUIManager& instance);
+
+        void loadLuaCode();
 
         void keyPressed (const KeyEvent& evt)
@@ -120,11 +106,4 @@
         void updateMouse(float dt) { }
 
-        void loadScenes();
-
-        //Ogre::SceneManager*       emptySceneManager_;
-        Ogre::SceneManager*       backgroundSceneManager_;
-        //Ogre::Camera*             emptyCamera_;
-        Ogre::Camera*             backgroundCamera_;
-        //Ogre::Viewport*           viewport_;
         Ogre::RenderWindow*       renderWindow_;
         CEGUI::OgreCEGUIRenderer* guiRenderer_;
@@ -135,5 +114,4 @@
         CEGUI::Imageset*          backgroundImage_;
         lua_State*                luaState_;
-        Ogre::SceneManager*         currentSceneManager_;
 
         State state_;
