Index: code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua
===================================================================
--- code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua	(revision 11433)
+++ code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua	(revision 11435)
@@ -1,36 +1,3 @@
---[[local P = createMenuSheet("Dialogue Window")
 
-function P.onLoad()
-	P.createWindow()
-	P.showing = true    
-end
- function function_name( ... )
- 	-- body
- end
-
-
-
-
-function P.createWindow()
-    
-    local question = orxonox.DialogueManager:getInstance():getquestion()
-    local default = (winMgr:createWindow("DefaultWindow"))
-    default:setText(question)
-    default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
-    default:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
-    
-    
-
-
-    
-end
-local numOptions = DialogueManager:getnumOptions()
-    local counter = 1
-    local offset = 0
-    --create and name buttons while there are still options
-    while counter <= numOptions do
-        
-        
-    end]]
 -- Dialogue.lua
 
@@ -51,6 +18,4 @@
 
 function P.onLoad()
-
-	orxout("loading")
     P.wrapper = nil
     P.detailsWindows = {}
@@ -60,5 +25,4 @@
 
 function P.onShow()
-	orxout("showing")
     orxonox.CommandExecutor:execute("setTimeFactor 0")
     P.createInventory()
@@ -74,5 +38,4 @@
 
 function P.update()
-    orxout("UPDATING")
     P.updateInventory()
     if P.showing == false then
@@ -104,6 +67,6 @@
     detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
     local a1 = orxonox.DialogueManager:getInstance():getanswers1()
-    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, 0)))
-    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
+    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, (P.imageHeight-P.textHeight)/2)))
+    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
     detailsButton:setText(a1)
     orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
@@ -112,6 +75,6 @@
     a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
     local a2 = orxonox.DialogueManager:getInstance():getanswers2()
-    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, 0)))
-    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
+    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, (P.imageHeight-P.textHeight)/2)))
+    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
     a2Button:setText(a2)
     orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
@@ -147,5 +110,5 @@
         end
     end
-    orxonox.DialogueManager:getInstance():clean()
+    
 end
 
Index: code/branches/Dialogue_FS17/data/levels/DialogueShowcase.oxw
===================================================================
--- code/branches/Dialogue_FS17/data/levels/DialogueShowcase.oxw	(revision 11435)
+++ code/branches/Dialogue_FS17/data/levels/DialogueShowcase.oxw	(revision 11435)
@@ -0,0 +1,79 @@
+<LevelInfo
+ name = "DialogueShowcase"
+ description = "A level to show and test the functionality of the Dialogue module."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/HeavyCruiser.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+  include("templates/endurancetest_template.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+  
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+ <DistanceTrigger name="test" position="100,0,100" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,0,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
+    
+    <NextQuestion  question="Unknown Spaceship Transmission: Who goes there?" a1="(say your name)" a2="None of your business I'm afraid." >
+     <possibleQuestions> 
+        <NextQuestion  question="You're not cleared for this area, turn back." a1="Doesn't look too exciting here anyways." a2="You gotta make me try...(attack)" />
+        <NextQuestion  question="I'll make it my business. Only military allowed in this area." a1="Whoops, didn't know that, I'll be on my way then." a2="Got an important message for Sgt Smith though." >
+        <possibleQuestions>
+          <NextQuestion  question="Make sure I don't have to see your ugly face again." a1="...thanks, bye." a2="I'll think about it." />
+          <NextQuestion  question="Oh why didn't you say that in the first place? Off you go." a1="Thanks mate." a2="Just don't be so rude next time." />
+        </possibleQuestions>
+      </NextQuestion>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test" />
+        </execute>
+      </events>
+    </NextQuestion>
+
+    <DistanceTrigger name="test1" position="100,0,-100" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,0,-100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,1"/>
+    
+    <NextQuestion  question="Hey,  sorry to bother you,  could you help me with something?" a1="Yeah sure." a2="Nope get lost." >
+     <possibleQuestions> 
+        <NextQuestion  question="Do you like fish" a1="...yes?" a2="This is wasting my time." >
+        <possibleQuestions>
+          <NextQuestion  question="Splendid! Would you like your ship to look like one?" a1="..." a2="I'm going now,  okay?" />
+          <NextQuestion  question="Turtles then?" a1="..." a2="Im going now,  okay?" />
+        </possibleQuestions>
+        </NextQuestion>
+        <NextQuestion  question="I can pay you know." a1="Got enough money." a2="...are you deaf? Bye."/>
+      </possibleQuestions>    
+      <events>
+        <execute>
+           <EventListener event="test1" />
+        </execute>
+      </events>
+    </NextQuestion>
+
+    
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    
+    
+  </Scene>
+</Level>
Index: code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	(revision 11433)
+++ code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	(revision 11435)
@@ -29,39 +29,25 @@
     skybox       = "Orxonox/Starbox"
   >
- <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true"/>
-    <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,0"/>
-    <DialogueManager question="Hello World3">
-      <events>
+ 
+
+    <DistanceTrigger name="test" position="100,0,100" target="Pawn" distance=25 stayActive="true" />
+    <Backlight position="100,0,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
+    
+    <NextQuestion  question="Your question" a1="First answer" a2="Second answer" >
+      <possibleQuestions>
+          <NextQuestion  question="Your next question if a1 was chosen" a1="First answer" a2="Second answer" />
+          <NextQuestion  question="Your next question if a2 was chosen." a1="First answer" a2="Second answer" />
+        </possibleQuestions>
+    <events>
         <execute>
            <EventListener event="test" />
         </execute>
-      </events>
-    </DialogueManager>
-
-    <!--<DialogueManager firstquestion="hello world">
-      <options>
-        <NextQuestion answer="ja" question="question?">
-          <options>
-            <NextQuestion answer="" question="">
-            </NextQuestion>
-          </options>
-        </NextQuestion>
-       <events>
-        <execute>
-           <EventListener event="test" />
-        </execute>
-      </events>
-    </DialogueManager>
-  -->
-
+    </events>
+    </NextQuestion>
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
     <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
 
-    <ModularSpaceShip velocity= "20,0,0" position="0,0,200" lookat= "0,0,0" health="1000" maxhealth="1000" initialhealth="1000">
-      <templates>
-        <Template link=endurance />
-      </templates>
-    </ModularSpaceShip>
+    
     
   </Scene>
Index: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	(revision 11433)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	(revision 11435)
@@ -18,16 +18,9 @@
 	
 
-	//DialogueManager* DialogueManager::singletonPtr_s =nullptr;
-
-	DialogueManager::DialogueManager(){
-		orxout() << "Dialog Konstruktor" << endl;
-		//RegisterObject(DialogueManager);
-		
-	}
+	
+	DialogueManager::DialogueManager(){}
 	
 
-	/**
-     * @brief set the config values in the orxonox.ini file
-     */
+	
     
 
@@ -35,7 +28,5 @@
 		if(allQuestions.size()==0) {
 			orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
-		} else  {
-			currentQuestion = allQuestions[0];
-		}
+		} 
 		allQuestions.push_back(nq);
 			orxout(internal_info) << "qsize " << allQuestions.size();
