Index: code/branches/Dialog_HS17/data/gui/layouts/Dialog.layout
===================================================================
--- code/branches/Dialog_HS17/data/gui/layouts/Dialog.layout	(revision 11642)
+++ code/branches/Dialog_HS17/data/gui/layouts/Dialog.layout	(revision 11644)
@@ -31,16 +31,10 @@
             </Window>
 
-            <Window Type="MenuWidgets/StaticText" Name="orxonox/DialogAns" >
-                <Property Name="InheritsAlpha" Value="False" />
-                <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Window Type="MenuWidgets/Listbox" Name="orxonox/AnsListbox" >
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.604166,0},{0.15,0},{0.958333,0},{0.636,0}}" />
-                <Window Type="MenuWidgets/Listbox" Name="orxonox/AnsListbox" >
-                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.225,0},{0.95,0},{0.92,0}}" />
-                    <Event Name="ItemSelectionChanged" Function="Dialog.answer_changed" />
-                </Window>
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.225,0},{0.95,0},{0.85,0}}" />
+                <Event Name="ItemSelectionChanged" Function="Dialog.answer_changed" />
             </Window>
+        
             <Window Type="MenuWidgets/Button" Name="orxonox/SayButton" >
                 <Property Name="Text" Value="Say" />
Index: code/branches/Dialog_HS17/data/gui/scripts/Dialog.lua
===================================================================
--- code/branches/Dialog_HS17/data/gui/scripts/Dialog.lua	(revision 11642)
+++ code/branches/Dialog_HS17/data/gui/scripts/Dialog.lua	(revision 11644)
@@ -6,16 +6,11 @@
 P.detailsWindows = {}
 P.showing = false
+P.choice = 0
 
--- Design parameters
-P.imageHeight = 50
-P.detailImageSize = 100
-P.textHeight = 50
-P.buttonWidth = 50
-
-function P.onLoad()
+function P.onLoad() --wird ausgefuert wenn Fenster geladen
     P.wrapper = nil
 end
 
-function P.onShow()
+function P.onShow() --wird ausgefuert wenn Dialogfenster gezeigt
 
     orxonox.CommandExecutor:execute("setTimeFactor 0")
@@ -25,5 +20,5 @@
 end
 
-function P.onHide()
+function P.onHide() --aufgefuert wenn Fenster geschlossen wird
     orxonox.CommandExecutor:execute("setTimeFactor 1")
     P.showing = false
@@ -31,5 +26,5 @@
 end
 
-function P.createDialog()
+function P.createDialog() -- initiallisiert das Dialog Fenster, setzt Namen sowie die erste Frage mit enstprechenden Antworten
 
     local manager = orxonox.DialogManager:getInstance()
@@ -44,21 +39,15 @@
     questionfiled:setText(question)
 
-    listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
+    local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
+    CEGUI.toListbox(listboxwindow):resetList()
 
-    local themeList = {}
-    --[[
-    table.insert(themeList, "Default")
-    table.insert(themeList, "Drum n' Bass")
-    table.insert(themeList, "8-Bit Style")
-    table.insert(themeList, "Corny Jazz")
-    table.insert(themeList, "Metal")
-    --]]
+    local ansList = {}
     local anssize = manager:getSize()
 
     for index = 0, anssize -1, 1 do
-        table.insert(themeList, manager:getAnswer(index))
+        table.insert(ansList, manager:getAnswer(index))
     end  
 
-    for k,v in pairs(themeList) do
+    for k,v in pairs(ansList) do
         item = CEGUI.createListboxTextItem(v)
         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
@@ -67,20 +56,44 @@
 end
 
-function P.updateDialog()
+function P.updateDialog()   --updated den Dialog entsprechend der Ausgeaehlten option der letzten Frage, setzt Frage und Antwortmoeglichkeiten neu
     local manager = orxonox.DialogManager:getInstance()
