Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc @ 11406

Last change on this file since 11406 was 11406, checked in by rrogge, 7 years ago

Dialogfenster geht auf :D

File size: 1.9 KB
Line 
1#include <vector>
2#include <string>
3#include "core/CoreIncludes.h"
4#include "core/GUIManager.h"
5#include "overlays/OrxonoxOverlay.h"
6
7
8#include "NextQuestion.h"
9#include "core/XMLPort.h"
10
11namespace orxonox{
12
13        RegisterClass(NextQuestion);
14
15        NextQuestion::NextQuestion(Context* context) : BaseObject(context)
16    {
17        RegisterObject(NextQuestion);
18        orxout() << "Klasse aufgerufen" << endl;
19         DialogueManager* d = new DialogueManager(context);
20       
21
22    }
23
24        void NextQuestion::setquestion(std::string question){
25                this->question=question;
26        }
27
28        std::string NextQuestion::getquestion(void){
29                orxout() << question;
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
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
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){
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();
85        }*/
86
87}
Note: See TracBrowser for help on using the repository browser.