Index: /trunk/src/defs/class_id.h
===================================================================
--- /trunk/src/defs/class_id.h	(revision 8716)
+++ /trunk/src/defs/class_id.h	(revision 8717)
@@ -146,4 +146,8 @@
   CL_MOVIE_LOADER               =    0x00000109,
 
+  CL_GAME_MENU                  =    0x00000110,
+  CL_GAME_MENU_DATA             =    0x00000111,
+
+
   CL_MULTIPLAYER_TEAM_DEATHMATCH=    0x00000121,
   CL_SINGLEPLAYER_SHOOTEMUP     =    0x00000122,
Index: /trunk/src/defs/error.h
===================================================================
--- /trunk/src/defs/error.h	(revision 8716)
+++ /trunk/src/defs/error.h	(revision 8717)
@@ -1,5 +1,5 @@
 
 
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
 
@@ -17,8 +17,8 @@
 
 
-/*! 
+/*!
  * @file error.h
   *  A compendium of Error codes used in the program
-*/ 
+*/
 
 
@@ -54,10 +54,12 @@
 */
 
-typedef struct 
+struct ErrorMessage
 {
+  ErrorMessage(int code = 0, char* message = NULL, char* location = NULL)
+    : code(code), message(message), location(location) {};
   int code;
   char* message;
   char* location;
-} ErrorMessage;
+};
 
 #endif /* _ERROR_H */
Index: /trunk/src/lib/data/data_tank.h
===================================================================
--- /trunk/src/lib/data/data_tank.h	(revision 8716)
+++ /trunk/src/lib/data/data_tank.h	(revision 8717)
@@ -23,9 +23,9 @@
 
     /** initializes the DataTank to be able to load the data */
-    virtual ErrorMessage init() {}
+    virtual ErrorMessage init() { return ErrorMessage(); }
     /** loads the data into the DataTank @param root is the xml root parameter for for loadParams() connection */
-    virtual ErrorMessage loadData(const TiXmlElement* root = NULL) {}
+    virtual ErrorMessage loadData(const TiXmlElement* root = NULL) { return ErrorMessage(); }
     /** unloads the data again from the DataTank */
-    virtual ErrorMessage unloadData() {}
+    virtual ErrorMessage unloadData() { return ErrorMessage(); }
 };
 
Index: /trunk/src/lib/event/event_handler.cc
===================================================================
--- /trunk/src/lib/event/event_handler.cc	(revision 8716)
+++ /trunk/src/lib/event/event_handler.cc	(revision 8717)
@@ -355,5 +355,5 @@
   else
   {
-    //SDL_WM_GrabInput(SDL_GRAB_ON);
+    SDL_WM_GrabInput(SDL_GRAB_ON);
     SDL_ShowCursor(SDL_DISABLE);
   }
Index: /trunk/src/lib/gui/gl/Makefile.am
===================================================================
--- /trunk/src/lib/gui/gl/Makefile.am	(revision 8716)
+++ /trunk/src/lib/gui/gl/Makefile.am	(revision 8717)
@@ -60,8 +60,3 @@
 		specials/glgui_notifier.h
 
-
-
-
-
 EXTRA_DIST =
-
Index: /trunk/src/lib/gui/gl/glgui_box.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_box.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_box.cc	(revision 8717)
@@ -125,5 +125,4 @@
       height += borderBottom(); /* *2 done further up */
 
-      printf("%f %f\n", width, height);
       this->setSize2D(width, height);
     }
@@ -145,5 +144,4 @@
       height += borderBottom(); /* *2 done further up */
 
-      printf("%f %f\n", width, height);
       this->setSize2D(width, height);
     }
Index: /trunk/src/lib/gui/gl/glgui_button.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_button.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_button.cc	(revision 8717)
@@ -51,4 +51,6 @@
   {
     this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
+
+    this->setSelectable(true);
     this->setFocusable(true);
     this->setClickable(true);
@@ -79,7 +81,7 @@
     emit(clicked());
   }
-  void GLGuiButton::releasing(const Vector2D& pos)
+  void GLGuiButton::releasing(const Vector2D& pos, bool focused)
   {
-    GLGuiWidget::releasing(pos);
+    GLGuiWidget::releasing(pos, focused);
     emit(released());
   }
