Index: code/trunk/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSDedicated.cc	(revision 6105)
+++ 	(revision )
@@ -1,301 +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:
- *      Fabian 'x3n' Landau
- *
- */
-
-#include "GSDedicated.h"
-
-#include <iomanip>
-#include <iostream>
-#include <boost/bind.hpp>
-
-#include "util/Clock.h"
-#include "util/Debug.h"
-#include "util/Sleep.h"
-#include "core/CommandLineParser.h"
-#include "core/CommandExecutor.h"
-#include "core/Game.h"
-#include "core/GameMode.h"
-#include "network/Server.h"
-
-#ifdef ORXONOX_PLATFORM_UNIX
-#include <termios.h>
-#endif
-
-
-namespace orxonox
-{
-    const unsigned int MAX_COMMAND_LENGTH = 255;
-    
-    DeclareGameState(GSDedicated, "dedicated", false, false);
-    
-    termios* GSDedicated::originalTerminalSettings_;
-
-    GSDedicated::GSDedicated(const GameStateInfo& info)
-        : GameState(info)
-        , server_(0)
-        , closeThread_(false)
-        , cleanLine_(true)
-        , inputIterator_(0)
-        , cursorX_(0)
-        , cursorY_(0)
-    {
-    }
-
-    GSDedicated::~GSDedicated()
-    {
-    }
-
-    void GSDedicated::activate()
-    {
-        GameMode::setHasServer(true);
-        
-        this->inputThread_ = new boost::thread(boost::bind(&GSDedicated::inputThread, this));
-        
-#ifndef ORXONOX_PLATFORM_WINDOWS
-        this->originalTerminalSettings_ = new termios;
-        this->setTerminalMode();
-#endif
-
-        this->server_ = new Server(CommandLineParser::getValue("port"));
-        COUT(0) << "Loading scene in server mode" << std::endl;
-
-        server_->open();
-    }
-
-    void GSDedicated::deactivate()
-    {
-        this->server_->close();
-        delete this->server_;
-
-        closeThread_ = true;
-#ifdef ORXONOX_PLATFORM_UNIX
-        std::cout << "\033[0G\033[K";
-        std::cout.flush();
-        resetTerminalMode();
-        delete this->originalTerminalSettings_;
-#else
-        COUT(0) << "Press enter to end the game..." << std::endl;
-#endif
-        inputThread_->join();
-        delete this->inputThread_;
-
-        GameMode::setHasServer(false);
-    }
-
-    void GSDedicated::update(const Clock& time)
-    {
-        server_->update(time);
-        processQueue();
-        printLine();
-    }
-    
-    void GSDedicated::inputThread()
-    {
-        this->commandLine_ = new unsigned char[MAX_COMMAND_LENGTH];
-//         memset( this->commandLine_, 0, MAX_COMMAND_LENGTH );
-        unsigned char c;
-        unsigned int  escapeChar=0;
-        while(!closeThread_)
-        {
-#ifdef ORXONOX_PLATFORM_UNIX
-            size_t count = read(STDIN_FILENO, &c, 1);
-            if (count == 1)
-#else
-            c = getchar();
-#endif
-            {
-//                 boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                if ( inputIterator_>=MAX_COMMAND_LENGTH-1 && c!='\n' )
-                    continue;
-                if( escapeChar > 0 )
-                {
-                    if( c == '[' )
-                    {
-                        escapeChar = 2;
-                        continue;
-}
-                    else if ( escapeChar == 2 )
-                    {
-                        switch (c)
-                        {
-                            case 'A': //keyup
-                                
-                                break;
-                            case 'B': //keydown
-                                
-                                break;
-                            case 'C': //keyright
-                                if(cursorX_<inputIterator_)
-                                    ++cursorX_;
-                                break;
-                            case 'D': //keyleft
-                                if(cursorX_>0)
-                                    --cursorX_;
-                                break;
-                            default: //not supported...
-//                                 std::cout << endl << c << endl;
-                                break;
-                        }
-                        escapeChar = 0;
-                    }
-                }
-                else // not in escape sequence mode
-                {
-                    switch (c)
-                    {
-                        case '\n':
-                            this->cleanLine_ = true;
-                            {
-                                boost::recursive_mutex::scoped_lock(this->inputQueueMutex_);
-                                boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                                this->commandQueue_.push( std::string((const char*)this->commandLine_,inputIterator_) );
-                            }
-                            memset( this->commandLine_, 0, inputIterator_ );
-                            inputIterator_ = 0;
-                            this->cursorX_ = 0;
-                            this->cursorY_ = 0;
-                            std::cout << endl;
-                            break;
-                        case 127: // backspace
-                        case '\b':
-                            deleteCharacter( this->cursorX_ );
-                            break;
-                        case '\t':
-                        {
-//                             boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                            std::cout << endl << CommandExecutor::hint( std::string((const char*)this->commandLine_,inputIterator_) ) << endl;
-                            strncpy(reinterpret_cast<char*>(this->commandLine_), CommandExecutor::complete( std::string(reinterpret_cast<char*>(this->commandLine_),inputIterator_) ).c_str(), MAX_COMMAND_LENGTH);
-                            this->inputIterator_ = strlen((const char*)this->commandLine_);
-                            this->cursorX_ = this->inputIterator_;
-                            break;
-                        }
-                        case '\033': // 1. escape character
-                            escapeChar = 1;
-                            break;
-                        default:
-                            insertCharacter( this->cursorX_, c );
-                            break;
-                    }
-                }
-            }
-        }
-
-        delete[] this->commandLine_;
-    }
-    
-    void GSDedicated::printLine()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        // set cursor to the begining of the line and erase the line
-        std::cout << "\033[0G\033[K";
-//         boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-        // print status line
-        std::cout << std::fixed << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgFPS() << " fps, " << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgTickTime() << " ms avg ticktime # ";
-        //save cursor position
-        std::cout << "\033[s";
-        //print commandLine buffer
-        std::cout << std::string((const char*)this->commandLine_, inputIterator_);
-        //restore cursor position and move it cursorX_ to the right
-        std::cout << "\033[u";
-        if( this->cursorX_ > 0 )
-            std::cout << "\033[" << this->cursorX_ << "C";
-        std::cout.flush();
-#endif
-    }
-    
-    void GSDedicated::processQueue()
-    {
-        std::string tempstr;
-        {
-            boost::recursive_mutex::scoped_lock lock1(this->inputQueueMutex_);
-            while(true)
-            {
-                if ( !this->commandQueue_.empty() )
-                {
-                    tempstr = this->commandQueue_.front();
-                    this->commandQueue_.pop();
-                    lock1.unlock();
-                }
-                else
-                    break;
-                CommandExecutor::execute(tempstr, true);
-            }
-        }
-    }
-    
-    void GSDedicated::setTerminalMode()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        termios new_settings;
-     
-        tcgetattr(0,this->originalTerminalSettings_);
-        new_settings = *this->originalTerminalSettings_;
-        new_settings.c_lflag &= ~( ICANON | ECHO );
-//         new_settings.c_lflag |= ( ISIG | IEXTEN );
-        new_settings.c_cc[VTIME] = 1;
-        new_settings.c_cc[VMIN] = 0;
-        tcsetattr(0,TCSANOW,&new_settings);
-        COUT(0) << endl;
-//       atexit(&GSDedicated::resetTerminalMode);
-#endif
-    }
-    
-    void GSDedicated::resetTerminalMode()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        tcsetattr(0, TCSANOW, GSDedicated::originalTerminalSettings_);
-#endif
-    }
-    
-    void GSDedicated::insertCharacter( unsigned int position, char c )
-    {
-//         std::cout << endl << static_cast<unsigned int>(c) << endl;
-        // check that we do not exceed MAX_COMMAND_LENGTH
-        if( inputIterator_+1 < MAX_COMMAND_LENGTH )
-        {
-            // if cursor not at end of line then move the rest of the line
-            if( position != this->inputIterator_ )
-                    memmove( this->commandLine_+position+1, this->commandLine_+position, this->inputIterator_-position);
-//             boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-            this->commandLine_[position] = c;
-            ++this->cursorX_;
-            ++this->inputIterator_;
-        }
-    }
-    void GSDedicated::deleteCharacter( unsigned int position )
-    {
-//         boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-        if ( this->inputIterator_>0 && position>0 )
-        {
-            if ( position != this->inputIterator_ )
-                memmove( this->commandLine_+position-1, this->commandLine_+position, this->inputIterator_-position);
-            --this->cursorX_;
-            --this->inputIterator_;
-        }
-    }
-    
-}
Index: code/trunk/src/orxonox/gamestates/GSDedicatedClient.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSDedicatedClient.cc	(revision 6105)
+++ 	(revision )
@@ -1,306 +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:
- *      Oliver Scheuss
- *
- */
-
-#include "GSDedicatedClient.h"
-
-#include <iomanip>
-#include <iostream>
-#include <boost/bind.hpp>
-
-#include "util/Clock.h"
-#include "util/Debug.h"
-#include "util/Exception.h"
-#include "util/Sleep.h"
-#include "core/CommandLineParser.h"
-#include "core/CommandExecutor.h"
-#include "core/Game.h"
-#include "core/GameMode.h"
-#include "network/Client.h"
-
-#ifdef ORXONOX_PLATFORM_UNIX
-#include <termios.h>
-#endif
-
-
-namespace orxonox
-{
-    const unsigned int MAX_COMMAND_LENGTH = 255;
-    
-    DeclareGameState(GSDedicatedClient, "dedicatedClient", false, false);
-    
-    termios* GSDedicatedClient::originalTerminalSettings_;
-
-    GSDedicatedClient::GSDedicatedClient(const GameStateInfo& info)
-        : GameState(info)
-        , client_(0)
-        , closeThread_(false)
-        , cleanLine_(true)
-        , inputIterator_(0)
-        , cursorX_(0)
-        , cursorY_(0)
-    {
-    }
-
-    GSDedicatedClient::~GSDedicatedClient()
-    {
-    }
-
-    void GSDedicatedClient::activate()
-    {
-        this->inputThread_ = new boost::thread(boost::bind(&GSDedicatedClient::inputThread, this));
-        
-#ifndef ORXONOX_PLATFORM_WINDOWS
-        this->originalTerminalSettings_ = new termios;
-        this->setTerminalMode();
-#endif
-
-        this->client_ = new Client(CommandLineParser::getValue("ip").getString(), CommandLineParser::getValue("port"));
-        COUT(0) << "Loading scene in client mode" << std::endl;
-
-        if( !client_->establishConnection() )
-            ThrowException(InitialisationFailed, "Could not establish connection with server.");
-            
-        client_->update(Game::getInstance().getGameClock());
-
-
-    }
-
-    void GSDedicatedClient::deactivate()
-    {
-        if (this->client_)
-        {
-            this->client_->closeConnection();
-            delete this->client_;
-        }
-
-        closeThread_ = true;
-#ifdef ORXONOX_PLATFORM_UNIX
-        std::cout << "\033[0G\033[K";
-        std::cout.flush();
-        resetTerminalMode();
-        delete this->originalTerminalSettings_;
-#else
-        COUT(0) << "Press enter to end the game..." << std::endl;
-#endif
-        inputThread_->join();
-        delete this->inputThread_;
-    }
-
-    void GSDedicatedClient::update(const Clock& time)
-    {
-        client_->update(time);
-        processQueue();
-        printLine();
-    }
-    
-    void GSDedicatedClient::inputThread()
-    {
-        this->commandLine_ = new unsigned char[MAX_COMMAND_LENGTH];
-//         memset( this->commandLine_, 0, MAX_COMMAND_LENGTH );
-        unsigned char c;
-        unsigned int  escapeChar=0;
-        while(!closeThread_)
-        {
-#ifdef ORXONOX_PLATFORM_UNIX
-            size_t count = read(STDIN_FILENO, &c, 1);
-            if (count == 1)
-#else
-            c = getchar();
-#endif
-            {
-//                 boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                if ( inputIterator_>=MAX_COMMAND_LENGTH-1 && c!='\n' )
-                    continue;
-                if( escapeChar > 0 )
-                {
-                    if( c == '[' )
-                    {
-                        escapeChar = 2;
-                        continue;
-}
-                    else if ( escapeChar == 2 )
-                    {
-                        switch (c)
-                        {
-                            case 'A': //keyup
-                                
-                                break;
-                            case 'B': //keydown
-                                
-                                break;
-                            case 'C': //keyright
-                                if(cursorX_<inputIterator_)
-                                    ++cursorX_;
-                                break;
-                            case 'D': //keyleft
-                                if(cursorX_>0)
-                                    --cursorX_;
-                                break;
-                            default: //not supported...
-//                                 std::cout << endl << c << endl;
-                                break;
-                        }
-                        escapeChar = 0;
-                    }
-                }
-                else // not in escape sequence mode
-                {
-                    switch (c)
-                    {
-                        case '\n':
-                            this->cleanLine_ = true;
-                            {
-                                boost::recursive_mutex::scoped_lock(this->inputQueueMutex_);
-                                boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                                this->commandQueue_.push( std::string((const char*)this->commandLine_,inputIterator_) );
-                            }
-                            memset( this->commandLine_, 0, inputIterator_ );
-                            inputIterator_ = 0;
-                            this->cursorX_ = 0;
-                            this->cursorY_ = 0;
-                            std::cout << endl;
-                            break;
-                        case 127: // backspace
-                        case '\b':
-                            deleteCharacter( this->cursorX_ );
-                            break;
-                        case '\t':
-                        {
-//                             boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-                            std::cout << endl << CommandExecutor::hint( std::string((const char*)this->commandLine_,inputIterator_) ) << endl;
-                            strncpy(reinterpret_cast<char*>(this->commandLine_), CommandExecutor::complete( std::string(reinterpret_cast<char*>(this->commandLine_),inputIterator_) ).c_str(), MAX_COMMAND_LENGTH);
-                            this->inputIterator_ = strlen((const char*)this->commandLine_);
-                            this->cursorX_ = this->inputIterator_;
-                            break;
-                        }
-                        case '\033': // 1. escape character
-                            escapeChar = 1;
-                            break;
-                        default:
-                            insertCharacter( this->cursorX_, c );
-                            break;
-                    }
-                }
-            }
-        }
-
-        delete[] this->commandLine_;
-    }
-    
-    void GSDedicatedClient::printLine()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        // set cursor to the begining of the line and erase the line
-        std::cout << "\033[0G\033[K";
-//         boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-        // print status line
-        std::cout << std::fixed << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgFPS() << " fps, " << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgTickTime() << " ms avg ticktime # ";
-        //save cursor position
-        std::cout << "\033[s";
-        //print commandLine buffer
-        std::cout << std::string((const char*)this->commandLine_, inputIterator_);
-        //restore cursor position and move it cursorX_ to the right
-        std::cout << "\033[u";
-        if( this->cursorX_ > 0 )
-            std::cout << "\033[" << this->cursorX_ << "C";
-        std::cout.flush();
-#endif
-    }
-    
-    void GSDedicatedClient::processQueue()
-    {
-        std::string tempstr;
-        {
-            boost::recursive_mutex::scoped_lock lock1(this->inputQueueMutex_);
-            while(true)
-            {
-                if ( !this->commandQueue_.empty() )
-                {
-                    tempstr = this->commandQueue_.front();
-                    this->commandQueue_.pop();
-                    lock1.unlock();
-                }
-                else
-                    break;
-                CommandExecutor::execute(tempstr, true);
-            }
-        }
-    }
-    
-    void GSDedicatedClient::setTerminalMode()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        termios new_settings;
-     
-        tcgetattr(0,this->originalTerminalSettings_);
-        new_settings = *this->originalTerminalSettings_;
-        new_settings.c_lflag &= ~( ICANON | ECHO );
-//         new_settings.c_lflag |= ( ISIG | IEXTEN );
-        new_settings.c_cc[VTIME] = 1;
-        new_settings.c_cc[VMIN] = 0;
-        tcsetattr(0,TCSANOW,&new_settings);
-        COUT(0) << endl;
-//       atexit(&GSDedicatedClient::resetTerminalMode);
-#endif
-    }
-    
-    void GSDedicatedClient::resetTerminalMode()
-    {
-#ifdef ORXONOX_PLATFORM_UNIX
-        tcsetattr(0, TCSANOW, GSDedicatedClient::originalTerminalSettings_);
-#endif
-    }
-    
-    void GSDedicatedClient::insertCharacter( unsigned int position, char c )
-    {
-//         std::cout << endl << static_cast<unsigned int>(c) << endl;
-        // check that we do not exceed MAX_COMMAND_LENGTH
-        if( inputIterator_+1 < MAX_COMMAND_LENGTH )
-        {
-            // if cursor not at end of line then move the rest of the line
-            if( position != this->inputIterator_ )
-                    memmove( this->commandLine_+position+1, this->commandLine_+position, this->inputIterator_-position);
-//             boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-            this->commandLine_[position] = c;
-            ++this->cursorX_;
-            ++this->inputIterator_;
-        }
-    }
-    void GSDedicatedClient::deleteCharacter( unsigned int position )
-    {
-//         boost::recursive_mutex::scoped_lock(this->inputLineMutex_);
-        if ( this->inputIterator_>0 && position>0 )
-        {
-            if ( position != this->inputIterator_ )
-                memmove( this->commandLine_+position-1, this->commandLine_+position, this->inputIterator_-position);
-            --this->cursorX_;
-            --this->inputIterator_;
-        }
-    }
-    
-}
Index: code/trunk/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 6417)
@@ -64,6 +64,5 @@
     void GSGraphics::activate()
     {
-        // add console command to toggle GUI
-        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"));
+
     }
 
