[Orxonox-commit 6805] r11432 - in code/branches/Dialogue_FS17: data/gui/scripts data/levels src/modules/dialogue
rrogge at orxonox.net
rrogge at orxonox.net
Thu May 18 17:05:54 CEST 2017
Author: rrogge
Date: 2017-05-18 17:05:53 +0200 (Thu, 18 May 2017)
New Revision: 11432
Modified:
code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua
code/branches/Dialogue_FS17/data/levels/events.oxw
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
Log:
Reload works now
Modified: code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua
===================================================================
--- code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua 2017-05-18 15:05:53 UTC (rev 11432)
@@ -127,6 +127,7 @@
function P.cleanup(destroyDetails)
+
if P.wrapper ~= nil then
winMgr:destroyWindow(P.wrapper)
end
@@ -140,6 +141,7 @@
P.destroyDetailWindow(k)
end
end
+ orxonox.DialogueManager:getInstance():clean()
end
Modified: code/branches/Dialogue_FS17/data/levels/events.oxw
===================================================================
--- code/branches/Dialogue_FS17/data/levels/events.oxw 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/data/levels/events.oxw 2017-05-18 15:05:53 UTC (rev 11432)
@@ -62,7 +62,12 @@
<NextQuestion question="Continue?" a1="yes" a2="no" >
<possibleQuestions>
<NextQuestion question="Are you sure?" a1="yep let me continue" a2="no actually not" />
- <NextQuestion question="Why?" a1="Got a dentist's appointment" a2="this sucks" />
+ <NextQuestion question="Why?" a1="Got a dentist's appointment" a2="this sucks" >
+ <possibleQuestions>
+ <NextQuestion question="Are your teeth that bad mate?" a1="yep" a2="leave me alone godammit" />
+ <NextQuestion question="You suck" a1="..." a2="Im going now okay" />
+ </possibleQuestions>
+ </NextQuestion>
</possibleQuestions>
<events>
<execute>
Modified: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc 2017-05-18 15:05:53 UTC (rev 11432)
@@ -46,6 +46,10 @@
question=q;
}
+ void DialogueManager::setCurrentQuestion(NextQuestion* nq){
+ currentQuestion=nq;
+
+ }
std::string DialogueManager::getquestion(void){
orxout() << question << endl;
@@ -91,8 +95,14 @@
this->setquestion(nq->getquestion());
this->setanswers1(nq->getanswers1());
this->setanswers2(nq->getanswers2());
+ depth=depth+1;
+
+
}
-
+ void DialogueManager::clean(){
+ orxout() <<" depth " << depth << endl;
+ //allQuestions.at(2*depth+1);
+ }
bool DialogueManager::theEnd(){
if((currentQuestion->possibleQuestions).empty()) {
orxout() << "endtrue" << endl;
Modified: code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.h 2017-05-18 15:05:53 UTC (rev 11432)
@@ -49,6 +49,8 @@
void a2clicked(void); //tolua_export
bool theEnd(); //tolua_export
void update(NextQuestion* nq);
+ void clean(); //tolua_export
+ void setCurrentQuestion(NextQuestion* q);
private:
NextQuestion* currentQuestion;
@@ -56,6 +58,7 @@
std::string a1;
std::string a2;
std::string question;
+ int depth = 0;
static DialogueManager* singletonPtr_s;
};//tolua_export
Modified: code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.cc 2017-05-18 15:05:53 UTC (rev 11432)
@@ -76,6 +76,7 @@
DialogueManager& m = DialogueManager::getInstance();
m.setquestion(question);
+ m.setCurrentQuestion(this);
m.setanswers1(a1);
m.setanswers2(a2);
orxout() << " 1 " << endl;
Modified: code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h 2017-05-18 14:32:13 UTC (rev 11431)
+++ code/branches/Dialogue_FS17/src/modules/dialogue/NextQuestion.h 2017-05-18 15:05:53 UTC (rev 11432)
@@ -48,7 +48,7 @@
private:
std::string a1;
std::string a2;
-
+
std::string question;
More information about the Orxonox-commit
mailing list