@@ -96,4 +98,15 @@
 
 
+  bool GLGuiButton::processEvent(const Event& event)
+  {
+    if (event.type == SDLK_SPACE && !event.bPressed)
+    {
+      emit(released());
+      return true;
+    }
+    return false;
+  }
+
+
   /**
    * @brief draws the GLGuiButton
Index: /trunk/src/lib/gui/gl/glgui_button.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_button.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_button.h	(revision 8717)
@@ -40,7 +40,9 @@
 
       virtual void draw() const;
+      virtual bool processEvent(const Event& event);
 
       DeclareSignal0(clicked);
       DeclareSignal0(released);
+
 
     protected:
@@ -48,5 +50,5 @@
 
       virtual void clicking(const Vector2D& pos);
-      virtual void releasing(const Vector2D& pos);
+      virtual void releasing(const Vector2D& pos, bool focused);
       virtual void hiding();
       virtual void showing();
Index: /trunk/src/lib/gui/gl/glgui_checkbutton.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_checkbutton.cc	(revision 8717)
@@ -78,8 +78,9 @@
 
 
-  void GLGuiCheckButton::releasing(const Vector2D& pos)
+  void GLGuiCheckButton::releasing(const Vector2D& pos, bool focused)
   {
-    GLGuiButton::releasing(pos);
-    this->toggleActiveState();
+    GLGuiButton::releasing(pos, focused);
+    if (focused)
+      this->toggleActiveState();
   }
 
Index: /trunk/src/lib/gui/gl/glgui_checkbutton.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_checkbutton.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_checkbutton.h	(revision 8717)
@@ -38,5 +38,5 @@
   protected:
     virtual void resize();
-    virtual void releasing(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos, bool focused);
 
   private:
Index: /trunk/src/lib/gui/gl/glgui_handler.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_handler.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_handler.cc	(revision 8717)
@@ -25,4 +25,6 @@
 #include <cassert>
 
+#include "debug.h"
+
 #include <cassert>
 
@@ -99,4 +101,101 @@
   }
 
+  void GLGuiHandler::selectNext()
+  {
+    // retrieve Objects.
+    const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET);
+
+    if (objects)
+    {
+      std::list<BaseObject*>::const_iterator it ;
+      std::list<BaseObject*>::const_iterator currentIt = objects->end();
+
+      if (GLGuiWidget::selected() != NULL)
+      {
+        it = std::find(objects->begin(), objects->end(), GLGuiWidget::selected());
+        if (it != objects->end())
+        {
+          currentIt = it;
+          it++;
+        }
+      }
+      else
+      {
+        it = objects->begin();
+      }
+
+      bool cycledOnce = false;
+
+      for (; it != currentIt; ++it)
+      {
+        if (it == objects->end() && !cycledOnce)
+        {
+          it = objects->begin();
+          cycledOnce = true;
+        }
+
+        if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
+        {
+          dynamic_cast<GLGuiWidget*>(*it)->select();
+          return;
+        }
+      }
+
+    }
+    else
+    {
+      PRINTF(0)("NO GUI-ELEMENTS EXISTING\n");
+    }
+  }
+
+  void GLGuiHandler::selectPrevious()
+  {
+    // retrieve Objects.
+    const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET);
+
+    if (objects)
+    {
+      std::list<BaseObject*>::const_iterator it ;
+      std::list<BaseObject*>::const_iterator currentIt = objects->begin();
+
+      if (GLGuiWidget::selected() != NULL)
+      {
+        it = std::find(objects->begin(), objects->end(), GLGuiWidget::selected());
+        if (it != objects->end())
+        {
+          currentIt = it;
+          it--;
+        }
+      }
+      else
+      {
+        it = objects->end();
+      }
+
+      bool cycledOnce = false;
+
+      for (; it != currentIt; --it)
+      {
+        if (it == objects->end() && !cycledOnce)
+        {
+          --it ;
+          cycledOnce = true;
+        }
+
+        if (dynamic_cast<GLGuiWidget*>(*it)->selectable())
+        {
+          dynamic_cast<GLGuiWidget*>(*it)->select();
+          return;
+        }
+      }
+
+    }
+    else
+    {
+      PRINTF(0)("NO GUI-ELEMENTS EXISTING\n");
+    }
+  }
+
+
 
   void GLGuiHandler::process(const Event &event)
@@ -105,27 +204,30 @@
     {
       case  EV_MOUSE_BUTTON_LEFT:
-        if (GLGuiWidget::focused() != NULL)
-        {
-          if (event.bPressed)
+        if (GLGuiWidget::mouseFocused() != NULL && event.bPressed)
+        {
+          // if clickable select the Widget.
+          if (GLGuiWidget::mouseFocused()->clickable())
           {
-            if (GLGuiWidget::focused()->clickable())
-            {
-              Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
-              GLGuiWidget::focused()->click(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
-            }
+            Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
+            GLGuiWidget::mouseFocused()->select();
+            GLGuiWidget::mouseFocused()->click(cursorPos - GLGuiWidget::mouseFocused()->getAbsCoor2D());
           }
-          else
+        }
+        else if (GLGuiWidget::selected() != NULL && !event.bPressed)
+        {
+          if (GLGuiWidget::selected()->clickable())
           {
-            if (GLGuiWidget::focused()->clickable())
-            {
-              Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
-              GLGuiWidget::focused()->release(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
-            }
+            Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
+            GLGuiWidget::selected()->release(cursorPos - GLGuiWidget::selected()->getAbsCoor2D());
           }
         }
+
         break;
       case EV_LEAVE_STATE:
-        if (GLGuiWidget::focused() != NULL)
-          GLGuiWidget::focused()->breakFocus();
+        if (GLGuiWidget::selected() != NULL)
+          GLGuiWidget::selected()->unselect();
+
+        if (GLGuiWidget::mouseFocused() != NULL)
+          GLGuiWidget::mouseFocused()->breakMouseFocus();
         break;
 
@@ -134,11 +236,13 @@
           this->_cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));
         break;
-    }
-
-
-
-    if (GLGuiWidget::focused())
-    {
-      GLGuiWidget::focused()->processEvent(event);
+      case SDLK_TAB:
+        if (event.bPressed)
+          this->selectNext();
+        break;
+    }
+
+    if (GLGuiWidget::selected() != NULL)
+    {
+      GLGuiWidget::selected()->processEvent(event);
     }
 
@@ -160,4 +264,5 @@
       return Vector2D::nullVector();
   }
+
   Vector2D GLGuiHandler::cursorPositionRel(const GLGuiWidget* const widget) const
   {
@@ -170,14 +275,7 @@
 
 
-  void GLGuiHandler::draw()
-  {
-    //    GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
-  }
-
-
-  void GLGuiHandler::tick(float dt)
-  {
-
-    // CHECK THE COLLISIONS.
+  void GLGuiHandler::checkFocus()
+  {
+   // CHECK THE COLLISIONS.
     const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET);
 
@@ -193,14 +291,29 @@
         {
           // receiving Focus
-          if (GLGuiWidget::focused() != widget)
+          if (GLGuiWidget::mouseFocused() != widget)
           {
-            widget->giveFocus();
+            widget->giveMouseFocus();
           }
           return ;
         }
       }
-      if (GLGuiWidget::focused() != NULL)
-        GLGuiWidget::focused()->breakFocus();
-    }
+      if (GLGuiWidget::mouseFocused() != NULL)
+        GLGuiWidget::mouseFocused()->breakMouseFocus();
+    }
+  }
+
+  void GLGuiHandler::draw()
+  {
+    //    GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
+  }
+
+
+  void GLGuiHandler::tick(float dt)
+  {
+    // do not change if we already clicked into a Widget.
+    // if (GLGuiWidget::selected() != NULL && GLGuiWidget::selected()->pushed())
+    //      return ;
+
+    this->checkFocus();
   }
 }
Index: /trunk/src/lib/gui/gl/glgui_handler.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_handler.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_handler.h	(revision 8717)
@@ -34,7 +34,11 @@
     Vector2D cursorPositionRel(const GLGuiWidget* const widget) const;
 
+    void selectNext();
+    void selectPrevious();
+
     void activate();
     void deactivate();
 
+    void checkFocus();
 
     virtual void process(const Event &event);
Index: /trunk/src/lib/gui/gl/glgui_inputline.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_inputline.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_inputline.cc	(revision 8717)
@@ -47,4 +47,6 @@
 
     this->setFocusable(true);
+    this->setClickable(true);
+    this->setSelectable(true);
 
     this->_clearOnEnter = false;
Index: /trunk/src/lib/gui/gl/glgui_pushbutton.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_pushbutton.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_pushbutton.cc	(revision 8717)
@@ -63,5 +63,4 @@
   void GLGuiPushButton::receivedFocus()
   {
-    printf("%s received focus\n", this->label().c_str());
     GLGuiWidget::receivedFocus();
   }
@@ -69,5 +68,4 @@
   void GLGuiPushButton::removedFocus()
   {
-    printf("%s removed focus\n", this->label().c_str());
     GLGuiWidget::removedFocus();
 
@@ -76,13 +74,12 @@
   void GLGuiPushButton::clicking(const Vector2D& pos)
   {
-    printf("%s clicked\n", this->label().c_str());
     GLGuiButton::clicking(pos);
   }
 
 
-  void GLGuiPushButton::releasing(const Vector2D& pos)
+  void GLGuiPushButton::releasing(const Vector2D& pos, bool focused)
   {
-    printf("%s released\n", this->label().c_str());
-    GLGuiButton::releasing(pos);
+    if (focused)
+      GLGuiButton::releasing(pos, focused);
   }
 
Index: /trunk/src/lib/gui/gl/glgui_pushbutton.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_pushbutton.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_pushbutton.h	(revision 8717)
@@ -31,8 +31,9 @@
     virtual void draw() const;
     virtual void update();
+
   protected:
     virtual void resize();
     virtual void clicking(const Vector2D& pos);
-    virtual void releasing(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos, bool focused);
     virtual void receivedFocus();
     virtual void removedFocus();
Index: /trunk/src/lib/gui/gl/glgui_slider.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_slider.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_slider.cc	(revision 8717)
@@ -48,6 +48,7 @@
     this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider");
 
-    this->setClickable( );
-    this->setFocusable( );
+    this->setClickable(true);
+    this->setFocusable(true);
+    this->setSelectable(true);
 
     this->_value = 0.0;
@@ -193,7 +194,7 @@
   }
 
-  void GLGuiSlider::releasing(const Vector2D& pos)
-  {
-    GLGuiWidget::releasing(pos);
+  void GLGuiSlider::releasing(const Vector2D& pos, bool focused)
+  {
+    GLGuiWidget::releasing(pos, focused);
     this->grabbed = false;
   }
@@ -202,5 +203,4 @@
   {
     GLGuiWidget::removedFocus();
-    this->grabbed = false;
   }
 
Index: /trunk/src/lib/gui/gl/glgui_slider.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_slider.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_slider.h	(revision 8717)
@@ -59,5 +59,5 @@
 
     virtual void clicking(const Vector2D& pos);
-    virtual void releasing(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos, bool focused);
     virtual void removedFocus();
 
Index: /trunk/src/lib/gui/gl/glgui_table.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_table.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_table.cc	(revision 8717)
@@ -19,4 +19,6 @@
 #include "debug.h"
 
+#include "glgui_handler.h"
+
 namespace OrxGui
 {
@@ -25,6 +27,8 @@
    */
   GLGuiTable::GLGuiTable (unsigned int rows, unsigned int columns)
+  : _selected(-1, -1), _focused(-1, -1)
   {
     this->init();
+
     this->setRowCount(rows);
     this->setColumnCount(columns);
@@ -45,8 +49,9 @@
     this->setClassID(CL_GLGUI_TABLE, "GLGuiTable");
 
+    this->setBorderTop(10);
+
     this->setFocusable(true);
     this->setClickable(true);
 
-    this->resize();
   }
 
@@ -56,4 +61,7 @@
 
     unsigned int currentRowCount = this->rowCount();
+
+    this->_rowHeights.resize(rowCount, 20);
+
     this->_entries.resize(rowCount);
     for (unsigned int i = currentRowCount; i < this->rowCount(); ++i)
@@ -65,5 +73,8 @@
 
     assert(this->checkIntegrity());
-    this->debug();
+    this->repositionText(currentRowCount, 0);
+
+
+    this->resize();
 
     if (!this->isVisible())
@@ -75,4 +86,6 @@
     unsigned int i;
     unsigned int currentColumnCount = this->columnCount();
+
+    this->_columnWidths.resize(columnCount, 100);
 
     // setup Headers.
@@ -89,6 +102,8 @@
     }
     assert(this->checkIntegrity());
-    this->debug();
-
+
+    this->repositionText(0, currentColumnCount);
+
+    this->resize();
     if (!this->isVisible())
       this->hiding();
@@ -111,5 +126,5 @@
   }
 
-  void GLGuiTable::setEntry(unsigned int column, unsigned int row, const std::string& name)
+  void GLGuiTable::setEntry(unsigned int row, unsigned int column, const std::string& name)
   {
     if (column >= this->columnCount() )
@@ -125,6 +140,7 @@
     for (unsigned int i = 0; i < this->rowCount(); ++i)
       this->_entries[i][column].setLineWidth(size);
-
-  }
+  }
+
+
 
   /// TODO.
@@ -144,5 +160,4 @@
 
 
-
   /**
    * @brief Processes an Event.
@@ -152,4 +167,10 @@
   bool GLGuiTable::processEvent(const Event& event)
   {
+    if (event.type == EV_MOUSE_MOTION)
+    {
+      this->pixelPositionToElement((OrxGui::GLGuiHandler::getInstance()->cursorPositionRel(this)), &this->_focused.row, &this->_focused.column);
+      return true;
+    }
+
     return false;
   }
@@ -161,4 +182,15 @@
   void GLGuiTable::resize()
   {
+    Vector2D size;
+    unsigned int i;
+    for(i = 0; i < this->columnCount(); ++i)
+      size.x += this->_columnWidths[i];
+
+    for(i = 0; i < this->rowCount(); ++i)
+      size.y += this->_rowHeights[i];
+
+    this->setSize2D(size);
+    this->setSize2D( size + Vector2D(borderLeft() + borderRight(), borderTop() + borderBottom()));
+
     GLGuiWidget::resize();
   }
@@ -172,4 +204,5 @@
         this->_entries[j][i].setColor(this->foregroundColor());
     }
+
   }
 
@@ -196,11 +229,4 @@
 
   /**
-   * @brief ticks the Table
-   * @param dt the time passed.
-   */
-  void GLGuiTable::tick(float dt)
-{}
-
-  /**
    * @brief draws the GLGuiTable
    */
@@ -210,10 +236,88 @@
     GLGuiWidget::draw();
 
-    //     this->frontMaterial().select();
-    //     GLGuiWidget::drawRect(this->frontRect());
+    float columnPos = this->borderLeft();
+    float rowPos = this->borderTop();
+
+    unsigned int i;
+    glColor4fv(&this->foregroundColor()[0]);
+    glLineWidth(1.5);
+    glBegin(GL_LINES);
+
+    glVertex2f(columnPos, this->borderTop());
+    glVertex2f(columnPos, this->getSizeY2D());
+    for (i = 0; i < this->columnCount(); ++i)
+    {
+      columnPos +=this->_columnWidths[i];
+      glVertex2f(columnPos, this->borderTop());
+      glVertex2f(columnPos, this->getSizeY2D());
+    }
+
+    glVertex2f(this->borderLeft(), rowPos);
+    glVertex2f(this->getSizeX2D(), rowPos);
+    for (i = 0; i < this->rowCount(); ++i)
+    {
+      rowPos +=this->_rowHeights[i];
+      glVertex2f(this->borderLeft(), rowPos);
+      glVertex2f(this->getSizeX2D(), rowPos);
+    }
+
+
+    glEnd();
+
+
 
     this->endDraw();
   }
 
