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,
|
||||
|
||||
@@ -30,10 +30,13 @@
|
||||
v-if="content.result"
|
||||
class="subheading font-weight-bold mx-1"
|
||||
>{{ content.result }}</span>
|
||||
<markdown-text
|
||||
<span
|
||||
v-if="content.details"
|
||||
>{{ content.details }}</span>
|
||||
<markdown-text
|
||||
v-if="content.description"
|
||||
class="details"
|
||||
:markdown="content.details"
|
||||
:markdown="content.description"
|
||||
/>
|
||||
</div>
|
||||
</v-card-text>
|
||||
@@ -59,6 +62,8 @@ export default {
|
||||
<style lang="css" scoped>
|
||||
.content-line {
|
||||
min-height: 24px;
|
||||
margin-top: 2px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.content-line .details {
|
||||
display: inline-block;
|
||||
|
||||
Reference in New Issue
Block a user