[11393] | 1 | #include <vector> |
---|
| 2 | #include <string> |
---|
[11401] | 3 | #include "core/CoreIncludes.h" |
---|
| 4 | #include "core/GUIManager.h" |
---|
[11406] | 5 | #include "overlays/OrxonoxOverlay.h" |
---|
[11393] | 6 | |
---|
[11401] | 7 | |
---|
[11393] | 8 | #include "NextQuestion.h" |
---|
| 9 | #include "core/XMLPort.h" |
---|
| 10 | |
---|
| 11 | namespace orxonox{ |
---|
| 12 | |
---|
| 13 | RegisterClass(NextQuestion); |
---|
| 14 | |
---|
[11401] | 15 | NextQuestion::NextQuestion(Context* context) : BaseObject(context) |
---|
| 16 | { |
---|
| 17 | RegisterObject(NextQuestion); |
---|
| 18 | orxout() << "Klasse aufgerufen" << endl; |
---|
[11406] | 19 | DialogueManager* d = new DialogueManager(context); |
---|
| 20 | |
---|
[11393] | 21 | |
---|
[11401] | 22 | } |
---|
| 23 | |
---|
| 24 | void NextQuestion::setquestion(std::string question){ |
---|
[11406] | 25 | this->question=question; |
---|
[11401] | 26 | } |
---|
| 27 | |
---|
| 28 | std::string NextQuestion::getquestion(void){ |
---|
[11406] | 29 | orxout() << question; |
---|
[11401] | 30 | return question; |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | // |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | //XML and Event shit |
---|
| 38 | void NextQuestion::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 39 | { |
---|
| 40 | SUPER(NextQuestion, XMLPort, xmlelement, mode); |
---|
| 41 | |
---|
| 42 | XMLPortParam(NextQuestion, "question", setquestion, getquestion, xmlelement, mode); |
---|
| 43 | } |
---|
| 44 | bool NextQuestion::execute(bool bTriggered, BaseObject* trigger) |
---|
| 45 | { |
---|
| 46 | //if(!bTriggered) return false; |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | orxout() << "bTriggered is " << bTriggered << endl; |
---|
| 52 | |
---|
[11406] | 53 | //for (DialogueManager* hud : ObjectList<DialogueManager>()) |
---|
| 54 | //m = hud; |
---|
| 55 | |
---|
| 56 | DialogueManager& m = DialogueManager::getInstance(); |
---|
| 57 | |
---|
| 58 | m.setquestion(question); |
---|
| 59 | orxout() << " 1 " << endl; |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | OrxonoxOverlay::showOverlay("Dialogue"); |
---|
| 63 | |
---|
[11401] | 64 | return false; |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | void NextQuestion::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 68 | { |
---|
| 69 | SUPER(NextQuestion, XMLEventPort, xmlelement, mode); |
---|
| 70 | |
---|
| 71 | XMLPortEventSink(NextQuestion, BaseObject, "execute", execute, xmlelement, mode); |
---|
| 72 | } |
---|
| 73 | /*void NextQuestion::setanswers(std::string option1, std::string option2, std::string option3){ |
---|
[11393] | 74 | options.at(0)=option1; |
---|
| 75 | options.at(1)=option2; |
---|
| 76 | options.at(2)=option3; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | vector<std::string> NextQuestion::getanswers(void){ |
---|
| 80 | return options; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | int NextQuestion::getnumOptions(){ |
---|
| 84 | return options.size(); |
---|
[11401] | 85 | }*/ |
---|
[11393] | 86 | |
---|
| 87 | } |
---|