[Orxonox-commit 6749] r11377 - in code/branches/Dialogue_FS17: data/levels src/modules/dialogue

rrogge at orxonox.net rrogge at orxonox.net
Thu Mar 23 15:51:58 CET 2017


Author: rrogge
Date: 2017-03-23 15:51:57 +0100 (Thu, 23 Mar 2017)
New Revision: 11377

Added:
   code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.layout
   code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.lua
Modified:
   code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
   code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
   code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
Log:
lua und layout1

Modified: code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	2017-03-20 23:20:34 UTC (rev 11376)
+++ code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	2017-03-23 14:51:57 UTC (rev 11377)
@@ -22,12 +22,13 @@
     <Template link=lodtemplate_default />
   </templates>
   <?lua include("includes/notifications.oxi") ?>
+  
 
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
     skybox       = "Orxonox/Starbox"
   >
-  <DialogueManager question="Wazzup?" option1="Nothing" option2="Dunno" option3="Do you like fish?">
+  <DialogueManager question="Wazzup">
   </DialogueManager>
     <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 />

Added: code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.layout
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.layout	                        (rev 0)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.layout	2017-03-23 14:51:57 UTC (rev 11377)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="orxonox/PickupInventory/Background" > 
+    	<Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="MenuWidgets/StaticText" Name="orxonox/PickupInventory/PickupInventory" >
+            <Property Name="Text" Value="Pickup Inventory" />
+            <Property Name="Alpha" Value="0.8" />
+            <Property Name="InheritsAlpha" Value="False" />
+            <Property Name="HorzFormatting" Value="HorzCentred" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="VertFormatting" Value="TopAligned" />
+            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.15,0},{0.85,0},{0.8,0}}" />
+            <Window Type="MenuWidgets/StaticText" Name="orxonox/PickupInventory/Wrapper" >
+                <Property Name="TextColours" Value="FF4444FF" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="HorzFormatting" Value="HorzCentred" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
\ No newline at end of file

Added: code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.lua
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.lua	                        (rev 0)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/Dialogue.lua	2017-03-23 14:51:57 UTC (rev 11377)
@@ -0,0 +1,31 @@
+local P = createMenuSheet("Dialogue Window")
+
+function P.onLoad()
+	P.createWindow()    
+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]]

Modified: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	2017-03-20 23:20:34 UTC (rev 11376)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	2017-03-23 14:51:57 UTC (rev 11377)
@@ -10,18 +10,42 @@
 namespace orxonox {
 RegisterClass(DialogueManager);
 
-	DialogueManager::DialogueManager(){
+	DialogueManager::DialogueManager(): OrxonoxOverlay(context){
 		RegisterObject(DialogueManager);
+
 	}
+	~DialogueManager(){}
 
-	std::string[] setquestion(std::string question){
-		return question;
+	std::string setnpc(std::string npc){
+		return npc;
 	}
 
-	std::string[] setanswers(std::string option1, std::string option2, std::string option3){
+	void setquestion(std::string question){
+		this->question=question;
+	}
+
+	std::string getquestion(void){
+		return this->question;
+	}
+
+	void setanswers(std::string option1, std::string option2, std::string option3){
 		option[0]=option1;
 		option[1]=option2;
 		option[2]=option3;
-		return options;
 	}
+
+	std::string[] getanswers(void){
+		return option[];
+	}
+
+	int getnumOptions(options){
+		return options.length();
+	}
+
+	void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DialogueManager, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode);
+    }
 }
\ No newline at end of file

Modified: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	2017-03-20 23:20:34 UTC (rev 11376)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	2017-03-23 14:51:57 UTC (rev 11377)
@@ -10,12 +10,22 @@
 	class DialogueManager {
 		DialogueManager::DialogueManager();
 		~DialogueManager();
+		virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
 		public:
-			std::string[] setquestion(std::string question);
-			std::string[] setanswers(std::string option1, std::string option2, std::string option3);
+			void setquestion(std::string question);
+			std::string getquestion(void);
+			std::string setnpc(std::string npc);
+			void setanswers(std::string option1, std::string option2, std::string option3);
+			std::string[] getanswers(void);
+			int getnumOptions(options);
+			
+
 			std::string question;
+			std::string npc;
 			std::string[] options;
 
 
+
 	};	
 }



More information about the Orxonox-commit mailing list