+
+  void GLGuiTable::pixelPositionToElement(const Vector2D& pixelPosition, int* row, int* column)
+  {
+    *row = 0;
+    *column = 0;
+    float columnPos = this->borderLeft();
+    float rowPos = this->borderTop();
+
+    for (*row = 0; *row < (int)this->rowCount(); (*row)++)
+    {
+      if (pixelPosition.y > rowPos  && pixelPosition.y  < (rowPos += _rowHeights[*row]))
+        break;
+    }
+    for (*column = 0; *column < (int)this->columnCount(); (*column)++)
+    {
+      if (pixelPosition.x > columnPos && pixelPosition.x  < (columnPos += _columnWidths[*column]))
+        break;
+    }
+
+    PRINTF(3)("Mouse Over row:%d Column:%d\n", *row, *column);
+  }
+
+
+  void GLGuiTable::repositionText(unsigned int fromLeft, unsigned int fromTop)
+  {
+    float columnPos = this->borderLeft();
+    float rowPos = this->borderTop();
+    unsigned int i, j;
+    for (i = 0; i< fromLeft; ++i)
+      columnPos+=this->_columnWidths[i];
+    for (i = 0; i < fromTop; ++i)
+      rowPos += this->_rowHeights[i];
+
+    for (i = fromLeft; i < this->columnCount(); ++i)
+    {
+      this->_headers[i].setRelCoor2D(columnPos, rowPos);
+
+      // not required, but a good idea :)
+      this->_headers[i].setLineWidth(_columnWidths[i]);
+
+      float rowPosI = rowPos;
+      for (j = fromTop; j < this->rowCount(); ++j)
+      {
+        this->_entries[j][i].setRelCoor2D(columnPos, rowPosI);
+        this->_entries[j][i].setLineWidth(_columnWidths[i]);
+        rowPosI += _rowHeights[j];
+      }
+      columnPos+=this->_columnWidths[i];
+    }
+  }
 
   /**
@@ -224,6 +328,7 @@
   {
     text->setSize(this->textSize());
-    //text->setLineWidth(  );
+    text->setLineWidth( this->_columnWidths[column] );
     text->setFont("fonts/final_frontier.ttf", (int)this->textSize());
+    text->setColor(this->foregroundColor());
 
     text->setColor(this->foregroundColor());
@@ -257,8 +362,8 @@
     for (unsigned int i = 0; i < this->rowCount(); ++i)
       if (this->_entries[i].size() != this->columnCount())
-    {
-      PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount());
-      retVal = false;
-    }
+      {
+        PRINTF(1)("COLUMN-COUNT OF ROW %d WRONG (is %d should be %d)\n", i, this->_entries[i].size(), this->columnCount());
+        retVal = false;
+      }
     return retVal;
   }
Index: /trunk/src/lib/gui/gl/glgui_table.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_table.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_table.h	(revision 8717)
@@ -39,10 +39,9 @@
     void setHeader(const std::vector<std::string>& headerNames);
 
-    void setEntry(unsigned int column, unsigned int row, const std::string& name);
+    void setEntry(unsigned int row, unsigned int column, const std::string& name);
 
     void setColumnWidth(unsigned int column, float size);
     void setRowHeight(unsigned int row, unsigned int size);
 
-    virtual void tick(float dt);
     virtual void draw() const;
 
@@ -60,15 +59,28 @@
     virtual bool processEvent(const Event& event);
 
-
   private:
     void init();
 
+    void pixelPositionToElement(const Vector2D& pixelPosition, int* row, int* column);
+    void repositionText(unsigned int fromLeft, unsigned int fromTop);
     void applyTextSettings(unsigned int row, unsigned int column, LimitedWidthText* text);
     bool checkIntegrity() const;
 
   private:
+    typedef struct Entry {
+      Entry(int row, int column) :row(row), column(column) {};
+      int  row;
+      int  column;
+    };
+
     typedef std::vector<LimitedWidthText> TableTextList;
     TableTextList                _headers;
+    std::vector<float>           _columnWidths;
+    std::vector<float>           _rowHeights;
+
     std::vector<TableTextList>   _entries;     //!< inner is by column, outer is by row.
+
+    Entry                        _selected;
+    Entry                        _focused;
 
 
Index: /trunk/src/lib/gui/gl/glgui_widget.cc
===================================================================
--- /trunk/src/lib/gui/gl/glgui_widget.cc	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_widget.cc	(revision 8717)
@@ -72,10 +72,12 @@
   GLGuiWidget::~GLGuiWidget()
   {
-    if (this == GLGuiWidget::_focused)
-      GLGuiWidget::_focused = NULL;
+    if (this == GLGuiWidget::_mouseFocused)
+      GLGuiWidget::_mouseFocused = NULL;
+    if (this == GLGuiWidget::selected())
+      this->unselect();
   }
 
   GLGuiWidget* GLGuiWidget::_selected = NULL;
-  GLGuiWidget* GLGuiWidget::_focused = NULL;
+  GLGuiWidget* GLGuiWidget::_mouseFocused = NULL;
   GLGuiWidget* GLGuiWidget::_inputGrabber = NULL;
 
@@ -91,4 +93,5 @@
     this->_focusable = false;
     this->_clickable = false;
+    this->_selectable = false;
     this->_pushed = false;
     this->_state = OrxGui::Normal;
@@ -133,42 +136,84 @@
   }
 
+
+  void GLGuiWidget::setFrontColor(const Color& frontColor, bool instantaniously)
+  {
+    this->_currentStyle._foreground.setDiffuseColor(frontColor);
+    this->animateBack();
+  };
+
+
+  bool GLGuiWidget::focusOverWidget(const Vector2D& position) const
+  {
+    return (this->getAbsCoor2D().x < position.x && this->getAbsCoor2D().x + this->getSizeX2D() > position.x &&
+        this->getAbsCoor2D().y < position.y && this->getAbsCoor2D().y + this->getSizeY2D() > position.y);
+  }
+
+  bool GLGuiWidget::focusOverWidget(const GLGuiCursor* const cursor) const
+  {
+    return this->focusOverWidget(cursor->getAbsCoor2D());
+  }
+
+
+
   /** @brief gives focus to this widget */
-  void GLGuiWidget::giveFocus()
-  {
-    if (GLGuiWidget::focused() != NULL)
-      GLGuiWidget::focused()->breakFocus();
-    GLGuiWidget::_focused = this;
+  void GLGuiWidget::giveMouseFocus()
+  {
+    if (this->_state == OrxGui::Insensitive)
+      return ;
+
+    if (GLGuiWidget::mouseFocused() != NULL)
+      GLGuiWidget::mouseFocused()->breakMouseFocus();
+    GLGuiWidget::_mouseFocused = this;
+
+    this->switchState(OrxGui::Focused);
+
     this->receivedFocus();
   };
 
-  void GLGuiWidget::breakFocus()
-  {
-    if (GLGuiWidget::_focused == this)
+  void GLGuiWidget::breakMouseFocus()
+  {
+    if (GLGuiWidget::_mouseFocused == this)
     {
-      GLGuiWidget::_focused = NULL;
-      this->_pushed = false;
+      GLGuiWidget::_mouseFocused = NULL;
+
+      if (GLGuiWidget::_selected != this)
+        this->switchState(OrxGui::Normal);
+      else
+        this->switchState(OrxGui::Selected);
+
       this->removedFocus();
     }
   };
 
-
-  bool GLGuiWidget::focusOverWidget(const Vector2D& position) const
-  {
-    return (this->getAbsCoor2D().x < position.x && this->getAbsCoor2D().x + this->getSizeX2D() > position.x &&
-            this->getAbsCoor2D().y < position.y && this->getAbsCoor2D().y + this->getSizeY2D() > position.y);
-  }
-
-  bool GLGuiWidget::focusOverWidget(const GLGuiCursor* const cursor) const
-  {
-    return this->focusOverWidget(cursor->getAbsCoor2D());
-  }
-
-
-
-  void GLGuiWidget::setFrontColor(const Color& frontColor, bool instantaniously)
-  {
-    this->_currentStyle._foreground.setDiffuseColor(frontColor);
-    this->animateBack();
-  };
+  /**
+   * @brief selects the Widget, unselecting the old one (if existing)
+   */
+  void GLGuiWidget::select()
+  {
+    if (GLGuiWidget::_selected != NULL)
+      GLGuiWidget::selected()->unselect();
+    GLGuiWidget::_selected = this;
+
+    this->switchState(OrxGui::Selected);
+  }
+
+  /**
+   * @brief unselects the current Widget.
+   *
+   * if the current Widget is not selected, nothing is done here.
+   */
+  void GLGuiWidget::unselect()
+  {
+    if (GLGuiWidget::_selected != this)
+      return;
+
+    if (GLGuiWidget::_mouseFocused == this)
+      this->switchState(OrxGui::Focused);
+    else
+      this->switchState(OrxGui::Normal);
+
+    GLGuiWidget::_selected = NULL;
+  }
 
 
@@ -193,5 +238,5 @@
     if (this->_pushed)
     {
-      this->releasing(pos);
+      this->releasing(pos, GLGuiWidget::_mouseFocused == this);
       this->_pushed = false;
     }
@@ -200,27 +245,30 @@
 
   void GLGuiWidget::clicking(const Vector2D& pos)
-  {
-    this->switchState(OrxGui::Selected);
-  }
-
-  void GLGuiWidget::releasing(const Vector2D& pos)
-  {
-    this->switchState(OrxGui::Normal);
-  }
+  {}
+
+  void GLGuiWidget::releasing(const Vector2D& pos, bool focused)
+  {}
 
   void GLGuiWidget::receivedFocus()
   {
-    this->switchState(OrxGui::Focused);
   }
 
   void GLGuiWidget::removedFocus()
   {
-    this->switchState(OrxGui::Normal);
-
-  }
-
-  void GLGuiWidget::destroyed()
-  {}
-  ;
+
+  }
+
+  void GLGuiWidget::selecting()
+  {
+  }
+
+  void GLGuiWidget::unselecting()
+  {
+  }
+
+
+  void GLGuiWidget::destroying()
+  {
+  }
 
 
@@ -706,5 +754,5 @@
     //this->_currentStyle = this->_style[state];
     this->_state = state;
-    PRINTF(3)("Switching to state %s\n", OrxGui::StateString[state].c_str());
+    PRINTF(3)("%s::%s Switches to state %s\n", this->getClassName(), this->getName(), OrxGui::StateString[state].c_str());
 
     this->animateBack();
@@ -762,8 +810,8 @@
     for (unsigned int i = 0; i < GLGUI_STATE_COUNT; ++i)
       if (stateName == OrxGui::StateString[i])
-    {
-      *state = (OrxGui::State)i;
-      return true;
-    }
+      {
+        *state = (OrxGui::State)i;
+        return true;
+      }
     return false;
   }
