Index: branches/gui/src/world_entities/Makefile.am
===================================================================
--- branches/gui/src/world_entities/Makefile.am	(revision 10128)
+++ branches/gui/src/world_entities/Makefile.am	(revision 10129)
@@ -29,4 +29,5 @@
 		\
 		questGUI/quest_gui.cc \
+		questGUI/quest.cc \
 		\
 		effects/explosion.cc \
@@ -60,4 +61,5 @@
 		\
 		questGUI/quest_gui.h \
+		questGUI/quest.h \
 		\
 		effects/explosion.h \
Index: branches/gui/src/world_entities/questGUI/quest.cc
===================================================================
--- branches/gui/src/world_entities/questGUI/quest.cc	(revision 10129)
+++ branches/gui/src/world_entities/questGUI/quest.cc	(revision 10129)
@@ -0,0 +1,90 @@
+
+
+/*
+   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: Andreas Hejj
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "debug.h"
+#include "quest.h"
+
+#include "event_handler.h"
+
+#include "state.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "graphics_engine.h"
+#include "camera.h"
+#include "sound_engine.h"
+
+#include "sound_source.h"
+
+#include "glgui.h"
+#include "menu/glgui_imagebutton.h"
+#include "glgui_text.h"
+#include <glgui_image.h>
+
+
+#include "shell_command.h"
+
+
+
+
+ObjectListDefinition(Quest);
+
+Quest::Quest(const TiXmlElement* root)
+{
+  this->registerObject(this, Quest::_objectList);
+
+  if( root != NULL)
+    this->loadParams(root);
+
+}
+
+
+/**
+ * deconstructor
+ */
+Quest::~Quest () 
+{
+}
+
+
+
+
+/**
+ * loads the xml tagsthis->questDescription
+ * @param root: root xml tag for this element
+ */
+void Quest::loadParams(const TiXmlElement* root)
+{
+   LoadParam(root, "quest-name", this, Quest, setQuestName)
+       .describe("sets the name of a quest");
+   LoadParam(root, "quest-description", this, Quest, setQuestDescription)
+       .describe("sets the description of a quest");
+   LoadParam(root, "quest-picture", this, Quest, setQuestPicture)
+       .describe("sets the picture of a quest");
+   LoadParam(root, "quest-difficulty", this, Quest, setQuestDifficulty)
+       .describe("sets the difficulty of a quest");
+   LoadParam(root, "reward-description", this, Quest, setRewardDescription)
+       .describe("sets the description of a reward");
+   LoadParam(root, "reward-picture", this, Quest, setRewardPicture)
+       .describe("sets the Picture of a reward");
+   
+}
+
Index: branches/gui/src/world_entities/questGUI/quest.h
===================================================================
--- branches/gui/src/world_entities/questGUI/quest.h	(revision 10129)
+++ branches/gui/src/world_entities/questGUI/quest.h	(revision 10129)
@@ -0,0 +1,47 @@
+
+#ifndef _QUEST_H
+#define _QUEST_H
+
+
+
+#include "base_object.h"
+#include <string>
+
+class Quest : public BaseObject 
+{
+
+  ObjectListDeclaration(Quest);
+  
+  public:
+   Quest (const TiXmlElement* root);
+   virtual ~Quest ();
+
+
+   virtual void loadParams(const TiXmlElement* root = NULL);
+
+   /** @param questName sets the name of this quest */
+   inline void setQuestName(const std::string& questName)                { this->questName = questName; }
+   inline const std::string& getQuestName()                              { return this->questName; }
+   inline void setQuestDescription(const std::string& questDescription)  { this->questDescription = questDescription; }
+   inline const std::string& getQuestDescription()                       { return this->questDescription; }
+   inline void setQuestPicture(const std::string& questPicture)          { this->questPicture = questPicture; }
+   inline const std::string& getQuestPicture()                           { return this->questPicture; }
+   inline void setQuestDifficulty(const std::string& questDifficulty)    { this->questDifficulty = questDifficulty; }
+   inline const std::string& getQuestDifficulty()                        { return this->questDifficulty; }
+   inline void setRewardDescription(const std::string& rewardDescription){ this->rewardDescription  = rewardDescription; }
+   inline const std::string& getRewardDescription()                      { return this->rewardDescription; }
+   inline void setRewardPicture(const std::string& rewardPicture)        { this->rewardPicture  = rewardPicture; }
+   inline const std::string& getRewardPicture()                          { return this->rewardPicture; }
+
+   
+  private:
+    std::string             questName;
+    std::string             questDescription;
+    std::string             questPicture;
+    std::string             questDifficulty;
+    std::string             rewardDescription;
+    std::string             rewardPicture;
+
+};
+
+#endif /* _QUEST_H */
Index: branches/gui/src/world_entities/questGUI/quest_gui.cc
===================================================================
--- branches/gui/src/world_entities/questGUI/quest_gui.cc	(revision 10128)
+++ branches/gui/src/world_entities/questGUI/quest_gui.cc	(revision 10129)
@@ -12,5 +12,10 @@
 
    ### File Specific:
