Changeset 11401 for code/branches
- Timestamp:
- Apr 13, 2017, 3:47:48 PM (8 years ago)
- Location:
- code/branches/Dialogue_FS17
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialogue_FS17/data/levels/events.oxw
r11394 r11401 58 58 59 59 <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true"/> 60 <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0, 0"/>61 < DialogueManagerquestion="Hello World3">60 <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/> 61 <NextQuestion question="Hello World3"> 62 62 <events> 63 63 <execute> … … 65 65 </execute> 66 66 </events> 67 </ DialogueManager>67 </NextQuestion> 68 68 69 69 <!-- red --> -
code/branches/Dialogue_FS17/data/overlays/HUDTemplates3.oxo
r11354 r11401 214 214 /> 215 215 216 </OverlayGroup> 217 </Template> 216 <GUIOverlay 217 name = "Dialogue" 218 guiname = "Dialogue" 219 visible = "false" 220 /> 221 222 </OverlayGroup> 223 </Template> -
code/branches/Dialogue_FS17/src/modules/dialogue/CMakeLists.txt
r11382 r11401 1 1 SET_SOURCE_FILES(DIALOGUE_SRC_FILES 2 2 DialogueManager.cc 3 NextQuestion.cc 3 4 4 5 ) -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
r11394 r11401 41 41 return question; 42 42 } 43 void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)43 /*void DialogueManager::XMLPort(Element& xmlelement, XMLPort::Mode mode) 44 44 { 45 45 SUPER(DialogueManager, XMLPort, xmlelement, mode); 46 46 47 47 XMLPortParam(DialogueManager, "question", setquestion, getquestion, xmlelement, mode); 48 } 48 }*/ 49 49 50 bool DialogueManager::execute(bool bTriggered, BaseObject* trigger) 51 { 52 //if(!bTriggered) return false; 53 54 55 56 orxout() << "bTriggered is " << bTriggered; 57 //orxout() << " 1 " << mystring << endl; 58 return false; 59 } 60 61 void DialogueManager::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 62 { 63 SUPER(DialogueManager, XMLEventPort, xmlelement, mode); 64 65 XMLPortEventSink(DialogueManager, BaseObject, "execute", execute, xmlelement, mode); 66 } 50 67 51 68 52 /*std::string DialogueManager::setnpc(std::string npc){ -
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
r11393 r11401 6 6 #include "network/Host.h" 7 7 #include "network/NetworkFunctionIncludes.h" 8 #include "DialoguePrereqs.h"9 8 #include "util/Singleton.h" 10 9 #include <string> … … 24 23 //tolua_begin 25 24 public: 25 26 26 27 27 DialogueManager(Context* context); // tolua_export … … 30 30 static DialogueManager& getInstance() { return Singleton<DialogueManager>::getInstance(); } 31 31 32 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);33 34 32 void setquestion(std::string question); 35 33 std::string getquestion(void); 34 36 35 37 38 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 39 bool execute(bool bTriggered, BaseObject* trigger); 40 36 41 37 42 38 -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
r11393 r11401 1 1 #include <vector> 2 2 #include <string> 3 #include "core/CoreIncludes.h" 4 #include "core/GUIManager.h" 5 3 6 4 7 #include "NextQuestion.h" … … 9 12 RegisterClass(NextQuestion); 10 13 11 vector<NextQuestion> nextquestion; 14 NextQuestion::NextQuestion(Context* context) : BaseObject(context) 15 { 16 RegisterObject(NextQuestion); 17 orxout() << "Klasse aufgerufen" << endl; 12 18 13 void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){ 19 } 20 21 void NextQuestion::setquestion(std::string question){ 22 question=question; 23 } 24 25 std::string NextQuestion::getquestion(void){ 26 return question; 27 } 28 29 30 // 31 32 33 //XML and Event shit 34 void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode) 35 { 36 SUPER(NextQuestion, XMLPort, xmlelement, mode); 37 38 XMLPortParam(NextQuestion, "question", setquestion, getquestion, xmlelement, mode); 39 } 40 bool NextQuestion::execute(bool bTriggered, BaseObject* trigger) 41 { 42 //if(!bTriggered) return false; 43 44 45 46 47 orxout() << "bTriggered is " << bTriggered << endl; 48 49 for (DialogueManager* hud : ObjectList<DialogueManager>()) 50 m = hud; 51 m->setquestion(question); 52 //orxout() << " 1 " << mystring << endl; 53 return false; 54 } 55 56 void NextQuestion::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 57 { 58 SUPER(NextQuestion, XMLEventPort, xmlelement, mode); 59 60 XMLPortEventSink(NextQuestion, BaseObject, "execute", execute, xmlelement, mode); 61 } 62 /*void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){ 14 63 options.at(0)=option1; 15 64 options.at(1)=option2; … … 23 72 int NextQuestion::getnumOptions(){ 24 73 return options.size(); 25 } 74 }*/ 26 75 27 76 } -
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
r11393 r11401 1 1 #include <vector> 2 2 #include <string> 3 #include "core/class/Identifier.h" 4 #include "OrxonoxPrereqs.h" 5 #include "core/XMLPort.h" 6 #include "core/EventIncludes.h" 7 #include "DialogueManager.h" 3 8 4 #include "core/XMLPort.h" 9 5 10 6 11 namespace orxonox{ 7 void setanswers(std::string option1, std::string option2, std::string option3); 8 std::vector <std::string> getanswers(void); 12 class _OrxonoxExport NextQuestion : public BaseObject 13 { 14 15 //tolua_begin 16 public: 9 17 10 int getnumOptions(); 11 std::vector<std::string> options; 18 NextQuestion (Context* context); // tolua_export 19 20 21 void setquestion(std::string question); 22 std::string getquestion(void); 23 24 25 26 27 28 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 29 30 /*void setanswers(std::string option1, std::string option2, std::string option3); 31 std::vector <std::string> getanswers(void); 32 33 int getnumOptions(); 34 std::vector<std::string> options;*/ 35 36 //Event 37 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 38 bool execute(bool bTriggered, BaseObject* trigger); 39 40 41 private: 42 std::string question; 43 DialogueManager* m; 44 45 }; 46 12 47 }
Note: See TracChangeset
for help on using the changeset viewer.