@@ -772,5 +820,5 @@
    * @brief print out some nice debug output about the Widget.
    */
-  void GLGuiWidget::debug() const
+  void GLGuiWidget::debug(unsigned int level) const
   {
     PRINT(0)("Debug of %s::%s - WidgetPart ", this->getClassName(), this->getName());
Index: /trunk/src/lib/gui/gl/glgui_widget.h
===================================================================
--- /trunk/src/lib/gui/gl/glgui_widget.h	(revision 8716)
+++ /trunk/src/lib/gui/gl/glgui_widget.h	(revision 8717)
@@ -42,11 +42,10 @@
 
     /// FOCUS
-    /** @brief gives focus to this widget */
-    void giveFocus();
-    void breakFocus();
+    /** @brief gives mouse - focus to this widget */
+    void giveMouseFocus();
+    void breakMouseFocus();
+
     /** @returns true if the widget is focusable */
     bool focusable() const { return this->_focusable; };
-    /** @param focusable sets if the Widget should be focusable */
-    void setFocusable(bool focusable = true) { this->_focusable = focusable; };
     /** @returns true if the position is inside of the Widget. @param position the position to check */
     bool focusOverWidget(const Vector2D& position) const;
@@ -54,13 +53,21 @@
     bool focusOverWidget(const OrxGui::GLGuiCursor* const cursor) const;
 
-    /** @returns the currently focused Widget (NULL if none is selected) */
-    static GLGuiWidget* focused() { return GLGuiWidget::_focused; };
-
+    /** @returns the currently mouse - focused Widget (NULL if none is focused). */
+    static GLGuiWidget* mouseFocused() { return GLGuiWidget::_mouseFocused; };
+
+    /// SELECT
+    void select();
+    void unselect();
+    /** @returns true if the Widget is selectable */
+    bool selectable() const { return this->_selectable; }
+
+    /** @returns the currently Selected Widget (NULL if none is selected). */
+    static GLGuiWidget* selected() { return GLGuiWidget::_selected; };
 
     /// CLICK
+    bool pushed() { return _pushed; };
     void click(const Vector2D& pos);
     void release(const Vector2D& pos);
     bool clickable() const { return this->_clickable; };
-    void setClickable(bool clickable = true) { this->_clickable = clickable; };
 
     static void connect(GLGuiWidget* sender, Signal& signal, BaseObject* receiver, Slot executor);
@@ -81,5 +88,6 @@
     void animateBack();
 
-    /// STYLE
+    ///////////////////////////////////////////////////////////////////////////////////
+    /// STYLE /////////////////////////////////////////////////////////////////////////
     ////////////////////////////////
     /// Retrieve Current Values. ///
@@ -201,5 +209,5 @@
     void setAnimatedStateChanges(bool animated);
     void switchState(OrxGui::State state);
-
+    ///////////////////////////////////////////////////////////////////////////////////
 
 
@@ -225,4 +233,17 @@
 
   protected:
+    /** @param focusable sets if the Widget should be focusable */
+    void setFocusable(bool focusable = true) { this->_focusable = focusable; };
+    /** @param selectable true if the widget should be selectable */
+    void setSelectable(bool selectable) { this->_selectable = selectable; }
+    /** @param focusable true if the widget should be focusable */
+    void setClickable(bool clickable = true) { this->_clickable = clickable; };
+
+
+    /// RENDERING
+    inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
+    inline void endDraw() const { glPopMatrix(); };
+
+
     /// LOOKS
     virtual void resize();
@@ -230,19 +251,23 @@
     virtual void hiding() {};
     virtual void showing() {};
+
     virtual void updateFrontColor() {};
 
-    inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
-    inline void endDraw() const { glPopMatrix(); };
 
     /// EVENTS
-    // if something was clickt on the GUI-widget.
+    // mouse clicking
     virtual void clicking(const Vector2D& pos);
-    virtual void releasing(const Vector2D& pos);
+    virtual void releasing(const Vector2D& pos, bool focused);
+    // mouse focusing
     virtual void receivedFocus();
     virtual void removedFocus();
-
-    virtual void destroyed();
-
-    virtual void debug() const;
+    // selecting either with the mouse by clicking, or by the keybord traversing to it.
+    virtual void selecting();
+    virtual void unselecting();
+    // destroying the Widget.
+    virtual void destroying();
+
+
+    virtual void debug(unsigned int level) const;
 
   private:
@@ -251,6 +276,6 @@
   private:
     static GLGuiWidget*            _selected;         //!< The currently selected Widget.
-    static GLGuiWidget*            _focused;          //!< The currently Focused Widget.
-    static GLGuiWidget*            _inputGrabber;     //!< The Widget that grabs input.
+    static GLGuiWidget*            _mouseFocused;     //!< The currently Focused Widget (mouse-focus).
+    static GLGuiWidget*            _inputGrabber;     //!< The Widget that grabs input (keyboard-focus).
 
 
@@ -265,9 +290,10 @@
     /// EVENTS
     OrxGui::State                  _state;
+    bool                           _pushed;
 
     bool                           _focusable;        //!< If this widget can receive focus.
     bool                           _clickable;        //!< if this widget can be clicked upon.
-
-    bool                           _pushed;
+    bool                           _selectable;       //!< If this widget can be selected.
+
 
 
@@ -276,31 +302,31 @@
     typedef struct
     {
-      float             _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
-      float             _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
-      float             _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
-      float             _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
-
-      float             _textSize;             //!< The TextSize of the Widget.
-
-      Material          _background;           //!< The Background Material of the Widget.
-
-      Material          _foreground;           //!< The foreground Material of the Widget.
+      float                        _borderLeft;           //!< The Distance to the left Border of the widget, before any internal Element starts.
+      float                        _borderRight;          //!< The Distance to the right Border of the widget, before any internal Element starts.
+      float                        _borderTop;            //!< The Distance to the top Border of the widget, before any internal Element starts
+      float                        _borderBottom;         //!< The Distance to the bottom Border of the widget, before any internal Element starts
+
+      float                        _textSize;             //!< The TextSize of the Widget.
+
+      Material                     _background;           //!< The Background Material of the Widget.
+
+      Material                     _foreground;           //!< The foreground Material of the Widget.
     }
     StatedStyle;
 
 
-    StatedStyle         _style[GLGUI_STATE_COUNT]; //!< Styles configured for different States
-
-    FeaturePosition     _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
-    Font*               _font;                 //!< The Font used in the current Widget.
+    StatedStyle                    _style[GLGUI_STATE_COUNT]; //!< Styles configured for different States
+
+    FeaturePosition                _featurePosition;      //!< The Position a Feature will be layed at (checkbox(box), slider(text),...)
+    Font*                          _font;                 //!< The Font used in the current Widget.
 
 
     /// ANIMATION STUFF:
-    bool                _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
-
-    bool                _animating;            //!< If the Widget is animated at the moment (Texture might be an AnimatedTexture.)
-    float               _animationCycle;
-    float               _animationDuration;
-    StatedStyle         _currentStyle;
+    bool                           _animatedStateChanges; //!< If the Transitions between States are Animated automatically.
+
+    bool                           _animating;            //!< If the Widget is animated at the moment (Texture might be an AnimatedTexture.)
+    float                          _animationCycle;
+    float                          _animationDuration;
+    StatedStyle                    _currentStyle;
 
   };
Index: /trunk/src/lib/util/loading/game_loader.cc
===================================================================
--- /trunk/src/lib/util/loading/game_loader.cc	(revision 8716)
+++ /trunk/src/lib/util/loading/game_loader.cc	(revision 8717)
@@ -73,4 +73,6 @@
   this->subscribeEvent(ES_GAME, KeyMapper::PEV_NEXT_WORLD);
   this->subscribeEvent(ES_GAME, KeyMapper::PEV_PREVIOUS_WORLD);
+
+  return ErrorMessage();
 }
 
@@ -91,4 +93,6 @@
     this->currentCampaign = this->fileToCampaign(campaignName);
   }
+
+  return ErrorMessage();
 }
 
@@ -109,4 +113,6 @@
     this->currentCampaign = this->fileToCampaign(campaignName);
   }
+
+  return ErrorMessage();
 }
 
@@ -147,4 +153,6 @@
       }
   }
+
+  return ErrorMessage();
 }
 