@@ -53,11 +44,9 @@
 
 	std::string DialogueManager::getquestion(void){
-		orxout() << question << endl;
 		return question;
 	}
+
 	void DialogueManager::setanswers1(std::string a1){
-		orxout() << "setanswers1" << endl;
 		this->a1=a1;
-		orxout() << "A1 is " << a1;
 				}
 
@@ -69,5 +58,4 @@
 
 	std::string DialogueManager::getanswers1(void){
-		orxout() << "getanswers1" << endl;
 		return a1;
 	}
@@ -76,6 +64,6 @@
 		return a2;
 	}
+
 	void DialogueManager::a1clicked(void){
-		
 		
 		currentQuestion = currentQuestion->possibleQuestions[0];
@@ -85,46 +73,20 @@
 	}
 	void DialogueManager::a2clicked(void){
-		orxout() << "a2 clicked" << endl;
-
+		
 		currentQuestion = currentQuestion->possibleQuestions[1];
 		update(currentQuestion);
+	}
 
-		
-	}
 	 void DialogueManager::update(NextQuestion* nq){
 	 	this->setquestion(nq->getquestion());
 	 	this->setanswers1(nq->getanswers1());
 	 	this->setanswers2(nq->getanswers2());
-	 	depth=depth+1;
-	 	
-	 	
 	 }
-	void DialogueManager::clean(){
-		orxout() <<" depth " << depth << endl;
-		//allQuestions.at(2*depth+1);
-	}
+
 	bool DialogueManager::theEnd(){
 	if((currentQuestion->possibleQuestions).empty()) {
-		orxout() << "endtrue" << endl;
 		return true;}
 	else return false;
 	}
 
-	
-
-	/*
-	
-	
-	
-
-	
-	vector<std::string> DialogueManager::getanswers(void){
-		return options;
-	}
-
-	int DialogueManager::getnumOptions(){
-		return options.size();
-	}
-
-	*/
 }
Index: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	(revision 11433)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	(revision 11435)
@@ -12,5 +12,4 @@
 #include <string>
 #include <vector>
-//#include "OrxonoxPrereqs.h"
 #include "core/config/Configurable.h"
 #include "core/XMLPort.h"