@@ -78,16 +77,4 @@
     }
 
-    /**
-    @brief
-        Toggles the visibility of the current GUI
-
-        This function just executes a Lua function in the main script of the GUI by accessing the GUIManager.
-        For more details on this function check out the Lua code.
-    */
-    void GSGraphics::toggleGUI()
-    {
-        GUIManager::getInstance().executeCode("toggleGUI()");
-    }
-
     void GSGraphics::update(const Clock& time)
     {
Index: code/trunk/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 6417)
@@ -57,6 +57,4 @@
         void update(const Clock& time);
 
-        void toggleGUI();
-
     private:
     };
Index: code/trunk/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 6417)
@@ -56,4 +56,5 @@
         , guiKeysOnlyInputState_(0)
         , startFile_(0)
+        , bShowIngameGUI_(false)
     {
     }
@@ -78,6 +79,4 @@
             guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
             guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
-
-            CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI"));
         }
 
@@ -91,23 +90,7 @@
             // level is loaded: we can start capturing the input
             InputManager::getInstance().enterState("game");
-            
+
             // connect the HumanPlayer to the game
             PlayerManager::getInstance().clientConnected(0);
-        }
-    }
-
-    void GSLevel::showIngameGUI(bool show)
-    {
-        if (show)
-        {
-            GUIManager::getInstance().showGUI("inGameTest");
-            GUIManager::getInstance().executeCode("showCursor()");
-            InputManager::getInstance().enterState("guiMouseOnly");
-        }
-        else
-        {
-            GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");
-            GUIManager::getInstance().executeCode("hideCursor()");
-            InputManager::getInstance().leaveState("guiMouseOnly");
         }
     }
