diff options
Diffstat (limited to 'node/helpnode.cpp')
| -rw-r--r-- | node/helpnode.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/node/helpnode.cpp b/node/helpnode.cpp index a11c2b3..a46d29a 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -2,21 +2,35 @@ HelpNode::HelpNode() { + m_result = new StringResult(); } void HelpNode::run(ExecutionNode* previous) { + StringResult* txtResult = dynamic_cast<StringResult*>(m_result); + + qDebug() << m_result->hasResultOfType(Result::SCALAR) << m_result->hasResultOfType(Result::STRING); if(NULL != previous) { + if(previous->getResult() == NULL) + { + txtResult->setText(toString()); + } + else + { + txtResult->setText(previous->getHelp()); + } + m_result->setPrevious(previous->getResult()); } - else - { + if(NULL!=m_nextNode) + { + m_nextNode->run(this); } } QString HelpNode::toString()const { - return QObject::tr("see full documentation at: <a href=\"https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md\">https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md</a>"); + return QObject::tr("Rolisteam Dice Parser: Full documentation at: https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md"); } qint64 HelpNode::getPriority() const |