@@ -160,4 +168,6 @@
     this->currentCampaign->start();
   }
+
+  return ErrorMessage();
 }
 
@@ -191,4 +201,6 @@
   if(this->currentCampaign != NULL)
     this->currentCampaign->pause();
+
+  return ErrorMessage();
 }
 
@@ -205,4 +217,6 @@
   if(this->currentCampaign != NULL)
     this->currentCampaign->resume();
+
+  return ErrorMessage();
 }
 
Index: /trunk/src/story_entities/Makefile.am
===================================================================
--- /trunk/src/story_entities/Makefile.am	(revision 8716)
+++ /trunk/src/story_entities/Makefile.am	(revision 8717)
@@ -13,5 +13,8 @@
 		story_entities/multi_player_world_data.cc \
 		story_entities/movie_loader.cc \
-		story_entities/simple_game_menu.cc
+		story_entities/simple_game_menu.cc \
+		\
+		story_entities/menu/game_menu.cc \
+		story_entities/menu/glgui_imagebutton.cc
 
 StoryEntities_HEADERS_ = \
@@ -27,3 +30,7 @@
 		story_entities/multi_player_world_data.h \
 		story_entities/movie_loader.h \
-		story_entities/simple_game_menu.h
+		story_entities/simple_game_menu.h \
+		\
+		story_entities/menu/game_menu.h \
+		story_entities/menu/glgui_imagebutton.h
+
Index: /trunk/src/story_entities/campaign.cc
===================================================================
--- /trunk/src/story_entities/campaign.cc	(revision 8716)
+++ /trunk/src/story_entities/campaign.cc	(revision 8717)
@@ -82,4 +82,6 @@
   this->bReturnToMenu = false;
   this->run();
+
+  return true;
 }
 
@@ -90,5 +92,5 @@
 bool Campaign::pause()
 {
-  this->bPaused = true;
+  return (this->bPaused = true);
 }
 
@@ -100,5 +102,5 @@
 {
   PRINTF(4)("Resuming the current Campaign\n");
-  this->bPaused = false;
+  return (this->bPaused = false);
 }
 
@@ -118,4 +120,6 @@
     this->currentEntity->stop();
   }
+
+  return true;
 }
 
@@ -127,5 +131,5 @@
 {
   ErrorMessage       errorCode;
-  int                storyID = WORLD_ID_0;
+//  int                storyID = WORLD_ID_0;
 
   for( this->currentEntity = this->campaignData->getFirstLevel(), this->bRunning = true;
Index: /trunk/src/story_entities/game_world.cc
===================================================================
--- /trunk/src/story_entities/game_world.cc	(revision 8716)
+++ /trunk/src/story_entities/game_world.cc	(revision 8717)
@@ -140,4 +140,5 @@
   State::setScriptManager(&this->scriptManager);
 
+  return ErrorMessage();
 }
 
@@ -153,11 +154,11 @@
 
   PRINTF(3)("> Loading world: '%s'\n", getLoadFile().c_str());
-  TiXmlElement* element;
-  GameLoader* loader = GameLoader::getInstance();
+//  TiXmlElement* element;
+//  GameLoader* loader = GameLoader::getInstance();
 
   if( getLoadFile().empty())
   {
     PRINTF(1)("GameWorld has no path specified for loading\n");
-    return (ErrorMessage){213,"Path not specified","GameWorld::load()"};
+    return (ErrorMessage(213,"Path not specified","GameWorld::load()"));
   }
 
@@ -168,5 +169,5 @@
     PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getLoadFile().c_str(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     delete XMLDoc;
-    return (ErrorMessage){213,"XML File parsing error","GameWorld::load()"};
+    return ErrorMessage(213,"XML File parsing error","GameWorld::load()");
   }
   // check basic validity
@@ -178,5 +179,5 @@
     PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
     delete XMLDoc;
-    return (ErrorMessage){213,"Path not a WorldDataFile","GameWorld::load()"};
+    return ErrorMessage(213,"Path not a WorldDataFile","GameWorld::load()");
   }
   /* the whole loading process for the GameWorld */
@@ -191,4 +192,5 @@
   //Account *b = new Account(30);
   //b->setName("b");
+
   
   LoadParamXML(root, "ScriptManager", &this->scriptManager, ScriptManager, loadParams);
@@ -196,4 +198,6 @@
   delete XMLDoc;
   this->releaseLoadScreen();
+
+  return ErrorMessage();
 }
 
@@ -220,4 +224,6 @@
   if (this->dataXML)
     delete this->dataXML;
+
+  return ErrorMessage();
 }
 
@@ -232,4 +238,6 @@
   State::setScriptManager(&this->scriptManager); //make sure we have the right script manager
   this->run();
+
+  return true;
 }
 
@@ -242,5 +250,5 @@
   PRINTF(3)("GameWorld::stop() - got stop signal\n");
   State::setScriptManager(NULL);
-  this->bRunning = false;
+  return (this->bRunning = false);
 }
 
@@ -251,5 +259,5 @@
 bool GameWorld::pause()
 {
-  this->bPaused = true;
+  return (this->bPaused = true);
 }
 
@@ -260,5 +268,5 @@
 bool GameWorld::resume()
 {
-  this->bPaused = false;
+  return(this->bPaused = false);
 }
 
@@ -410,5 +418,5 @@
     if( likely(this->dataTank->gameRule != NULL))
       this->dataTank->gameRule->tick(this->dtS);
-      
+
   }
 }
Index: /trunk/src/story_entities/game_world_data.cc
===================================================================
--- /trunk/src/story_entities/game_world_data.cc	(revision 8716)
+++ /trunk/src/story_entities/game_world_data.cc	(revision 8717)
@@ -108,4 +108,6 @@
 
   GraphicsEngine::getInstance()->displayFPS(true);
+
+  return ErrorMessage();
 }
 
@@ -131,4 +133,6 @@
   this->loadWorldEntities(root);
   this->loadScene(root);
+
+  return ErrorMessage();
 }
 
@@ -142,4 +146,6 @@
   this->unloadWorldEntities();
   this->unloadScene();
+
+  return ErrorMessage();
 }
 
@@ -166,4 +172,6 @@
   }
   this->glmis->draw();
+
+  return ErrorMessage();
 }
 
@@ -175,4 +183,6 @@
 {
   delete this->glmis;
+
+  return ErrorMessage();
 }
 
@@ -250,4 +260,6 @@
   /* init the pnode tree */
   PNode::getNullParent()->init();
+
+  return ErrorMessage();
 }
 
@@ -312,4 +324,6 @@
 
   this->glmis = NULL;
+
+  return ErrorMessage();
 }
 
@@ -337,4 +351,6 @@
     this->localCamera->addChild(this->sky);
   OrxSound::SoundEngine::getInstance()->setListener(this->localCamera);
+
+  return ErrorMessage();
 }
 
@@ -357,4 +373,6 @@
 
   State::setGameRules(NULL);
+
+  return ErrorMessage();
 }
 