@@ -122,5 +105,5 @@
             InputManager::getInstance().leaveState("game");
         }
-        
+
         // disconnect all HumanPlayers
         PlayerManager::getInstance().disconnectAllClients();
@@ -152,5 +135,5 @@
         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
             this->staticObjects_.insert(*it);
-        
+
         // call the loader
         COUT(0) << "Loading level..." << std::endl;
@@ -171,5 +154,5 @@
             if (find == this->staticObjects_.end())
             {
-                COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << ")" << std::endl;
+                COUT(3) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << ')' << std::endl;
             }
         }
Index: code/trunk/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 6417)
@@ -52,5 +52,4 @@
         void loadLevel();
         void unloadLevel();
-        void showIngameGUI(bool show);
 
         InputState*              gameInputState_;          //!< input state for normal ingame playing
@@ -60,4 +59,5 @@
         XMLFile* startFile_;
         std::set<BaseObject*> staticObjects_;
+        bool bShowIngameGUI_;
     };
 }
Index: code/trunk/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSMainMenu.cc	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSMainMenu.cc	(revision 6417)
@@ -36,4 +36,6 @@
 #include "core/Game.h"
 #include "core/ConsoleCommand.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/CoreIncludes.h"
 #include "core/GraphicsManager.h"
 #include "core/GUIManager.h"
