aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-03-23 11:28:40 +0100
committerRenaud G <renaud@rolisteam.org>2019-03-23 11:28:40 +0100
commitf42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd (patch)
tree976130b3dfbc8878521cb15fc1c1141906667a79 /cli
parent10d0da1c22c94b5361c0a6c76e008c328671ad81 (diff)
downloadOneRoll-f42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd.tar.gz
OneRoll-f42d6ce2ffe9e53e2ac1723e14e8797dc7b2fffd.zip
Use new way to replace pattern in string result.
Diffstat (limited to 'cli')
-rw-r--r--cli/main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/main.cpp b/cli/main.cpp
index e261d63..2f0d8e4 100644
--- a/cli/main.cpp
+++ b/cli/main.cpp
@@ -352,18 +352,20 @@ int startDiceParsing(QStringList& cmds, QString& treeFile, bool withColor, EXPOR
bool ok;
QStringList allStringlist= parser.getAllStringResult(ok);
QString stringResult= allStringlist.join(" ; ");
+
stringResult.replace("%1", scalarText);
stringResult.replace("%2", listOfDiceResult.join(",").trimmed());
stringResult.replace("%3", lastScalarText);
stringResult.replace("\\n", "\n");
- int i= strLst.size();
- for(auto it= strLst.rbegin(); it != strLst.rend(); ++it)
+ stringResult= ParsingToolBox::replaceVariableToValue(stringResult, strLst);
+ /*for(auto it= strLst.rbegin(); it != strLst.rend(); ++it)
{
stringResult.replace(QStringLiteral("$%1").arg(i), (*it));
--i;
- }
- i= listFull.size();
+ }*/
+
+ int i= strLst.size();
for(auto it= strLst.rbegin(); it != strLst.rend(); ++it)
{
stringResult.replace(QStringLiteral("µ%1").arg(i), (*it));