Index: /trunk/src/story_entities/menu/game_menu.cc
===================================================================
--- /trunk/src/story_entities/menu/game_menu.cc	(revision 8717)
+++ /trunk/src/story_entities/menu/game_menu.cc	(revision 8717)
@@ -0,0 +1,467 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Patrick Boenzli
+
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
+
+
+#include "game_menu.h"
+
+#include "event_handler.h"
+
+#include "state.h"
+#include "class_list.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/resource_manager.h"
+
+#include "graphics_engine.h"
+#include "camera.h"
+#include "sound_engine.h"
+
+#include "sound_source.h"
+
+#include "glgui.h"
+#include "menu/glgui_imagebutton.h"
+
+//! This creates a Factory to fabricate a GameMenu
+CREATE_FACTORY(GameMenu, CL_GAME_MENU);
+
+
+
+GameMenu::GameMenu(const TiXmlElement* root)
+    : GameWorld()
+{
+  this->setClassID(CL_GAME_MENU, "GameMenu");
+  this->setName("GameMenu uninitialized");
+
+  this->dataTank = new GameMenuData();
+
+  this->cameraVector = Vector(50.0, 0.0, 0.0);
+
+  if (root != NULL)
+    this->loadParams(root);
+
+  State::setMenuID(this->getNextStoryID());
+}
+
+/**
+*  @brief remove the GameMenu from memory
+*
+*  delete everything explicitly, that isn't contained in the parenting tree!
+*  things contained in the tree are deleted automaticaly
+*/
+GameMenu::~GameMenu ()
+{
+  PRINTF(3)("GameMenu::~GameMenu() - deleting current world\n");
+
+  if( this->dataTank)
+    delete this->dataTank;
+  delete OrxGui::GLGuiHandler::getInstance( );
+}
+
+
+/**
+* @brief loads the parameters of a GameMenu from an XML-element
+* @param root the XML-element to load from
+*/
+void GameMenu::loadParams(const TiXmlElement* root)
+{
+  /* skip the GameWorld, since it does not define any useful loadParams for this class */
+  //static_cast<GameWorld*>(this)->loadParams(root);
+  GameWorld::loadParams(root);
+
+  PRINTF(4)("Loaded GameMenu specific stuff\n");
+}
+
+
+/**
+* @brief this is executed just before load
+*
+* since the load function sometimes needs data, that has been initialized
+* before the load and after the proceeding storyentity has finished
+*/
+ErrorMessage GameMenu::init()
+{
+  /* call underlying init funciton */
+  GameWorld::init();
+
+  this->subscribeEvent(ES_MENU, SDLK_UP);
+  this->subscribeEvent(ES_MENU, SDLK_DOWN);
+  this->subscribeEvent(ES_MENU, SDLK_RETURN);
+  this->subscribeEvent(ES_MENU, SDLK_SPACE);
+  this->subscribeEvent(ES_MENU, SDLK_ESCAPE);
+
+  this->dataTank->localCamera->setRelCoor(this->cameraVector);
+
+  GraphicsEngine::getInstance()->displayFPS(false);
+
+  return ErrorMessage();
+}
+
+
+/**
+* @brief load the data
+*/
+ErrorMessage GameMenu::loadData()
+{
+  this->mainMenuBox = NULL;
+
+  this->levelsBox = NULL;
+  this->networkBox = NULL;
+
+  this->optionsBox = NULL;
+  this->generalBox = NULL;
+  this->audioBox = NULL;
+  this->videoBox = NULL;
+  this->controlBox = NULL;
+  this->levelsBox = NULL;
+
+  this->currentlyOpened = NULL;
+
+  return GameWorld::loadData();
+}
+
+
+void GameMenu::showMainMenu()
+{
+  if (mainMenuBox == NULL)
+  {
+    this->mainMenuBox = new OrxGui::GLGuiBox();
+    {
+      OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play");
+      startButton->connect(SIGNAL(startButton, released), this, SLOT(GameMenu, showCampaigns));
+      this->mainMenuBox->pack(startButton);
+
+      OrxGui::GLGuiButton* networkButton = new OrxGui::GLGuiPushButton("MultiPlayer");
+      networkButton->connect(SIGNAL(networkButton, released), this, SLOT(GameMenu, showMultiPlayer));
+      this->mainMenuBox->pack(networkButton);
+
+      OrxGui::GLGuiButton* optionsButton = new OrxGui::GLGuiPushButton("Options");
+      optionsButton->connect(SIGNAL(optionsButton, released), this, SLOT(GameMenu, showOptionsMenu));
+      this->mainMenuBox->pack(optionsButton);
+
+
+      OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit");
+      this->mainMenuBox->pack(quitButton);
+      quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu));
+    }
+  }
+  this->mainMenuBox->showAll();
+
+  this->mainMenuBox->setRelCoor2D(200, 100);
+}
+
+
+void GameMenu::showCampaigns()
+{
+  if (this->levelsBox == NULL)
+  {
+    this->levelsBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
+    {
+      OrxGui::GLGuiBox* labelBox = new OrxGui::GLGuiBox();
+
+      OrxGui::GLGuiImage* image = new OrxGui::GLGuiImage();
+      image->show();
+      image->setWidgetSize( 250, 200);
+      image->setAbsCoor2D(400, 150);
+      image->setForegroundColor(Color(1,1,1,.6));
+
+      const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
+      std::list<BaseObject*>::const_iterator it;
+      for( it = storyEntities->begin(); it != storyEntities->end(); it++)
+      {
+        StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
+        if( se->isContainedInMenu())
+        {
+
+          printf("%s\n", se->getMenuScreenshoot().c_str());
+          OrxGui::GLGuiImageButton* button = new OrxGui::GLGuiImageButton(se->getName(), se->getStoryID(), se->getMenuScreenshoot(), image);
+          button->connect(SIGNAL(button, startLevel), this, SLOT(GameMenu, startLevel));
+          labelBox->pack(button);
+
+          // generating screenshoot item
+          /*
+          ImageEntity* ie = new ImageEntity();
+          ie->setVisibility(false);
+          ie->setBindNode((const PNode*)NULL);
+          ie->setTexture(se->getMenuScreenshoot());
+          ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f);
+          ie->setSize2D(140.0f, 105.0f);
+          this->menuLayers[1].screenshootList.push_back(ie);
+          */
+        }
+      }
+
+      this->levelsBox->pack(labelBox);
+      this->levelsBox->pack(image);
+    }
+
+  }
+
+  this->showSecondLevelElement(this->levelsBox);
+
+}
+
+void GameMenu::showMultiPlayer()
+{}
+
+void GameMenu::showOptionsMenu()
+{
+  if (this->optionsBox == NULL)
+  {
+    this->optionsBox = new OrxGui::GLGuiBox();
+    {
+      OrxGui::GLGuiButton* generalButton = new OrxGui::GLGuiPushButton("General");
+      optionsBox->pack(generalButton);
+
+      OrxGui::GLGuiButton* audioButton = new OrxGui::GLGuiPushButton("Audio");
+      optionsBox->pack(audioButton);
+
+      OrxGui::GLGuiButton* videoButton = new OrxGui::GLGuiPushButton("Video");
+      optionsBox->pack(videoButton);
+
+      OrxGui::GLGuiButton* controlButton = new OrxGui::GLGuiPushButton("Control");
+      optionsBox->pack(controlButton);
+
+
+      //      for (unsigned int i = 0; i <
+      //OrxGui::GLGuiButton*
+
+    }
+  }
+
+  this->showSecondLevelElement(this->optionsBox);
+}
+
+
+void GameMenu::showSecondLevelElement(OrxGui::GLGuiBox* element)
+{
+  if (this->currentlyOpened != NULL && this->currentlyOpened != element)
+    this->currentlyOpened->hideAll();
+
+  element->showAll();
+  element->setRelCoor2D(200, 100);
+
+  this->currentlyOpened = element;
+
+  this->mainMenuBox->setRelCoorSoft2D(50, 100, 5);
+}
+
+
+
+
+
+void GameMenu::startLevel(int levelID)
+{
+  this->setNextStoryID( levelID);
+  this->stop();
+}
+
+/**
+* @brief set the Sound to play when switching menu entry.
+* @param selectorSound the sound to load.
+*/
+void GameMenu::setSelectorSound(const std::string& selectorSound)
+{
+  this->selectorSource = OrxSound::SoundEngine::getInstance()->createSource(selectorSound, NULL);
+}
+
+ErrorMessage GameMenu::unloadData()
+{
+  this->unsubscribeEvents(ES_MENU);
+
+  return GameWorld::unloadData();
+}
+
+
+/**
+* @brief start the menu
+*/
+bool GameMenu::start()
+{
+  EventHandler::getInstance()->pushState(ES_MENU);
+
+  this->showMainMenu();
+  OrxGui::GLGuiHandler::getInstance()->activateCursor();
+  OrxGui::GLGuiHandler::getInstance()->activate();
+  OrxGui::GLGuiHandler::getInstance()->cursor()->loadTextureSequence(ResourceManager::getInstance()->getDataDir() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);
+
+  /* now call the underlying*/
+  return GameWorld::start();
+}
+
+
+
+/**
+* stop the menu
+*/
+bool GameMenu::stop()
+{
+  EventHandler::getInstance()->popState();
+
+  /* now call the underlying*/
+  return GameWorld::stop();
+}
+
+
+/**
+*  override the standard tick for more functionality
+*/
+void GameMenu::tick()
+{
+  GameWorld::tick();
+
+  // Make the GLGui tick.
+  OrxGui::GLGuiHandler::getInstance()->tick(this->dtS);
+
+  this->animateScene(this->dtS);
+}
+
+
+/**
+* @brief no collision detection in the menu
+*/
+void GameMenu::collide()
+{
+  //   this->dataTank->localCamera->
+}
+
+
+/**
+* @brief animate the scene
+*/
+void GameMenu::animateScene(float dt)
+{
+  Quaternion q(/*0.00005*/ dt * .1, Vector(0.0, 1.0, 0.0));
+  this->cameraVector = q.apply(this->cameraVector);
+  this->dataTank->localCamera->setRelCoor(this->cameraVector);
+  this->dataTank->localCamera->getTarget()->setRelCoorSoft(0,0,0);
+}
+
+void GameMenu::quitMenu()
+{
+  this->setNextStoryID(WORLD_ID_GAMEEND);
+  this->stop();
+}
+
+
+/**
+* @brief event dispatcher funciton
+* @param event the incoming event
+*/
+void GameMenu::process(const Event &event)
+{
+  if( event.type == SDLK_ESCAPE && event.bPressed == true)
+  {
+    this->setNextStoryID(WORLD_ID_GAMEEND);
+    this->stop();
+  }
+
+}
+
+
+
+/**********************************************************************************************
+GameMenuData
+**********************************************************************************************/
+
+
+/**
+* GameMenuData constructor
+*/
+GameMenuData::GameMenuData()
+{}
+
+/**
+* GameMenuData decontructor
+*/
+GameMenuData::~GameMenuData()
+{}
+
+
+/**
+*  initialize the GameWorldDataData
+*/
+ErrorMessage GameMenuData::init()
+{
+  /* call underlying function */
+  return GameWorldData::init();
+}
+
+
+/**
+*  loads the GUI data
+* @param root reference to the xml root element
+*/
+ErrorMessage GameMenuData::loadGUI(const TiXmlElement* root)
+{
+  /* call underlying function */
+  return GameWorldData::loadGUI(root);
+}
+
+
+/**
+*  unloads the GUI data
+*/
+ErrorMessage GameMenuData::unloadGUI()
+{
+  /* call underlying function */
+  return GameWorldData::unloadGUI();
+}
+
+
+/**
+*  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
+* @param root reference to the xml root parameter
+*/
+ErrorMessage GameMenuData::loadWorldEntities(const TiXmlElement* root)
+{
+  return GameWorldData::loadWorldEntities(root);
+}
+
+
+/**
+*  unloads the world entities from the xml file
+*/
+ErrorMessage GameMenuData::unloadWorldEntities()
+{
+  /* call underlying function */
+  return GameWorldData::unloadWorldEntities();
+}
+
+
+/**
+*  loads the scene data
+* @param root reference to the xml root element
+*/
+ErrorMessage GameMenuData::loadScene(const TiXmlElement* root)
+{
+  /* call underlying function */
+  return GameWorldData::loadScene(root);
+}
+
+
+/**
+*  unloads the scene data
+*/
+ErrorMessage GameMenuData::unloadScene()
+{
+  /* call underlying function */
+  return GameWorldData::unloadScene();
+}
+
+
+
Index: /trunk/src/story_entities/menu/game_menu.h
===================================================================
--- /trunk/src/story_entities/menu/game_menu.h	(revision 8717)
+++ /trunk/src/story_entities/menu/game_menu.h	(revision 8717)
@@ -0,0 +1,109 @@
+/*!
+ * @file game_menu.h
+ *  a StoryEntity that contains a simple game menu
+ */
+
+#ifndef _GAME_MENU_H
+#define _GAME_MENU_H
+
+
+#include "game_world.h"
+#include "game_world_data.h"
+#include <vector>
+#include "glgui.h"
+
+namespace OrxSound { class SoundSource; }
+
+//! a simple game menu based on a story entity
+/**
+ * This is a simple menu, that is based on the StoryEntity. Therefore this menu is absolutly
+ * loadable and is exchangeable very easely :D
+ */
+class GameMenu : virtual public GameWorld, virtual public EventListener
+{
+
+  public:
+    GameMenu(const TiXmlElement* root = NULL);
+    virtual ~GameMenu();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual ErrorMessage init();
+    virtual ErrorMessage loadData();
+    virtual ErrorMessage unloadData();
+
+    virtual bool start();
+    virtual bool stop();
+
+    virtual void process(const Event &event);
+
+
+    void startLevel(int level);
+
+    void showMainMenu();
+    void showCampaigns();
+    void showMultiPlayer();
+    void showOptionsMenu();
+
+
+    void quitMenu();
+
+  protected:
+    virtual void tick();
+    virtual void collide();
+
+
+  private:
+    void showSecondLevelElement(OrxGui::GLGuiBox* element);
+
+
+    void animateScene(float dt);
+    void switchMenuLayer(int layer1, int layer2);
+    void sliderTo(const Element2D* element, float bias = 0.0f);
+    void setSelectorSound(const std::string& selectorSound);
+
+
+  private:
+    OrxGui::GLGuiBox*                 mainMenuBox;
+    OrxGui::GLGuiBox*                 levelsBox;
+    OrxGui::GLGuiBox*                 networkBox;
+
+    OrxGui::GLGuiBox*                 optionsBox;
+    OrxGui::GLGuiBox*                 generalBox;
+    OrxGui::GLGuiBox*                 audioBox;
+    OrxGui::GLGuiBox*                 videoBox;
+    OrxGui::GLGuiBox*                 controlBox;
+
+    OrxGui::GLGuiBox*                 currentlyOpened;
+
+    Vector                            cameraVector;
+
+    OrxSound::SoundSource*            selectorSource;
+};
+
+
+
+//! the simple game menu data
+class GameMenuData : public GameWorldData
+{
+
+  public:
+    GameMenuData();
+    virtual ~GameMenuData();
+
+    virtual ErrorMessage init();
+
+
+  protected:
+    virtual ErrorMessage loadGUI(const TiXmlElement* root);
+    virtual ErrorMessage loadWorldEntities(const TiXmlElement* root);
+    virtual ErrorMessage loadScene(const TiXmlElement* root);
+
+    virtual ErrorMessage unloadGUI();
+    virtual ErrorMessage unloadWorldEntities();
+    virtual ErrorMessage unloadScene();
+
+};
+
+
+#endif /* _GAME_WORLD_H */
Index: /trunk/src/story_entities/menu/glgui_imagebutton.cc
===================================================================
--- /trunk/src/story_entities/menu/glgui_imagebutton.cc	(revision 8717)
+++ /trunk/src/story_entities/menu/glgui_imagebutton.cc	(revision 8717)
@@ -0,0 +1,68 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SHELL
+
+#include "glgui_imagebutton.h"
+
+#include "debug.h"
+
+namespace OrxGui
+{
+
+  GLGuiImageButton::GLGuiImageButton(const std::string& label, unsigned int levelID, const std::string& imageName, GLGuiImage* image)
+      : GLGuiPushButton(label)
+  {
+    this->imageName = imageName;
+    this->levelID = levelID;
+    this->image = image;
+
+    image->loadImageFromFile(imageName);
+  }
+
+  GLGuiImageButton::~GLGuiImageButton()
+  {}
+
+  void GLGuiImageButton::releasing(const Vector2D& pos, bool focused)
+  {
+    if (focused)
+      this->emit(startLevel(this->levelID));
+  }
+
+  void GLGuiImageButton::receivedFocus()
+  {
+    printf("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
+
+    this->image->loadImageFromFile(this->imageName);
+  }
+  void GLGuiImageButton::removedFocus()
+  {}
+
+
+  void GLGuiImageButton::showing()
+  {
+    GLGuiPushButton::showing();
+    this->image->show();
+  }
+
+  void GLGuiImageButton::hiding()
+  {
+    GLGuiPushButton::hiding();
+
+    this->image->hide();
+  }
+
+
+}
Index: /trunk/src/story_entities/menu/glgui_imagebutton.h
===================================================================
--- /trunk/src/story_entities/menu/glgui_imagebutton.h	(revision 8717)
+++ /trunk/src/story_entities/menu/glgui_imagebutton.h	(revision 8717)
@@ -0,0 +1,49 @@
+/*!
+ * @file shell.h
+ * Definition of a on-screen-shell
+ *
+ * @todo Buffer Display in different Colors for different debug mode.
+ * @todo choose color of the Font and the background.
+ */
+
+#ifndef _GLGUI_IMAGEBUTTON_H
+#define _GLGUI_IMAGEBUTTON_H
+
+#include "glgui_pushbutton.h"
+#include "event_listener.h"
+
+#include "glgui_image.h"
+
+//! Namespace of the GLGuiImageButton of ORXONOX.
+namespace OrxGui
+{
+  class GLGuiImageButton : public GLGuiPushButton
+  {
+  public:
+    GLGuiImageButton(const std::string& label, unsigned int levelID, const std::string& imageName, GLGuiImage* image);
+    virtual ~GLGuiImageButton();
+
+
+    DeclareSignal1(startLevel, int);
+
+  protected:
+    virtual void releasing(const Vector2D& pos, bool focused);
+    virtual void receivedFocus();
+    virtual void removedFocus();
+
+    virtual void showing();
+    virtual void hiding();
+
+
+  private:
+    unsigned int        levelID;
+    std::string         imageName;
+    GLGuiImage*         image;
+
+  private:
+
+  };
+
+}
+
+#endif /* _GLGUI_IMAGEBUTTON_H */
Index: /trunk/src/story_entities/multi_player_world.cc
===================================================================
--- /trunk/src/story_entities/multi_player_world.cc	(revision 8716)
+++ /trunk/src/story_entities/multi_player_world.cc	(revision 8717)
@@ -123,13 +123,14 @@
 /**
  * cleanup
- * @return 
+ * @return
  */
 ErrorMessage MultiPlayerWorld::unloadData( )
 {
-    
+
   GameWorld::unloadData();
-  
+
   delete NetworkManager::getInstance();
   delete NetworkGameManager::getInstance();
 
+  return ErrorMessage();
 }
Index: /trunk/src/story_entities/multi_player_world_data.cc
===================================================================
--- /trunk/src/story_entities/multi_player_world_data.cc	(revision 8716)
+++ /trunk/src/story_entities/multi_player_world_data.cc	(revision 8717)
@@ -78,5 +78,5 @@
 {
   /* call underlying function */
-  GameWorldData::init();
+  return GameWorldData::init();
 }
 
@@ -89,5 +89,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadGUI(root);
+  return GameWorldData::loadGUI(root);
 }
 