@@ -49,4 +51,5 @@
         , inputState_(0)
     {
+        RegisterRootObject(GSMainMenu);
         inputState_ = InputManager::getInstance().createInputState("mainMenu");
         inputState_->setMouseMode(MouseMode::Nonexclusive);
@@ -64,5 +67,5 @@
             // Load sound
             this->ambient_ = new AmbientSound(0);
-            this->ambient_->setSource("ambient/mainmenu.wav");
+            this->ambient_->setSyncMode(0x0);
         }
     }
@@ -71,5 +74,5 @@
     {
         if (GameMode::playsSound())
-            delete this->ambient_;
+            this->ambient_->destroy();
 
         InputManager::getInstance().destroyState("mainMenu");
@@ -82,6 +85,8 @@
     {
         // show main menu
-        GUIManager::getInstance().showGUI("MainMenu");
+        GUIManager::getInstance().showGUI("MainMenu", true, GraphicsManager::getInstance().isFullScreen());
         GUIManager::getInstance().setCamera(this->camera_);
+        GUIManager::getInstance().setBackground("MainMenuBackground");
+//         GUIManager::getInstance().setBackground("");
         GraphicsManager::getInstance().setCamera(this->camera_);
 
@@ -92,11 +97,16 @@
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu), "startMainMenu"));
 
