Index: /branches/gui/src/defs/error.h
===================================================================
--- /branches/gui/src/defs/error.h	(revision 8676)
+++ /branches/gui/src/defs/error.h	(revision 8677)
@@ -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: /branches/gui/src/lib/data/data_tank.h
===================================================================
--- /branches/gui/src/lib/data/data_tank.h	(revision 8676)
+++ /branches/gui/src/lib/data/data_tank.h	(revision 8677)
@@ -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: /branches/gui/src/lib/util/loading/game_loader.cc
===================================================================
--- /branches/gui/src/lib/util/loading/game_loader.cc	(revision 8676)
+++ /branches/gui/src/lib/util/loading/game_loader.cc	(revision 8677)
@@ -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: /branches/gui/src/story_entities/campaign.cc
===================================================================
--- /branches/gui/src/story_entities/campaign.cc	(revision 8676)
+++ /branches/gui/src/story_entities/campaign.cc	(revision 8677)
@@ -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: /branches/gui/src/story_entities/game_menu.cc
===================================================================
--- /branches/gui/src/story_entities/game_menu.cc	(revision 8676)
+++ /branches/gui/src/story_entities/game_menu.cc	(revision 8677)
@@ -68,9 +68,4 @@
 
   State::setMenuID(this->getNextStoryID());
-}
-
-/// HACK only for testing.
-void GameMenu::enterGui()
-{
 }
 
@@ -126,4 +121,5 @@
   GraphicsEngine::getInstance()->displayFPS(false);
 
+  return ErrorMessage();
 }
 
@@ -134,20 +130,130 @@
 ErrorMessage GameMenu::loadData()
 {
-  this->mainMenuBox = new OrxGui::GLGuiBox();
+  this->mainMenuBox = NULL;
+
+  this->levelsBox = NULL;
+  this->networkBox = NULL;
+
+  this->optionsBox = NULL;
+  this->audioBox = NULL;
+  this->videoBox = NULL;
+  this->controlBox = NULL;
+  this->levelsBox = NULL;
+
+  return GameWorld::loadData();
+}
+
+
+void GameMenu::showMainMenu()
+{
+  if (mainMenuBox == NULL)
   {
-    OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play");
-    this->mainMenuBox->pack(startButton);
-
-
-    OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit");
-    this->mainMenuBox->pack(quitButton);
-    quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu));
-
-
+    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));
+    }
   }
-
-
-  GameWorld::loadData();
-}
+  this->mainMenuBox->showAll();
+
+  this->mainMenuBox->setRelCoor2D(200, 100);
+}
+
+void GameMenu::showCampaigns()
+{
+
+  if (this->levelsBox == NULL)
+  {
+    this->levelsBox = new OrxGui::GLGuiBox();
+    {
+      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())
+        {
+          OrxGui::GLGuiWidget* button = new OrxGui::GLGuiPushButton(se->getName());
+          levelsBox->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->showAll();
+  this->levelsBox->setRelCoor2D(200, 100);
+  this->mainMenuBox->setRelCoorSoft2D(50, 100, 5);
+
+}
+
+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->optionsBox->showAll();
+  this->optionsBox->setRelCoor2D(200, 100);
+
+  this->mainMenuBox->setRelCoorSoft2D(50, 100, 5);
+
+}
+
+
+
+
+
+
+
+
+
 
 /**
@@ -164,5 +270,5 @@
   this->unsubscribeEvents(ES_MENU);
 
-  GameWorld::unloadData();
+  return GameWorld::unloadData();
 }
 
@@ -175,8 +281,8 @@
   EventHandler::getInstance()->pushState(ES_MENU);
 
-  this->mainMenuBox->showAll();
+  this->showMainMenu();
 
   /* now call the underlying*/
-  GameWorld::start();
+  return GameWorld::start();
 }
 
@@ -191,5 +297,5 @@
 
   /* now call the underlying*/
-  GameWorld::stop();
+  return GameWorld::stop();
 }
 
@@ -276,5 +382,5 @@
 {
   /* call underlying function */
-  GameWorldData::init();
+  return GameWorldData::init();
 }
 
@@ -287,5 +393,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadGUI(root);
+  return GameWorldData::loadGUI(root);
 }
 
@@ -297,5 +403,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadGUI();
+  return GameWorldData::unloadGUI();
 }
 
@@ -307,5 +413,5 @@
 ErrorMessage GameMenuData::loadWorldEntities(const TiXmlElement* root)
 {
-  GameWorldData::loadWorldEntities(root);
+  return GameWorldData::loadWorldEntities(root);
 }
 
@@ -317,5 +423,5 @@
 {
   /* call underlying function */
-  GameWorldData::unloadWorldEntities();
+  return GameWorldData::unloadWorldEntities();
 }
 
@@ -328,5 +434,5 @@
 {
   /* call underlying function */
-  GameWorldData::loadScene(root);
+  return GameWorldData::loadScene(root);
 }
 
