Improved descriptions in log entries
This commit is contained in:
@@ -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
|
||||
),
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -27,6 +27,10 @@ let LogContentSchema = new SimpleSchema({
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
context: {
|
||||
type: Object,
|
||||
optional: true,
|
||||
|
||||
Reference in New Issue
Block a user