+        // create command to change sound path
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::setMainMenuSoundPath, this), "setMMSoundPath"));
+
         KeyBinderManager::getInstance().setToDefault();
         InputManager::getInstance().enterState("mainMenu");
 
+        this->setConfigValues();
+
         if (GameMode::playsSound())
         {
-            this->ambient_->setLoop(true);
-            this->ambient_->play();
+            this->ambient_->setLooping(true);
+            this->ambient_->play(); // works without source
         }
     }
@@ -112,4 +122,6 @@
 
         GUIManager::getInstance().setCamera(0);
+        GUIManager::getInstance().setBackground("");
+        GUIManager::hideGUI("MainMenu");
         GraphicsManager::getInstance().setCamera(0);
     }
@@ -117,4 +129,29 @@
     void GSMainMenu::update(const Clock& time)
     {
+    }
+
+    void GSMainMenu::setConfigValues()
+    {
+        SetConfigValue(soundPathMain_, "mainmenu.ogg")
+            .description("Contains the path to the main menu sound file.")
+            .callback(this, &GSMainMenu::reloadSound);
+    }
+
+    void GSMainMenu::reloadSound()
+    {
+        if (GameMode::playsSound())
+        {
+            this->ambient_->setAmbientSource(soundPathMain_);
+        }
+    }
+
+    const std::string& GSMainMenu::getMainMenuSoundPath()
+    {
+        return soundPathMain_;
+    }
+
+    void GSMainMenu::setMainMenuSoundPath(const std::string& path)
+    {
+        ModifyConfigValue(soundPathMain_, set, path);
     }
 