@@ -32,5 +31,4 @@
 		public:
 		
-
 		DialogueManager(); 
 		
@@ -38,26 +36,36 @@
 		static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } //tolua_export
 		
+
 		void setquestion(std::string question); //tolua_export
 		std::string getquestion(void); //tolua_export
 		
-		void registerquestion(NextQuestion* nq);
+		
 		void setanswers1(std::string a1); //tolua_export
+		std::string getanswers1(void); //tolua_export
+		
 		void setanswers2(std::string a2); //tolua_export
-		std::string getanswers1(void); //tolua_export
 		std::string getanswers2(void); //tolua_export
+		
+		void setCurrentQuestion(NextQuestion* q);
+
+		//Sets the current Question to the question corresponding to the first/second answer  
 		void a1clicked(void); //tolua_export
 		void a2clicked(void); //tolua_export
+		
+		//Checks whether there are any more Questions to come
 		bool theEnd(); //tolua_export 
+
+		//Sets question and a1, a2 for new currentQuestion
 		void update(NextQuestion* nq);
-		void clean(); //tolua_export
-		void setCurrentQuestion(NextQuestion* q);
+
+		//Is executed whenever a NextQuestion is created and pushes all NextQuestion into the allQuestion vector.
+		void registerquestion(NextQuestion* nq);
 
 private:
-	NextQuestion* currentQuestion;
+	NextQuestion* currentQuestion; //The Question which is currently displayed
 	std::vector<NextQuestion*> allQuestions;
-	std::string a1;
-	std::string a2;
+	std::string a1; //answer on first button
+	std::string a2; //answer on second button
 	std::string question;
-	int depth = 0;
 	static DialogueManager* singletonPtr_s;
 
Index: code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc	(revision 11433)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc	(revision 11435)
@@ -17,8 +17,8 @@
     {
         RegisterObject(NextQuestion);
-        orxout() << "Klasse aufgerufen" << endl;
+
         DialogueManager& m = DialogueManager::getInstance();
         m.registerquestion(this);
-       //possibleQuestions=nullptr;
+       
         
     }
@@ -29,5 +29,4 @@
 
 	std::string NextQuestion::getquestion(void){
-		orxout() << question;
 		return question;
 	}
@@ -51,5 +50,5 @@
          }
 	
-	//XML and Event stuff
+	
 	void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -64,15 +63,6 @@
 	bool NextQuestion::execute(bool bTriggered, BaseObject* trigger)
     {  
-        //if(!bTriggered) return false;
-    	
         
-    	
-
-        orxout() << "bTriggered is " << bTriggered << endl;
-
-        //for (DialogueManager* hud : ObjectList<DialogueManager>())
-            //m = hud;
-
-        DialogueManager& m = DialogueManager::getInstance();
+    	DialogueManager& m = DialogueManager::getInstance();
         	
         m.setquestion(question);
@@ -80,5 +70,5 @@
         m.setanswers1(a1);
         m.setanswers2(a2);
-        orxout() << " 1 " << endl;
+       
 
        
@@ -114,15 +104,7 @@
 	}
 
-	std::vector<NextQuestion*> NextQuestion::retposQues(){
-		//if(possibleQuestions.size()==0) return NULL;
 	
-		orxout() << "SIZE" << possibleQuestions.size() << endl;
-		return possibleQuestions;
-	}
 
 
-	/*
-
-	}*/
 
 
Index: code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h	(revision 11433)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h	(revision 11435)
@@ -3,5 +3,5 @@
 
 
-//#include <vector>
+
 #include <string>
 #include "core/class/Identifier.h"
@@ -25,11 +25,4 @@
 		std::string getquestion(void);
 
-
-		bool addposQuestion(NextQuestion* nq);
-		const NextQuestion* getposQuestion(unsigned int index) const;
- 
-		
-		virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
 		void setanswers1(std::string a1);
 		void setanswers2(std::string a2);
@@ -37,13 +30,21 @@
 		std::string getanswers2(void);
 
-		NextQuestion compare();
+		
 		
 
-		//Event
+		//XMLEventPort for Event that first triggers the Dialogue
 		virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+		//XMLPort for setting questions and answers and the vector possibleQuestions
+		virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+		bool addposQuestion(NextQuestion* nq);
+		const NextQuestion* getposQuestion(unsigned int index) const;
+
+		//Sets very first currentQuestion in the DialogueManager when the event is triggered
 		bool execute(bool bTriggered, BaseObject* trigger);
 
 		std::vector<NextQuestion*> possibleQuestions;
-		std::vector<NextQuestion*> retposQues();
+	
 	private:
 		std::string a1;
