Changeset 11417
- Timestamp:
- May 11, 2017, 4:15:10 PM (8 years ago)
- Location:
- code/branches/Dialogue_FS17
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua
r11415 r11417 139 139 140 140 function P.a2Button_clicked(e) 141 orxonox. CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")141 orxonox.DialogueManager:getInstance():a2clicked() 142 142 end 143 143 -
code/branches/Dialogue_FS17/data/levels/events.oxw
r11413 r11417 59 59 <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true" /> 60 60 <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/> 61 61 62 <NextQuestion question="Continue?" a1="yes" a2="no" > 62 <!--<possibleQuestions>63 <possibleQuestions> 63 64 <NextQuestion question="Are you sure?" a1="yep let me continue" a2="no actually not" /> 64 65 <NextQuestion question="Why?" a1="Got a dentist's appointment" a2="this sucks" /> 65 </possibleQuestions> -->66 </possibleQuestions> 66 67 <events> 67 68 <execute> -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
r11415 r11417 6 6 #include "network/Host.h" 7 7 #include "network/NetworkFunctionIncludes.h" 8 #include "Dialogue Prereqs.h"8 #include "DialogueManager.h" 9 9 #include <vector> 10 10 #include <string> 11 11 #include "core/XMLPort.h" 12 12 #include "NextQuestion.h" 13 13 14 14 15 … … 32 33 */ 33 34 35 36 void DialogueManager::registerquestion(NextQuestion* nq){ 37 allQuestions.push_back(nq); 38 39 } 34 40 35 41 void DialogueManager::setquestion(std::string q){ … … 64 70 bool DialogueManager::a1clicked(void){ 65 71 orxout() << "a1 clicked" << endl; 66 72 currentQuestion = currentQuestion->possibleQuestions[0]; 67 73 return true; 68 74 } -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
r11415 r11417 1 #ifndef _DialogueManager_H__ 2 #define _DialogueManager_H__ 3 1 4 #include "core/CoreIncludes.h" 2 5 #include "core/LuaState.h" … … 9 12 #include <string> 10 13 #include <vector> 11 #include "OrxonoxPrereqs.h"14 //#include "OrxonoxPrereqs.h" 12 15 #include "core/config/Configurable.h" 13 16 #include "core/XMLPort.h" 14 17 #include "core/EventIncludes.h" 15 18 #include "DialoguePrereqs.h" 19 #include "NextQuestion.h" 16 20 17 21 … … 37 41 std::string getquestion(void); //tolua_export 38 42 39 43 void registerquestion(NextQuestion* nq); 40 44 void setanswers1(std::string a1); //tolua_export 41 45 void setanswers2(std::string a2); //tolua_export … … 58 62 */ 59 63 private: 60 //NextQuestion currentQuestion; 64 NextQuestion* currentQuestion; 65 std::vector<NextQuestion*> allQuestions; 61 66 std::string a1; 62 67 std::string a2; … … 66 71 };//tolua_export 67 72 }//tolua_export 68 73 #endif -
code/branches/Dialogue_FS17/src/modules/dialogue/DialoguePrereqs.h
r11382 r11417 70 70 71 71 class DialogueManager; 72 class NextQuestion; 72 73 73 74 } -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
r11415 r11417 8 8 #include "NextQuestion.h" 9 9 #include "core/XMLPort.h" 10 #include "DialogueManager.h" 10 11 11 12 namespace orxonox{ … … 17 18 RegisterObject(NextQuestion); 18 19 orxout() << "Klasse aufgerufen" << endl; 20 DialogueManager& m = DialogueManager::getInstance(); 21 m.registerquestion(this); 19 22 20 23 -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
r11413 r11417 1 #ifndef _NextQuestion_H__ 2 #define _NextQuestion_H__ 3 4 1 5 //#include <vector> 2 6 #include <string> … … 5 9 #include "core/XMLPort.h" 6 10 #include "core/EventIncludes.h" 7 #include "DialogueManager.h" 11 #include "DialoguePrereqs.h" 12 8 13 9 14 … … 41 46 bool execute(bool bTriggered, BaseObject* trigger); 42 47 43 48 std::vector<NextQuestion*> possibleQuestions; 44 49 private: 45 50 std::string a1; 46 51 std::string a2; 47 std::vector<NextQuestion*> possibleQuestions;52 48 53 49 54 … … 54 59 55 60 } 61 #endif
Note: See TracChangeset
for help on using the changeset viewer.