From dcdc81cb8e2ce41beab6042f8b5044773f5229d0 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 20 Mar 2020 18:54:27 +0100 Subject: Show explode value in @ place holder. --- diceparser.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'diceparser.cpp') diff --git a/diceparser.cpp b/diceparser.cpp index e78700b..aeb367e 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -212,6 +212,7 @@ void DiceParser::getDiceResultFromAllInstruction(QList& resu ExecutionNode* next= ParsingToolBox::getLeafNode(start); Result* result= next->getResult(); ExportedDiceResult nodeResult; + QSet alreadyAdded; while(nullptr != result) { if(result->hasResultOfType(Dice::RESULT_TYPE::DICE_LIST)) @@ -223,12 +224,19 @@ void DiceParser::getDiceResultFromAllInstruction(QList& resu for(auto& die : diceResult->getResultList()) { faces= die->getFaces(); - // qDebug() << "face" << faces; + // qDebug() << "face" << faces << die->getValue() << + // die->getListValue() + // << next->toString(true); HighLightDice hlDice(die->getListValue(), die->isHighlighted(), die->getColor(), die->hasBeenDisplayed(), die->getFaces()); - list.append(hlDice); + if(!alreadyAdded.contains(die->getUuid())) + { + list.append(hlDice); + alreadyAdded.insert(die->getUuid()); + } } - nodeResult.insert(faces, list); + if(!list.isEmpty()) + nodeResult.insert(faces, list); } result= result->getPrevious(); } -- cgit v1.2.3-70-g09d2