@@ -99,5 +99,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadGUI();
+  return GameWorldData::unloadGUI();
 }
 
@@ -245,7 +245,8 @@
   this->drawLists.push_back(OM_GROUP_01);
   this->drawLists.push_back(OM_GROUP_01_PROJ);
-  
+
   State::setPlayer(this->localPlayer);
- 
+
+  return ErrorMessage();
 }
 
@@ -257,5 +258,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadWorldEntities();
+  return GameWorldData::unloadWorldEntities();
 }
 
@@ -269,5 +270,5 @@
   /* call underlying function */
   GameWorldData::loadScene(root);
-  
+
   // create server playable
   if ( NetworkManager::getInstance()->isGameServer() )
@@ -276,4 +277,6 @@
     State::getPlayer()->setPlayable( PlayerStats::getStats( 0 )->getPlayable() );
   }
+
+  return ErrorMessage();
 }
 
@@ -285,5 +288,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadScene();
+  return GameWorldData::unloadScene();
 }
 
Index: /trunk/src/story_entities/simple_game_menu.cc
===================================================================
--- /trunk/src/story_entities/simple_game_menu.cc	(revision 8716)
+++ /trunk/src/story_entities/simple_game_menu.cc	(revision 8717)
@@ -131,4 +131,6 @@
     headers.push_back("3");
     table->setHeader(headers);
+    table->setEntry(1, 2, "Test");
+    table->setEntry(2, 1, "MultiLine SuperTest to see how it works");
 
 
Index: /trunk/src/story_entities/single_player_world_data.cc
===================================================================
--- /trunk/src/story_entities/single_player_world_data.cc	(revision 8716)
+++ /trunk/src/story_entities/single_player_world_data.cc	(revision 8717)
@@ -45,5 +45,5 @@
 {
   /* call underlying function */
-  GameWorldData::init();
+  return GameWorldData::init();
 }
 
@@ -56,5 +56,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadGUI(root);
+  return GameWorldData::loadGUI(root);
 }
 
@@ -66,5 +66,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadGUI();
+  return GameWorldData::unloadGUI();
 }
 
@@ -77,5 +77,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadWorldEntities(root);
+  return GameWorldData::loadWorldEntities(root);
 }
 
@@ -87,5 +87,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadWorldEntities();
+  return GameWorldData::unloadWorldEntities();
 }
 
@@ -98,5 +98,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadScene(root);
+  return GameWorldData::loadScene(root);
 }
 
@@ -108,5 +108,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadScene();
+  return GameWorldData::unloadScene();
 }
 