-   main-programmer: Andreas Hejj
+   main-programmer    std::string             questName;
+    std::string             questDescription;
+    std::string             questPicture;
+    std::string             questDifficulty;
+    std::string             rewardDescription;
+    std::string             rewardPicture;: Andreas Hejj
 
 */
@@ -35,4 +40,5 @@
 #include "sound_source.h"
 
+#include "glgui_widget.h"
 #include "glgui.h"
 #include "menu/glgui_imagebutton.h"
@@ -41,4 +47,6 @@
 
 
+#include "quest.h"
+
 #include "shell_command.h"
 
@@ -60,7 +68,10 @@
   
   this->questBox = NULL;  
-
-  if( root != NULL)
-    this->loadParams(root);
+  
+  this->bKillGui = false;
+
+  this->myQuest = new Quest(root);
+  if(root)
+    this->loadParams( root);
 
 }
@@ -72,8 +83,7 @@
 QuestGUI::~QuestGUI () 
 {
-}
-
-
-
+  if( this->myQuest)
+    delete this->myQuest;
+}
 
 /**
@@ -83,20 +93,7 @@
 void QuestGUI::loadParams(const TiXmlElement* root)
 {
-   WorldEntity::loadParams(root);
-   
-   LoadParam(root, "quest-name", this, QuestGUI, setQuestName)
-       .describe("sets the name of a quest");
-   LoadParam(root, "quest-description", this, QuestGUI, setQuestDescription)
-       .describe("sets the description of a quest");
-   LoadParam(root, "quest-picture", this, QuestGUI, setQuestPicture)
-       .describe("sets the picture of a quest");
-   LoadParam(root, "quest-difficulty", this, QuestGUI, setQuestDifficulty)
-       .describe("sets the difficulty of a quest");
-   LoadParam(root, "reward-description", this, QuestGUI, setRewardDescription)
-       .describe("sets the description of a reward");
-   LoadParam(root, "reward-picture", this, QuestGUI, setRewardPicture)
-       .describe("sets the Picture of a reward");
-   
-}
+  WorldEntity::loadParams(root);
+}
+
 
 
@@ -109,4 +106,5 @@
   {
     this->questBox= new OrxGui::GLGuiBox(OrxGui::Vertical);
+    this->bKillGui = false;
     
     OrxGui::GLGuiBox* headerBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
@@ -114,15 +112,18 @@
       OrxGui::GLGuiImage* questImage = new OrxGui::GLGuiImage();
       questImage->setWidgetSize(100, 100);
-      questImage->loadImageFromFile(questPicture);
+      questImage->loadImageFromFile(this->myQuest->getQuestPicture());
       questImage->show();
+      questImage->setBorderBottom(20);
       headerBox->pack(questImage);
+      headerBox->setBorderBottom(20);
       
       OrxGui::GLGuiBox* outlineBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
       {
         OrxGui::GLGuiText* questDifficulty = new OrxGui::GLGuiText();
-        questDifficulty->setText(this->questDifficulty);
+        questDifficulty->setText(this->myQuest->getQuestDifficulty());
         outlineBox->pack(questDifficulty);
       }
       headerBox->pack(outlineBox);
+      headerBox->setBorderBottom(75);
       
     }
@@ -131,6 +132,7 @@
     { 
       OrxGui::GLGuiText* questTxt = new OrxGui::GLGuiText();
-      questTxt->setText(this->questDescription);
+      questTxt->setText(this->myQuest->getQuestDescription());
       labelBox->pack(questTxt);
+      labelBox->setBorderBottom(75);
     }
     
@@ -140,11 +142,14 @@
       OrxGui::GLGuiImage* rewardImage = new OrxGui::GLGuiImage();
       rewardImage->setWidgetSize(50, 50);
-      rewardImage->loadImageFromFile(rewardPicture);
+      rewardImage->loadImageFromFile(this->myQuest->getRewardPicture());
       rewardImage->show();
       rewardBox->pack(rewardImage);
+      rewardImage->setBorderBottom(50);
     
       OrxGui::GLGuiText* rewardTxt = new OrxGui::GLGuiText();
-      rewardTxt->setText(this->rewardDescription);
+      rewardTxt->setText(this->myQuest->getRewardDescription());
       rewardBox->pack(rewardTxt);
+      rewardBox->setBorderBottom(75);
+      
     }
     
@@ -152,7 +157,10 @@
     {
       OrxGui::GLGuiButton* acceptButton = new OrxGui::GLGuiPushButton("Accept");
+      acceptButton->released.connect(this, &QuestGUI::accept);
       answerBox->pack(acceptButton);
+      acceptButton->select();
       
       OrxGui::GLGuiButton* refuseButton = new OrxGui::GLGuiPushButton("Refuse");
+      refuseButton->released.connect(this, &QuestGUI::refuse);
       answerBox->pack(refuseButton);
     }
@@ -170,13 +178,33 @@
   else
   {
-    OrxGui::GLGuiHandler::getInstance()->deactivate();
-    OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
-    delete this->questBox;
-    this->questBox = NULL;
+    this->bKillGui = true;
   }
   
 }
 
-
-
-
+    
+void QuestGUI::tick(float dt)
+{
+  if( this->bKillGui)
+    this->killgui();
+}
+    
+
+void QuestGUI::accept()
+{
+  this->bKillGui = true;
+  
+}
+
+void QuestGUI::refuse()
+{
+  this->bKillGui = true;
+}
+
+void QuestGUI::killgui()
+{
+  OrxGui::GLGuiHandler::getInstance()->deactivate();
+  OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
+  delete this->questBox;
+  this->questBox = NULL;
+}
Index: branches/gui/src/world_entities/questGUI/quest_gui.h
===================================================================
--- branches/gui/src/world_entities/questGUI/quest_gui.h	(revision 10128)
+++ branches/gui/src/world_entities/questGUI/quest_gui.h	(revision 10129)
@@ -8,5 +8,5 @@
 #include <vector>
 
-
+class Quest;
 
 class QuestGUI : public WorldEntity 
@@ -18,25 +18,14 @@
    QuestGUI (const TiXmlElement* root);
    virtual ~QuestGUI ();
-
-
-   virtual void loadParams(const TiXmlElement* root = NULL);
-
-   /** @param questName sets the name of this quest */
-   inline void setQuestName(const std::string& questName)                { this->questName = questName; }
-   inline void setQuestDescription(const std::string& questDescription)  { this->questDescription = questDescription; }
-   inline void setQuestPicture(const std::string& questPicture)          { this->questPicture = questPicture; }
-   inline void setQuestDifficulty(const std::string& questDifficulty)    { this->questDifficulty = questDifficulty; }
-   inline void setRewardDescription(const std::string& rewardDescription){ this->rewardDescription  = rewardDescription; }
-   inline void setRewardPicture(const std::string& rewardPicture)        { this->rewardPicture  = rewardPicture; }
+                     
+   void loadParams(const TiXmlElement* root);
+   
    void guiInit();
 
+   virtual void tick(float dt);
    
   private:
-    std::string             questName;
-    std::string             questDescription;
-    std::string             questPicture;
-    std::string             questDifficulty;
-    std::string             rewardDescription;
-    std::string             rewardPicture;
+    Quest*                  myQuest;
+    bool                    bKillGui;
     
     OrxGui::GLGuiBox*       headerBox;
@@ -50,4 +39,8 @@
 
     OrxSound::SoundSource*  selectorSource;
+    
+    void accept();
+    void refuse();
+    void killgui();
 };
 
