From 5cbd256e1c9633bee716c7b03156f446e5240110 Mon Sep 17 00:00:00 2001 From: gugus Date: Sat, 28 Jan 2012 16:16:49 +0100 Subject: [PATCH] "full" question support. Now needs to be linked with the dialogue Manager. --- apps/openmw/mwgui/dialogue.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index b94858a7b..87eb3e9cf 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -51,11 +51,18 @@ void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender) const IntPoint& lastPressed = InputManager::getInstance().getLastLeftPressed(); size_t cursorPosition = t->getCursorPosition(lastPressed); - if(history->getColorAtPos(cursorPosition) != "#B29154") + MyGUI::UString color = history->getColorAtPos(cursorPosition); + if(color != "#B29154") { UString key = history->getColorTextAt(cursorPosition); + //std::cout << "Clicked on key: " << key << std::endl; - displayTopicText(key); + if(color == "#686EBA") displayTopicText(key); + if(color == "#572D21") + { + //TODO: send back the answere to the question! + std::cout << "and the ansere is..."<< key; + } } } @@ -154,7 +161,7 @@ void DialogueWindow::askQuestion(std::string question,std::list ans history->addDialogText(parseText(question)); for(std::list::iterator it = answers.begin();it!=answers.end();it++) { - history->addDialogText("#572D21"+(*it)+"#B29154"); + history->addDialogText("#572D21"+(*it)+"#B29154"+" "); } }