Index: /trunk/src/story_entities/story_entity.h
===================================================================
--- /trunk/src/story_entities/story_entity.h	(revision 8716)
+++ /trunk/src/story_entities/story_entity.h	(revision 8717)
@@ -35,9 +35,9 @@
   /* initialisation and loading */
   /** initializes a Story Entity to the needed values */
-  virtual ErrorMessage init() {};
+  virtual ErrorMessage init() { return ErrorMessage(); };
   /** called to load the data into the StoryEntity*/
-  virtual ErrorMessage loadData() {};
+  virtual ErrorMessage loadData() { return ErrorMessage(); };
   /** function that unloads the data from the StoryEntity */
-  virtual ErrorMessage unloadData() {};
+  virtual ErrorMessage unloadData() { return ErrorMessage(); };
 
   /* running, stopping and pausing */
Index: /trunk/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- /trunk/src/util/multiplayer_team_deathmatch.cc	(revision 8716)
+++ /trunk/src/util/multiplayer_team_deathmatch.cc	(revision 8717)
@@ -68,5 +68,5 @@
   this->gameStateTimer = 10.0f;
   this->bShowTeamChange = false;
-  
+
   this->box = NULL;
 
@@ -80,8 +80,8 @@
   if( root != NULL)
     this->loadParams(root);
-  
+
   subscribeEvent( ES_GAME, SDLK_o );
   subscribeEvent( ES_GAME, SDLK_TAB );
-  
+
   this->notifier = new OrxGui::GLGuiNotifier();
   this->notifier->show();
@@ -101,8 +101,8 @@
   if( this->deathScreen)
     delete this->deathScreen;
-  
+
   unsubscribeEvent( ES_GAME, SDLK_o );
   unsubscribeEvent( ES_GAME, SDLK_TAB );
-  
+
   if ( this->notifier )
   {
@@ -110,5 +110,5 @@
     this->notifier = NULL;
   }
-  
+
   if ( this->input )
   {
@@ -132,5 +132,5 @@
   LoadParam(root, "death-screen-image", this, MultiplayerTeamDeathmatch, setDeathScreen)
       .describe("sets the death screen image");
-  
+
   LoadParam(root, "num-teams", this, MultiplayerTeamDeathmatch, setNumTeams)
       .describe("sets number of teams");
@@ -179,37 +179,37 @@
   if ( SharedNetworkData::getInstance()->getHostID() < 0 )
     return;
-  
+
   if ( currentGameState == GAMESTATE_PRE_GAME || currentGameState == GAMESTATE_GAME )
   {
     if ( PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )
          && box == NULL
-         &&  (PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() == TEAM_NOTEAM 
+         &&  (PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() == TEAM_NOTEAM
          || bShowTeamChange )
-         
+
        )
     {
       EventHandler::getInstance()->pushState( ES_MENU );
-      
+
       OrxGui::GLGuiHandler::getInstance()->activateCursor();
-      
+
       box = new OrxGui::GLGuiBox();
       box->setAbsCoor2D( 300, 100 );
-      
+
       OrxGui::GLGuiPushButton * buttonSpectator = new OrxGui::GLGuiPushButton("Spectator");
       box->pack( buttonSpectator );
       buttonSpectator->connect(SIGNAL(buttonSpectator, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonSpectator));
-      
+
       OrxGui::GLGuiPushButton * buttonRandom = new OrxGui::GLGuiPushButton("Random");
       box->pack( buttonRandom );
       buttonRandom->connect(SIGNAL(buttonRandom, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonRandom));
-      
+
       OrxGui::GLGuiPushButton * buttonTeam0 = new OrxGui::GLGuiPushButton("Blue Team");
       box->pack( buttonTeam0 );
       buttonTeam0->connect(SIGNAL(buttonTeam0, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam0));
-      
+
       OrxGui::GLGuiPushButton * buttonTeam1 = new OrxGui::GLGuiPushButton("Red Team");
       box->pack( buttonTeam1 );
       buttonTeam1->connect(SIGNAL(buttonTeam1, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam1));
-      
+
       if ( bShowTeamChange )
       {
@@ -218,9 +218,9 @@
         buttonCancel->connect(SIGNAL(buttonCancel, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonCancel));
       }
-      
+
       OrxGui::GLGuiPushButton * buttonExit = new OrxGui::GLGuiPushButton("Exit");
       box->pack( buttonExit );
       buttonExit->connect(SIGNAL(buttonExit, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonExit));
-      
+
       box->showAll();
     }
@@ -229,5 +229,5 @@
   if ( box != NULL
        && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )
-       && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM 
+       && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM
        && !bShowTeamChange
      )
@@ -235,35 +235,35 @@
     delete box;
     box = NULL;
-      
+
     OrxGui::GLGuiHandler::getInstance()->deactivateCursor( true );
-      
+
     EventHandler::getInstance()->popState();
   }
-  
+
   if ( box != NULL )
   {
     OrxGui::GLGuiHandler::getInstance()->tick( dt );
   }
-  
+
   assignPlayable();
-  
+
   if ( !SharedNetworkData::getInstance()->isGameServer() )
     return;
-  
+
   gameStateTimer -= dt;
   //PRINTF(0)("TICK %f\n", gameStateTimer);
-  
+
   if ( currentGameState != GAMESTATE_GAME && gameStateTimer < 0 )
     nextGameState();
-  
+
   this->currentGameState = NetworkGameManager::getInstance()->getGameState();
-  
+
   if ( currentGameState == GAMESTATE_GAME )
   {
     handleTeamChanges();
   }
-  
+
   this->calculateTeamScore();
-  
+
   this->checkGameRules();
 
@@ -304,5 +304,5 @@
   if ( !SharedNetworkData::getInstance()->isGameServer() )
     return;
-  
+
   // check for max killing count
   for ( int i = 0; i<numTeams; i++ )
@@ -329,8 +329,8 @@
   if ( team == TEAM_NOTEAM || team == TEAM_SPECTATOR )
     return CL_SPECTATOR;
-  
+
   if ( team == 0 || team == 1 )
     return CL_SPACE_SHIP;
-  
+
   assert( false );
 }
@@ -352,14 +352,14 @@
 {
   teamScore.clear();
-  
+
   for ( int i = 0; i<numTeams; i++ )
     teamScore[i] = 0;
-  
-    
+
+
   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-  
+
   if ( !list )
     return;
-  
+
   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
   {
@@ -380,13 +380,13 @@
 {
   std::map<int,int> playersInTeam;
-  
+
   for ( int i = 0; i<numTeams; i++ )
     playersInTeam[i] = 0;
-  
+
   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-  
+
   if ( !list )
     return 0;
-  
+
   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
   {
@@ -398,9 +398,9 @@
     }
   }
-  
-  
+
+
   int minPlayers = 0xFFFF;
   int minTeam = -1;
-  
+
   for ( int i = 0; i<numTeams; i++ )
   {
@@ -411,7 +411,7 @@
     }
   }
-  
+
   assert( minTeam != -1 );
-  
+
   return minTeam;
 }
@@ -422,19 +422,19 @@
   {
     NetworkGameManager::getInstance()->setGameState( GAMESTATE_GAME );
-    
-    return;
-  }
-  
+
+    return;
+  }
+
   if ( currentGameState == GAMESTATE_GAME )
   {
     NetworkGameManager::getInstance()->setGameState( GAMESTATE_POST_GAME );
-    
-    return;
-  }
-  
+
+    return;
+  }
+
   if ( currentGameState == GAMESTATE_POST_GAME )
   {
     //TODO end game
-    
+
     return;
   }
@@ -444,8 +444,8 @@
 {
   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-  
+
   if ( !list )
     return;
-  
+
   //first server players with choices
   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
@@ -461,5 +461,5 @@
     }
   }
-  
+
   //now serve player who want join a random team
   for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
@@ -482,30 +482,30 @@
   assert( PlayerStats::getStats( userId ) );
   PlayerStats & stats = *(PlayerStats::getStats( userId ));
-  
+
   stats.setTeamId( stats.getPreferedTeamId() );
-  
+
   Playable * oldPlayable = stats.getPlayable();
-  
-  
+
+
   ClassID playableClassId = getPlayableClassId( userId, stats.getPreferedTeamId() );
   std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );
-  
+
   BaseObject * bo = Factory::fabricate( playableClassId );
-  
+
   assert( bo != NULL );
   assert( bo->isA( CL_PLAYABLE ) );
-  
+
   Playable & playable = *(dynamic_cast<Playable*>(bo));
-  
+
   playable.loadModel( playableModel );
   playable.setOwner( userId );
   playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
   playable.setSynchronized( true );
-  
+
   stats.setTeamId( stats.getPreferedTeamId() );
   stats.setPlayableClassId( playableClassId );
   stats.setPlayableUniqueId( playable.getUniqueID() );
   stats.setModelFileName( playableModel );
-  
+
   if ( oldPlayable )
   {
@@ -572,5 +572,5 @@
       OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
       input->show();
-      input->giveFocus();
+      input->giveMouseFocus();
       input->setText("say ");
     }
@@ -594,10 +594,10 @@
 {
   std::string name = "unknown";
-  
+
   if ( PlayerStats::getStats( userId ) )
   {
     name = PlayerStats::getStats( userId )->getNickName();
   }
-  
+
   PRINTF(0)("CHATMESSAGE %s (%d): %s\n", name.c_str(), userId, message.c_str() );
   notifier->pushNotifyMessage(name + ": " + message);
@@ -607,10 +607,10 @@
 {
   EventHandler::getInstance()->popState();
-  input->breakFocus();
+  input->breakMouseFocus();
   input->hide();
   input->setText("");
 
   std::string command = text;
- 
+
   //HACK insert " in say commands so user doesn't have to type them
   if ( command.length() >= 4 && command[0] == 's' && command[1] == 'a' && command[2] == 'y' && command[3] == ' ' )
