Improved descriptions in log entries

This commit is contained in:
Stefan Zermatten
2021-02-11 16:16:22 +02:00
parent 92a5c1e6c3
commit 16c8c1db81
4 changed files with 15 additions and 6 deletions

View File

@@ -9,14 +9,14 @@ export default function applyAction({prop, log}){
}
if (prop.summary){
log.content.push({
details: embedInlineCalculations(
description: embedInlineCalculations(
prop.summary, prop.summaryCalculations
),
});
}
if (prop.description){
log.content.push({
details: embedInlineCalculations(
description: embedInlineCalculations(
prop.description, prop.descriptionCalculations
),
});

View File

@@ -160,7 +160,7 @@ const logRoll = new ValidatedMethod({
let compiled = parsedResult.compile(creature.variables, rollContext);
let compiledString = compiled.toString();
if (!equalIgnoringWhitespace(compiledString, roll)) logContent.push({
result: roll
details: roll
});
logContent.push({
details: compiledString
@@ -168,7 +168,7 @@ const logRoll = new ValidatedMethod({
let rolled = compiled.roll(creature.variables, rollContext);
let rolledString = rolled.toString();
if (rolledString !== compiledString) logContent.push({
details: rolled.toString()
result: rolled.toString()
});
let result = rolled.reduce(creature.variables, rollContext);
let resultString = result.toString();

View File

@@ -27,6 +27,10 @@ let LogContentSchema = new SimpleSchema({
type: String,
optional: true,
},
description: {
type: String,
optional: true,
},
context: {
type: Object,
optional: true,