Index: code/branches/gui/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/branches/gui/src/orxonox/gamestates/CMakeLists.txt	(revision 2848)
+++ 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 2848)
+++ 	(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 2848)
+++ 	(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 2848)
+++ 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 2848)
+++ 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 2848)
+++ 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 2848)
+++ 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 2848)
+++ 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 2848)
+++ 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);
     }
