[Orxonox-commit 6743] r11371 - in code/branches/Dialogue_FS17: data/gui/scripts data/levels src/modules src/modules/dialogue

rrogge at orxonox.net rrogge at orxonox.net
Thu Mar 16 16:07:48 CET 2017


Author: rrogge
Date: 2017-03-16 16:07:47 +0100 (Thu, 16 Mar 2017)
New Revision: 11371

Added:
   code/branches/Dialogue_FS17/data/gui/scripts/TestDialogButttons.lua
   code/branches/Dialogue_FS17/src/modules/dialogue/
   code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
   code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
Modified:
   code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
Log:
h und cc file

Added: code/branches/Dialogue_FS17/data/gui/scripts/TestDialogButttons.lua
===================================================================
--- code/branches/Dialogue_FS17/data/gui/scripts/TestDialogButttons.lua	                        (rev 0)
+++ code/branches/Dialogue_FS17/data/gui/scripts/TestDialogButttons.lua	2017-03-16 15:07:47 UTC (rev 11371)
@@ -0,0 +1,30 @@
+local P = createMenuSheet("dialogue")
+
+function P.onLoad()
+    --buttons are arranged in a 2x1 Matrix (list)
+    P:setButton(1, 1, {
+            ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
+            ["callback"]  = P.QuickGameTestButton_clicked
+    })
+
+    P:setButton(2, 1, {
+            ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"),
+            ["callback"]  = P.SingleplayerButton_clicked
+    })
+
+end
+
+-- events for options
+function P.QuickGameTestButton_clicked(e)
+    hideAllMenuSheets()
+    orxonox.execute("startGame")
+end
+
+function P.SingleplayerButton_clicked(e)
+    showMenuSheet("SingleplayerMenu", true)
+end
+
+
+
+return P
+

Modified: code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	2017-03-16 15:02:15 UTC (rev 11370)
+++ code/branches/Dialogue_FS17/data/levels/emptyLevel.oxw	2017-03-16 15:07:47 UTC (rev 11371)
@@ -27,7 +27,8 @@
     ambientlight = "0.8, 0.8, 0.8"
     skybox       = "Orxonox/Starbox"
   >
-
+  <DialogueManager question="Wazzup?" option1="Nothing" option2="Dunno" option3="Do you like fish?">
+  </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/DialogueManager.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	                        (rev 0)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc	2017-03-16 15:07:47 UTC (rev 11371)
@@ -0,0 +1,27 @@
+#include "core/CoreIncludes.h"
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
+#include "core/class/Identifier.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "network/Host.h"
+#include "network/NetworkFunctionIncludes.h"
+#include "DialogueManager.h"
+
+namespace orxonox {
+RegisterClass(DialogueManager);
+
+	DialogueManager::DialogueManager(){
+		RegisterObject(DialogueManager);
+	}
+
+	std::string[] setquestion(std::string question){
+		return question;
+	}
+
+	std::string[] setanswers(std::string option1, std::string option2, std::string option3){
+		option[0]=option1;
+		option[1]=option2;
+		option[2]=option3;
+		return options;
+	}
+}
\ No newline at end of file

Added: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	                        (rev 0)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h	2017-03-16 15:07:47 UTC (rev 11371)
@@ -0,0 +1,21 @@
+#include "core/CoreIncludes.h"
+#include "core/LuaState.h"
+#include "core/GUIManager.h"
+#include "core/class/Identifier.h"
+#include "core/singleton/ScopedSingletonIncludes.h"
+#include "network/Host.h"
+#include "network/NetworkFunctionIncludes.h"
+
+namespace orxonox{
+	class DialogueManager {
+		DialogueManager::DialogueManager();
+		~DialogueManager();
+		public:
+			std::string[] setquestion(std::string question);
+			std::string[] setanswers(std::string option1, std::string option2, std::string option3);
+			std::string question;
+			std::string[] options;
+
+
+	};	
+}




More information about the Orxonox-commit mailing list