Index: code/trunk/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSMainMenu.h	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSMainMenu.h	(revision 6417)
@@ -34,8 +34,9 @@
 #include "util/OgreForwardRefs.h"
 #include "core/GameState.h"
+#include "core/OrxonoxClass.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport GSMainMenu : public GameState
+    class _OrxonoxExport GSMainMenu : public GameState, public OrxonoxClass
     {
     public:
@@ -46,4 +47,9 @@
         void deactivate();
         void update(const Clock& time);
+
+        void setConfigValues();
+        void reloadSound();
+        const std::string& getMainMenuSoundPath();
+        void setMainMenuSoundPath(const std::string& path);
 
         static void startStandalone();
@@ -61,4 +67,5 @@
         // ambient sound for the main menu
         AmbientSound*     ambient_;
+        std::string       soundPathMain_;
     };
 }
Index: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 6417)
@@ -30,4 +30,5 @@
 
 #include "util/Clock.h"
+#include "core/BaseObject.h"
 #include "core/ConsoleCommand.h"
 #include "core/Game.h"
@@ -45,5 +46,4 @@
     GSRoot::GSRoot(const GameStateInfo& info)
         : GameState(info)
-        , timeFactor_(1.0f)
         , bPaused_(false)
         , timeFactorPauseBackup_(1.0f)