-    --manager:update()
+    manager:update(P.choice)
 
     local questionfiled = winMgr:getWindow("orxonox/Dialog/Question")
     local question = manager:getQuestion()
     questionfiled:setText(question)
+
+    local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
+    listboxwindow:resetList()
+
+    local ansList = {}
+    local anssize = manager:getSize()
+
+    for index = 0, anssize -1, 1 do
+        table.insert(ansList, manager:getAnswer(index))
+    end  
+
+    for k,v in pairs(ansList) do
+        item = CEGUI.createListboxTextItem(v)
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+        CEGUI.toListbox(listboxwindow):addItem(item)
+    end
+
+    P.choice = 0
 end
 
-function P.answer_changed(e)
-    -- body
+function P.answer_changed(e)    --wird aufgerufen falls Auswahl geaendert wird und setzt enstprechenden Indexparameter  
+    listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
+    selection = listboxwindow:getFirstSelectedItem()
+    if selection ~= nil then
+    P.choice = listboxwindow:getItemIndex(selection)
+    else 
+        P.choice = 0
+    end
 end
 
 
-function P.cleanup(destroyDetails)
-    
+function P.cleanup(destroyDetails)  --loest Fenster wieder auf (!nicht selbst geschrieben, nur uebernommen, eventuell nicht noetiger code)
+
     if P.wrapper ~= nil then
         winMgr:destroyWindow(P.wrapper)
@@ -101,12 +114,9 @@
 
 
-function P.Button_clicked(e)
-    local ending = orxonox.DialogManager:getInstance():endtest()
-    orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog")
+function P.Button_clicked(e)    --wird bei click auf say knopf ausgeloest, entscheidet ob Dialog schliesst oder updated und fuert entsprechen aus
+    local ending = orxonox.DialogManager:getInstance():endtest(P.choice)
     
     if ending then
         orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog")
-    
-    
     else 
         P.updateDialog(index)
Index: code/branches/Dialog_HS17/data/levels/DialogueShowcase2.oxw
===================================================================
--- code/branches/Dialog_HS17/data/levels/DialogueShowcase2.oxw	(revision 11642)
+++ code/branches/Dialog_HS17/data/levels/DialogueShowcase2.oxw	(revision 11644)
@@ -1,4 +1,4 @@
 <LevelInfo
- name = "DialogueShowcase2"
+ name = "DialogShowase"
  description = "A level to show and test the functionality of the Dialogue module."
  tags = "test"
@@ -32,10 +32,23 @@
     <Backlight position="100,0,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
     
-    <Dialog name="Kurt" currentQuestionId="loop">
+    <Dialog name="Kurt" currentQuestionId="loop1">
       <questions>
-        <Question question="Soll ich dich loopen?" Id="loop">
+        <Question question="Soll ich dich einmal loopen?" Id="loop1">
           <answerIds>
             <AnswerId Id="ja"/>
             <AnswerId Id="nein"/>
+            <AnswerId Id="giveItToMe"/>
+          </answerIds>
+        </Question>
+        <Question question="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." Id="lorem">
+          <answerIds>
+            <AnswerId Id="end"/>
+          </answerIds>
+        </Question>
+        <Question question="Soll ich dich nochmal loopen?" Id="loop2">
+          <answerIds>
+            <AnswerId Id="ja"/>
+            <AnswerId Id="nein"/>
+            <AnswerId Id="end"/>
           </answerIds>
         </Question>
@@ -43,6 +56,8 @@
       </questions>
       <answers>
-        <Answer Id="ja" answer="ja loop mich" nextQuestionId="loop"/>
+        <Answer Id="giveItToMe" answer="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." nextQuestionId="lorem"/>
+        <Answer Id="ja" answer="ja loop mich" nextQuestionId="loop2"/>
         <Answer Id="nein" answer="lieber nicht" nextQuestionId="ok"/>
+        <Answer Id="end" answer="ich geh dann mal" nextQuestionId=""/>
       </answers>
       <events>
@@ -52,27 +67,5 @@
       </events>
     </Dialog>
-
-    <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 />
