diff options
| author | 2020-03-20 18:54:27 +0100 | |
|---|---|---|
| committer | 2020-03-28 02:05:05 +0100 | |
| commit | dcdc81cb8e2ce41beab6042f8b5044773f5229d0 (patch) | |
| tree | e0209d6ce1d3601a73221ed01a0c9898c5d694fa /diceparser.cpp | |
| parent | 653ba9395a36cc20ec1d68c9a9cae78973fa334c (diff) | |
| download | OneRoll-dcdc81cb8e2ce41beab6042f8b5044773f5229d0.tar.gz OneRoll-dcdc81cb8e2ce41beab6042f8b5044773f5229d0.zip | |
Show explode value in @ place holder.
Diffstat (limited to 'diceparser.cpp')
| -rw-r--r-- | diceparser.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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<ExportedDiceResult>& resu ExecutionNode* next= ParsingToolBox::getLeafNode(start); Result* result= next->getResult(); ExportedDiceResult nodeResult; + QSet<QString> alreadyAdded; while(nullptr != result) { if(result->hasResultOfType(Dice::RESULT_TYPE::DICE_LIST)) @@ -223,12 +224,19 @@ void DiceParser::getDiceResultFromAllInstruction(QList<ExportedDiceResult>& 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(); } |