@@ -55,10 +55,11 @@
         NetworkFunctionBase::destroyAllNetworkFunctions();
     }
-    
+
     void GSRoot::printObjects()
     {
         unsigned int nr=0;
-        for(ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it){
-            if( dynamic_cast<Synchronisable*>(*it) )
+        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
+        {
+            if (dynamic_cast<Synchronisable*>(*it))
                 COUT(0) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << std::endl;
             else
@@ -67,5 +68,4 @@
         }
         COUT(0) << "currently got " << nr << " objects" << std::endl;
-    
     }
 
@@ -73,5 +73,5 @@
     {
         // reset game speed to normal
-        this->timeFactor_ = 1.0f;
+        TimeFactorListener::setTimeFactor(1.0f);
 
         // time factor console command
@@ -91,5 +91,9 @@
     {
         for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
-            (it++)->tick(time);
+        {
+            Timer* object = *it;
+            ++it;
+            object->tick(time);
+        }
 
         /*** HACK *** HACK ***/
@@ -101,6 +105,11 @@
             leveldt = 0.0f;
         }
+        float realdt = leveldt * TimeFactorListener::getTimeFactor();
         for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; )
-            (it++)->tick(leveldt * this->timeFactor_);
+        {
+            Tickable* object = *it;
+            ++it;
+            object->tick(realdt);
+        }
         /*** HACK *** HACK ***/
     }
@@ -119,10 +128,5 @@
             if (!this->bPaused_)
             {
-                TimeFactorListener::timefactor_s = factor;
-
-                for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it)
-                    it->changedTimeFactor(factor, this->timeFactor_);
-
-                this->timeFactor_ = factor;
+                TimeFactorListener::setTimeFactor(factor);
             }
             else
@@ -137,5 +141,5 @@
             if (!this->bPaused_)
             {
-                this->timeFactorPauseBackup_ = this->timeFactor_;
+                this->timeFactorPauseBackup_ = TimeFactorListener::getTimeFactor();
                 this->setTimeFactor(0.0f);
                 this->bPaused_ = true;
@@ -148,3 +152,8 @@
         }
     }
+
+    float GSRoot::getTimeFactor()
+    {
+        return TimeFactorListener::getTimeFactor();
+    }
 }
Index: code/trunk/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 6105)
+++ code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 6417)
@@ -51,8 +51,7 @@
         void setTimeFactor(float factor);
         void pause();
-        float getTimeFactor() { return this->timeFactor_; }
+        float getTimeFactor();
 
     private:
-        float                 timeFactor_;              //!< A factor that sets the gamespeed. 1 is normal.
         bool                  bPaused_;
         float                 timeFactorPauseBackup_;
