From 8ee9c4372efce878e817c49b375a8fd904ea5a43 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 21 Aug 2020 22:56:05 +0200 Subject: draft to fix repeater node. --- cli/main.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'cli/main.cpp') diff --git a/cli/main.cpp b/cli/main.cpp index 004e187..8362cdb 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -171,25 +171,27 @@ void displayMarkdown(QString scalarText, QString resultStr, QJsonArray array, bo QString displaySVG(QString scalarText, QString resultStr, QJsonArray array, bool withColor, QString cmd, QString error, QString warning, QString comment, bool allSameFaceCount, bool allSameColor) { - QString str( - "\n\n"); + QString str("\n\n"); if(!error.isEmpty()) { - str.append( - QStringLiteral("%1").arg(error)); + str.append(QStringLiteral("%1") + .arg(error)); } else { if(!warning.isEmpty()) - str.append( - QStringLiteral("%1") - .arg(warning)); + str.append(QStringLiteral("%1") + .arg(warning)); int y= 20; if(!comment.isEmpty()) { - str.append(QStringLiteral("%1") + str.append(QStringLiteral("%1") .arg(comment) .arg(y)); y+= 20; @@ -198,7 +200,8 @@ QString displaySVG(QString scalarText, QString resultStr, QJsonArray array, bool if(resultStr.isEmpty()) { if(withColor) - str.append(QStringLiteral("%1\n" + str.append(QStringLiteral("%1\n" "details:[%3 (%2)]") .arg(scalarText) .arg(diceList) @@ -286,6 +289,7 @@ int startDiceParsing(QStringList& cmds, QString& treeFile, bool withColor, EXPOR int rt= 0; bool in_markdown= true; + for(QString cmd : cmds) { if(cmd.startsWith('&') && format == BOT) @@ -527,7 +531,8 @@ int main(int argc, char* argv[]) "The output is formatted in json."); QCommandLineOption dotFile(QStringList() << "d" << "dot-file", - "Instead of rolling dice, generate the execution tree and write it in ", + "Instead of rolling dice, generate the execution tree and write it in " + "", "dotfile"); QCommandLineOption translation(QStringList() << "t" << "translation", @@ -599,6 +604,9 @@ int main(int argc, char* argv[]) } QStringList cmdList= optionParser.positionalArguments(); + cmdList.append("repeat(2d6c[<4];1d6;2d6c[<4];\"échecs: $1 [@1], succès $3 [@3], le dé " + "de balance: $2\",5)"); + if(!cmdList.isEmpty()) { if(cmdList[0].startsWith('&')) @@ -606,7 +614,8 @@ int main(int argc, char* argv[]) colorb= false; } } - // cmdList << "8d10;\$1c[>6];\$1c[=1];\$2-\$3i:[>0]{\"%3 Success[%2]\"}{i:[<0]{\"Critical fail %3 [%2]\"}{\"Fail %3 + // cmdList << "8d10;\$1c[>6];\$1c[=1];\$2-\$3i:[>0]{\"%3 + // Success[%2]\"}{i:[<0]{\"Critical fail %3 [%2]\"}{\"Fail %3 // [%2]\"}}"; QJsonArray aliases; if(optionParser.isSet(alias)) -- cgit v1.2.3-70-g09d2