@@ -338,7 +444,7 @@
 {
   /* call underlying function */
-  GameWorldData::unloadScene();
-}
-
-
-
+  return GameWorldData::unloadScene();
+}
+
+
+
Index: /branches/gui/src/story_entities/game_menu.h
===================================================================
--- /branches/gui/src/story_entities/game_menu.h	(revision 8676)
+++ /branches/gui/src/story_entities/game_menu.h	(revision 8677)
@@ -27,13 +27,4 @@
     virtual ~GameMenu();
 
-    /// TODO TAKE THIS OUT
-    void enterGui();
-    void execURL() const;
-    static int startURL(void* data);
-
-    void setImage(int i);
-    OrxGui::GLGuiImage* image;
-    OrxGui::GLGuiInputLine* imageName;
-    ///
     virtual void loadParams(const TiXmlElement* root);
 
@@ -49,4 +40,10 @@
 
     void startLevel(int level);
+
+    void showMainMenu();
+    void showCampaigns();
+    void showMultiPlayer();
+    void showOptionsMenu();
+
     void quitMenu();
 
@@ -65,8 +62,11 @@
   private:
     OrxGui::GLGuiBox*                 mainMenuBox;
+    OrxGui::GLGuiBox*                 levelsBox;
+    OrxGui::GLGuiBox*                 networkBox;
+
+    OrxGui::GLGuiBox*                 optionsBox;
     OrxGui::GLGuiBox*                 audioBox;
     OrxGui::GLGuiBox*                 videoBox;
     OrxGui::GLGuiBox*                 controlBox;
-    OrxGui::GLGuiBox*                 levelsBox;
 
     Vector                            cameraVector;
Index: /branches/gui/src/story_entities/game_world.cc
===================================================================
--- /branches/gui/src/story_entities/game_world.cc	(revision 8676)
+++ /branches/gui/src/story_entities/game_world.cc	(revision 8677)
@@ -140,4 +140,5 @@
   State::setScriptManager(&this->scriptManager);
 
+  return ErrorMessage();
 }
 
@@ -155,11 +156,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()"));
   }
 
@@ -170,5 +171,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
@@ -180,5 +181,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 */
@@ -193,10 +194,12 @@
   Account *b = new Account(30);
   b->setName("b");
-  
-  
+
+
   LoadParamXML(root, "ScriptManager", &this->scriptManager, ScriptManager, loadParams);
 
   delete XMLDoc;
   this->releaseLoadScreen();
+
+  return ErrorMessage();
 }
 
@@ -223,4 +226,6 @@
   if (this->dataXML)
     delete this->dataXML;
+
+  return ErrorMessage();
 }
 
@@ -235,4 +240,6 @@
   State::setScriptManager(&this->scriptManager); //make sure we have the right script manager
   this->run();
+
+  return true;
 }
 
@@ -245,5 +252,5 @@
   PRINTF(3)("GameWorld::stop() - got stop signal\n");
   State::setScriptManager(NULL);
-  this->bRunning = false;
+  return (this->bRunning = false);
 }
 
@@ -254,5 +261,5 @@
 bool GameWorld::pause()
 {
-  this->bPaused = true;
+  return (this->bPaused = true);
 }
 
@@ -263,5 +270,5 @@
 bool GameWorld::resume()
 {
-  this->bPaused = false;
+  return(this->bPaused = false);
 }
 
@@ -413,5 +420,5 @@
     if( likely(this->dataTank->gameRule != NULL))
       this->dataTank->gameRule->tick(this->dtS);
-      
+
   }
 }
Index: /branches/gui/src/story_entities/game_world_data.cc
===================================================================
--- /branches/gui/src/story_entities/game_world_data.cc	(revision 8676)
+++ /branches/gui/src/story_entities/game_world_data.cc	(revision 8677)
@@ -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: /branches/gui/src/story_entities/multi_player_world.cc
===================================================================
--- /branches/gui/src/story_entities/multi_player_world.cc	(revision 8676)
+++ /branches/gui/src/story_entities/multi_player_world.cc	(revision 8677)
@@ -123,13 +123,14 @@
 /**
  * cleanup
- * @return 
+ * @return
  */
 ErrorMessage MultiPlayerWorld::unloadData( )
 {
-    
+
   GameWorld::unloadData();
-  
+
   delete NetworkManager::getInstance();
   delete NetworkGameManager::getInstance();
 
+  return ErrorMessage();
 }
Index: /branches/gui/src/story_entities/multi_player_world_data.cc
===================================================================
--- /branches/gui/src/story_entities/multi_player_world_data.cc	(revision 8676)
+++ /branches/gui/src/story_entities/multi_player_world_data.cc	(revision 8677)
@@ -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: /branches/gui/src/story_entities/single_player_world_data.cc
===================================================================
--- /branches/gui/src/story_entities/single_player_world_data.cc	(revision 8676)
+++ /branches/gui/src/story_entities/single_player_world_data.cc	(revision 8677)
@@ -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: /branches/gui/src/story_entities/story_entity.h
===================================================================
--- /branches/gui/src/story_entities/story_entity.h	(revision 8676)
+++ /branches/gui/src/story_entities/story_entity.h	(revision 8677)
@@ -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 */
