Compare commits
11 Commits
2.0-beta.1
...
2.0-beta.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dce2c92516 | ||
|
|
0fe2780983 | ||
|
|
e126cdd3cb | ||
|
|
d69ada0db4 | ||
|
|
858915b25b | ||
|
|
d10a7eca14 | ||
|
|
671d17018c | ||
|
|
f2883d320f | ||
|
|
aad0c7249e | ||
|
|
612fcca68c | ||
|
|
12939c46de |
@@ -62,7 +62,7 @@ function applyPropertyAndWalkChildren({prop, child, targets, ...options}){
|
|||||||
export default function applyProperties({ forest, targets, ...options}){
|
export default function applyProperties({ forest, targets, ...options}){
|
||||||
forest.forEach(child => {
|
forest.forEach(child => {
|
||||||
let prop = child.node;
|
let prop = child.node;
|
||||||
if (shouldSplit(prop)){
|
if (shouldSplit(prop) && targets.length){
|
||||||
targets.forEach(target => {
|
targets.forEach(target => {
|
||||||
let targets = [target]
|
let targets = [target]
|
||||||
applyPropertyAndWalkChildren({ targets, prop, child, ...options});
|
applyPropertyAndWalkChildren({ targets, prop, child, ...options});
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ export default function applySave({
|
|||||||
return !saveSuccess;
|
return !saveSuccess;
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} catch (e){
|
} catch (e){
|
||||||
log.content.push({
|
log.content.push({
|
||||||
|
|||||||
@@ -14,16 +14,22 @@ export default function computeEndStepProperty(prop, memo){
|
|||||||
break;
|
break;
|
||||||
case 'attack':
|
case 'attack':
|
||||||
computeAction(prop, memo);
|
computeAction(prop, memo);
|
||||||
computeAttack(prop, memo);
|
computePropertyField(prop, memo, 'rollBonus');
|
||||||
break;
|
break;
|
||||||
case 'savingThrow':
|
case 'savingThrow':
|
||||||
computeSavingThrow(prop, memo);
|
computePropertyField(prop, memo, 'dc');
|
||||||
break;
|
break;
|
||||||
case 'spellList':
|
case 'spellList':
|
||||||
computeSpellList(prop, memo);
|
computePropertyField(prop, memo, 'maxPrepared');
|
||||||
|
computePropertyField(prop, memo, 'attackRollBonus');
|
||||||
|
computePropertyField(prop, memo, 'dc');
|
||||||
break;
|
break;
|
||||||
case 'propertySlot':
|
case 'propertySlot':
|
||||||
computeSlot(prop, memo);
|
computePropertyField(prop, memo, 'quantityExpected');
|
||||||
|
computePropertyField(prop, memo, 'slotCondition');
|
||||||
|
break;
|
||||||
|
case 'roll':
|
||||||
|
computePropertyField(prop, memo, 'roll', 'compile');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,19 +117,3 @@ function computePropertyField(prop, memo, fieldName, fn){
|
|||||||
delete prop[`${fieldName}Errors`];
|
delete prop[`${fieldName}Errors`];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function computeAttack(prop, memo){
|
|
||||||
computePropertyField(prop, memo, 'rollBonus');
|
|
||||||
}
|
|
||||||
|
|
||||||
function computeSavingThrow(prop, memo){
|
|
||||||
computePropertyField(prop, memo, 'dc');
|
|
||||||
}
|
|
||||||
|
|
||||||
function computeSpellList(prop, memo){
|
|
||||||
computePropertyField(prop, memo, 'maxPrepared');
|
|
||||||
}
|
|
||||||
|
|
||||||
function computeSlot(prop, memo){
|
|
||||||
computePropertyField(prop, memo, 'slotCondition');
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ export default function evaluateCalculation({
|
|||||||
context,
|
context,
|
||||||
dependencies,
|
dependencies,
|
||||||
};
|
};
|
||||||
|
if (typeof string !== 'string'){
|
||||||
|
string = string.toString();
|
||||||
|
}
|
||||||
// Parse the string
|
// Parse the string
|
||||||
let calc;
|
let calc;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -23,10 +23,14 @@ export default function recomputeSlotFullness(ancestorId){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
let spaceLeft;
|
let spaceLeft;
|
||||||
if (slot.quantityExpected === 0){
|
let expected = slot.quantityExpectedResult;
|
||||||
|
if (typeof expected !== 'number'){
|
||||||
|
expected = 1;
|
||||||
|
}
|
||||||
|
if (expected === 0){
|
||||||
spaceLeft = null;
|
spaceLeft = null;
|
||||||
} else {
|
} else {
|
||||||
spaceLeft = slot.quantityExpected - totalFilled;
|
spaceLeft = expected - totalFilled;
|
||||||
}
|
}
|
||||||
if (slot.totalFilled !== totalFilled || slot.spaceLeft !== spaceLeft){
|
if (slot.totalFilled !== totalFilled || slot.spaceLeft !== spaceLeft){
|
||||||
CreatureProperties.update(slot._id, {
|
CreatureProperties.update(slot._id, {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ let SlotSchema = new SimpleSchema({
|
|||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
quantityExpected: {
|
quantityExpected: {
|
||||||
type: SimpleSchema.Integer,
|
type: String,
|
||||||
defaultValue: 1,
|
optional: true,
|
||||||
min: 0,
|
defaultValue: '1',
|
||||||
},
|
},
|
||||||
ignored: {
|
ignored: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|||||||
@@ -23,6 +23,16 @@ let SpellListSchema = new SimpleSchema({
|
|||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
// Calculation of The attack roll bonus used by spell attacks in this list
|
||||||
|
attackRollBonus: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
// Calculation of the save dc used by spells in this list
|
||||||
|
dc: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const ComputedOnlySpellListSchema = new SimpleSchema({
|
const ComputedOnlySpellListSchema = new SimpleSchema({
|
||||||
@@ -33,6 +43,7 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
|||||||
},
|
},
|
||||||
'descriptionCalculations.$': InlineComputationSchema,
|
'descriptionCalculations.$': InlineComputationSchema,
|
||||||
|
|
||||||
|
// maxPrepared
|
||||||
maxPreparedResult: {
|
maxPreparedResult: {
|
||||||
type: Number,
|
type: Number,
|
||||||
optional: true,
|
optional: true,
|
||||||
@@ -44,6 +55,32 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
|||||||
'maxPreparedErrors.$':{
|
'maxPreparedErrors.$':{
|
||||||
type: ErrorSchema,
|
type: ErrorSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// attackRollBonus
|
||||||
|
attackRollBonusResult: {
|
||||||
|
type: Number,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
attackRollBonusErrors: {
|
||||||
|
type: Array,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
'attackRollBonusErrors.$':{
|
||||||
|
type: ErrorSchema,
|
||||||
|
},
|
||||||
|
|
||||||
|
// dc
|
||||||
|
dcResult: {
|
||||||
|
type: Number,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
dcErrors: {
|
||||||
|
type: Array,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
'dcErrors.$':{
|
||||||
|
type: ErrorSchema,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const ComputedSpellListSchema = new SimpleSchema()
|
const ComputedSpellListSchema = new SimpleSchema()
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ export default function sendWebhook({webhookURL, data = {}}){
|
|||||||
|
|
||||||
const hook = new Discord.WebhookClient(id, token);
|
const hook = new Discord.WebhookClient(id, token);
|
||||||
// Send a message using the webhook
|
// Send a message using the webhook
|
||||||
console.log(JSON.stringify(data, null, 2));
|
|
||||||
hook.send(data);
|
hook.send(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<h3 class="layout row align-center">
|
<h3 class="layout row align-center">
|
||||||
{{ slot.name }}
|
{{ slot.name }}
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<span v-if="slot.quantityExpected > 1">
|
<span v-if="slot.quantityExpectedResult > 1">
|
||||||
{{ slot.totalFilled }} / {{ slot.quantityExpected }}
|
{{ slot.totalFilled }} / {{ slot.quantityExpectedResult }}
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
<v-list v-if="slot.children.length">
|
<v-list v-if="slot.children.length">
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</v-list-tile>
|
</v-list-tile>
|
||||||
</v-list>
|
</v-list>
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="!slot.quantityExpected || slot.spaceLeft"
|
v-if="!slot.quantityExpectedResult || slot.spaceLeft"
|
||||||
icon
|
icon
|
||||||
:data-id="`slot-add-button-${slot._id}`"
|
:data-id="`slot-add-button-${slot._id}`"
|
||||||
class="slot-add-button"
|
class="slot-add-button"
|
||||||
|
|||||||
@@ -28,8 +28,6 @@
|
|||||||
/>
|
/>
|
||||||
<text-field
|
<text-field
|
||||||
label="Quantity"
|
label="Quantity"
|
||||||
type="number"
|
|
||||||
min="0"
|
|
||||||
hint="How many matching properties must be used to fill this slot, 0 is unlimited"
|
hint="How many matching properties must be used to fill this slot, 0 is unlimited"
|
||||||
:value="model.quantityExpected"
|
:value="model.quantityExpected"
|
||||||
:error-messages="errors.quantityExpected"
|
:error-messages="errors.quantityExpected"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
@change="change('description', ...arguments)"
|
@change="change('description', ...arguments)"
|
||||||
/>
|
/>
|
||||||
<calculation-error-list :calculations="model.descriptionCalculations" />
|
<calculation-error-list :calculations="model.descriptionCalculations" />
|
||||||
|
|
||||||
<text-field
|
<text-field
|
||||||
label="Maximum prepared spells"
|
label="Maximum prepared spells"
|
||||||
:value="model.maxPrepared"
|
:value="model.maxPrepared"
|
||||||
@@ -35,6 +35,24 @@
|
|||||||
/>
|
/>
|
||||||
<calculation-error-list :errors="model.maxPreparedErrors" />
|
<calculation-error-list :errors="model.maxPreparedErrors" />
|
||||||
|
|
||||||
|
<text-field
|
||||||
|
label="Spell save DC"
|
||||||
|
:value="model.dc"
|
||||||
|
hint="The spell save DC of spells in this list"
|
||||||
|
:error-messages="errors.dc"
|
||||||
|
@change="change('dc', ...arguments)"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.dcErrors" />
|
||||||
|
|
||||||
|
<text-field
|
||||||
|
label="Attack roll bonus"
|
||||||
|
:value="model.attackRollBonus"
|
||||||
|
hint="The attack roll bonus of spell attacks made by spells in this list"
|
||||||
|
:error-messages="errors.attackRollBonus"
|
||||||
|
@change="change('attackRollBonus', ...arguments)"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.attackRollBonusErrors" />
|
||||||
|
|
||||||
<smart-combobox
|
<smart-combobox
|
||||||
label="Tags"
|
label="Tags"
|
||||||
multiple
|
multiple
|
||||||
|
|||||||
@@ -10,7 +10,11 @@
|
|||||||
<div
|
<div
|
||||||
class="text-no-wrap text-truncate"
|
class="text-no-wrap text-truncate"
|
||||||
>
|
>
|
||||||
{{ model.amountResult }} {{ model.stat }} damage
|
<span v-if="model.amountResult < 0">+</span>
|
||||||
|
{{ absoluteAmount }} {{ model.stat }}
|
||||||
|
<span v-if="typeof absoluteAmount === 'string' || absoluteAmount >= 0">
|
||||||
|
damage
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,5 +24,14 @@ import treeNodeViewMixin from '/imports/ui/properties/treeNodeViews/treeNodeView
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [treeNodeViewMixin],
|
mixins: [treeNodeViewMixin],
|
||||||
|
computed: {
|
||||||
|
absoluteAmount(){
|
||||||
|
if (typeof this.model.amountResult === 'number'){
|
||||||
|
return Math.abs(this.model.amountResult);
|
||||||
|
} else {
|
||||||
|
return this.model.amountResult;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,14 +1,81 @@
|
|||||||
<template lang="html">
|
<template lang="html">
|
||||||
<div class="adjustment-viewer layout row align-center">
|
<v-list-tile class="effect-viewer">
|
||||||
{{ model.amountResult }} {{ model.stat }} damage
|
<v-list-tile-avatar>
|
||||||
</div>
|
<v-tooltip bottom>
|
||||||
|
<template
|
||||||
|
v-if="effectIcon !== 'remove'"
|
||||||
|
#activator="{ on }"
|
||||||
|
>
|
||||||
|
<v-icon
|
||||||
|
class="mx-2"
|
||||||
|
style="cursor: default;"
|
||||||
|
v-on="on"
|
||||||
|
>
|
||||||
|
{{ effectIcon }}
|
||||||
|
</v-icon>
|
||||||
|
</template>
|
||||||
|
<span>{{ tooltip }}</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-tile-avatar>
|
||||||
|
<v-list-tile-action class="headline">
|
||||||
|
{{ displayedValue }}
|
||||||
|
</v-list-tile-action>
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title>
|
||||||
|
<code>{{ model.stat }}</code>
|
||||||
|
<template v-if="effectIcon === 'remove'">
|
||||||
|
damage
|
||||||
|
</template>
|
||||||
|
</v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</v-list-tile>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js';
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js';
|
||||||
|
import getEffectIcon from '/imports/ui/utility/getEffectIcon.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [propertyViewerMixin],
|
mixins: [propertyViewerMixin],
|
||||||
|
computed: {
|
||||||
|
effectIcon(){
|
||||||
|
let effectOp = this.model.operation === 'increment' ? 'add' : 'base';
|
||||||
|
let value = this.value;
|
||||||
|
if (typeof value === 'string'){
|
||||||
|
value = 1;
|
||||||
|
}
|
||||||
|
return getEffectIcon(effectOp, -value);
|
||||||
|
},
|
||||||
|
value(){
|
||||||
|
return 'amountResult' in this.model ?
|
||||||
|
this.model.amountResult :
|
||||||
|
this.model.amount;
|
||||||
|
},
|
||||||
|
displayedValue(){
|
||||||
|
if (
|
||||||
|
typeof this.value === 'number' &&
|
||||||
|
this.model.operation !== 'set'
|
||||||
|
){
|
||||||
|
return Math.abs(this.value);
|
||||||
|
} else {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip(){
|
||||||
|
if (this.model.operation === 'increment'){
|
||||||
|
if (
|
||||||
|
typeof this.value === 'string' ||
|
||||||
|
this.value >= 0
|
||||||
|
){
|
||||||
|
return 'Minus';
|
||||||
|
} else {
|
||||||
|
return 'Add'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 'Set'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
23
app/imports/ui/properties/viewers/ConstantViewer.vue
Normal file
23
app/imports/ui/properties/viewers/ConstantViewer.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="buff-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<property-variable-name :value="model.variableName" />
|
||||||
|
<property-field
|
||||||
|
name="Calculation"
|
||||||
|
:value="model.calculation"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.errors" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
|
||||||
|
import CalculationErrorList from '/imports/ui/properties/forms/shared/CalculationErrorList.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
CalculationErrorList,
|
||||||
|
},
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
23
app/imports/ui/properties/viewers/RollViewer.vue
Normal file
23
app/imports/ui/properties/viewers/RollViewer.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="buff-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<property-variable-name :value="model.variableName" />
|
||||||
|
<property-field
|
||||||
|
name="Roll"
|
||||||
|
:value="'rollResult' in model ? model.rollResult : model.roll"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.rollErrors" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
|
||||||
|
import CalculationErrorList from '/imports/ui/properties/forms/shared/CalculationErrorList.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
CalculationErrorList,
|
||||||
|
},
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
21
app/imports/ui/properties/viewers/SavingThrowViewer.vue
Normal file
21
app/imports/ui/properties/viewers/SavingThrowViewer.vue
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="buff-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<property-field
|
||||||
|
name="Save"
|
||||||
|
:value="model.stat"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="DC"
|
||||||
|
:value="'dcResult' in model ? model.dcResult : model.dc"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
37
app/imports/ui/properties/viewers/SlotFillerViewer.vue
Normal file
37
app/imports/ui/properties/viewers/SlotFillerViewer.vue
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="slot-filler-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<v-img
|
||||||
|
v-if="model.picture"
|
||||||
|
:src="model.picture"
|
||||||
|
:height="200"
|
||||||
|
contain
|
||||||
|
class="slot-card-image"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Type"
|
||||||
|
:value="model.slotFillerType"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Quantity"
|
||||||
|
:value="model.slotQuantityFilled"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Condition"
|
||||||
|
:value="model.slotFillerCondition"
|
||||||
|
/>
|
||||||
|
<property-description
|
||||||
|
:string="model.description"
|
||||||
|
:calculations="model.descriptionCalculations"
|
||||||
|
:inactive="model.inactive"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
41
app/imports/ui/properties/viewers/SlotViewer.vue
Normal file
41
app/imports/ui/properties/viewers/SlotViewer.vue
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="buff-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<property-field
|
||||||
|
name="Type"
|
||||||
|
:value="model.slotType"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Quantity"
|
||||||
|
:value="'quantityExpectedResult' in model ? model.quantityExpectedResult : model.quantityExpected"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Condition"
|
||||||
|
:value="model.slotCondition"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
v-if="'slotConditionResult' in model"
|
||||||
|
name="Condition result"
|
||||||
|
:value="model.slotConditionResult"
|
||||||
|
/>
|
||||||
|
<template v-if="model.tags.length">
|
||||||
|
<div class="caption">
|
||||||
|
Tags
|
||||||
|
</div>
|
||||||
|
<property-tags :tags="model.tags" />
|
||||||
|
</template>
|
||||||
|
<property-description
|
||||||
|
:string="model.description"
|
||||||
|
:calculations="model.descriptionCalculations"
|
||||||
|
:inactive="model.inactive"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -4,7 +4,15 @@
|
|||||||
<property-variable-name :value="model.variableName" />
|
<property-variable-name :value="model.variableName" />
|
||||||
<property-field
|
<property-field
|
||||||
name="Maximum prepared spells"
|
name="Maximum prepared spells"
|
||||||
:value="model.maxPreparedResult"
|
:value="'maxPreparedResult' in model ? model.maxPreparedResult : model.maxPrepared"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Spell Save DC"
|
||||||
|
:value="'dcResult' in model ? model.dcResult : model.dcResult"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Attack roll bonus"
|
||||||
|
:value="'attackRollBonusResult' in model ? model.attackRollBonusResult : model.attackRollBonus"
|
||||||
/>
|
/>
|
||||||
<property-description
|
<property-description
|
||||||
:string="model.description"
|
:string="model.description"
|
||||||
|
|||||||
31
app/imports/ui/properties/viewers/ToggleViewer.vue
Normal file
31
app/imports/ui/properties/viewers/ToggleViewer.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="toggle-viewer">
|
||||||
|
<property-name :value="model.name" />
|
||||||
|
<property-field
|
||||||
|
v-if="model.disabled || model.enabled"
|
||||||
|
name="Status"
|
||||||
|
:value="model.enabled ? 'Enabled' : 'Disabled'"
|
||||||
|
/>
|
||||||
|
<template
|
||||||
|
v-else-if="model.condition"
|
||||||
|
>
|
||||||
|
<property-field
|
||||||
|
name="Condition"
|
||||||
|
:value="model.condition"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
v-if="'toggleResult' in model"
|
||||||
|
name="Result"
|
||||||
|
:value="model.toggleResult"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [propertyViewerMixin],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<template lang="html">
|
<template lang="html">
|
||||||
<div v-if="value !== undefined || $slots.default">
|
<div v-if="value !== undefined || $slots.default">
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
{{name}}
|
{{ name }}
|
||||||
</div>
|
</div>
|
||||||
<p class="ml-2 subheading">
|
<p class="ml-2 subheading">
|
||||||
<slot>
|
<slot>
|
||||||
{{value}}
|
{{ value }}
|
||||||
</slot>
|
</slot>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
name: String,
|
name: String,
|
||||||
value: [String, Number],
|
value: [String, Number, Boolean],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import AttributeViewer from '/imports/ui/properties/viewers/AttributeViewer.vue'
|
|||||||
import BuffViewer from '/imports/ui/properties/viewers/BuffViewer.vue';
|
import BuffViewer from '/imports/ui/properties/viewers/BuffViewer.vue';
|
||||||
import ContainerViewer from '/imports/ui/properties/viewers/ContainerViewer.vue';
|
import ContainerViewer from '/imports/ui/properties/viewers/ContainerViewer.vue';
|
||||||
import ClassLevelViewer from '/imports/ui/properties/viewers/ClassLevelViewer.vue';
|
import ClassLevelViewer from '/imports/ui/properties/viewers/ClassLevelViewer.vue';
|
||||||
|
import ConstantViewer from '/imports/ui/properties/viewers/ConstantViewer.vue';
|
||||||
import DamageViewer from '/imports/ui/properties/viewers/DamageViewer.vue';
|
import DamageViewer from '/imports/ui/properties/viewers/DamageViewer.vue';
|
||||||
import DamageMultiplierViewer from '/imports/ui/properties/viewers/DamageMultiplierViewer.vue';
|
import DamageMultiplierViewer from '/imports/ui/properties/viewers/DamageMultiplierViewer.vue';
|
||||||
import EffectViewer from '/imports/ui/properties/viewers/EffectViewer.vue';
|
import EffectViewer from '/imports/ui/properties/viewers/EffectViewer.vue';
|
||||||
@@ -13,10 +14,14 @@ import FolderViewer from '/imports/ui/properties/viewers/FolderViewer.vue';
|
|||||||
import ItemViewer from '/imports/ui/properties/viewers/ItemViewer.vue';
|
import ItemViewer from '/imports/ui/properties/viewers/ItemViewer.vue';
|
||||||
import NoteViewer from '/imports/ui/properties/viewers/NoteViewer.vue';
|
import NoteViewer from '/imports/ui/properties/viewers/NoteViewer.vue';
|
||||||
import ProficiencyViewer from '/imports/ui/properties/viewers/ProficiencyViewer.vue';
|
import ProficiencyViewer from '/imports/ui/properties/viewers/ProficiencyViewer.vue';
|
||||||
//import RollViewer from '/imports/ui/properties/viewers/RollViewer.vue';
|
import RollViewer from '/imports/ui/properties/viewers/RollViewer.vue';
|
||||||
import SkillViewer from '/imports/ui/properties/viewers/SkillViewer.vue';
|
import SkillViewer from '/imports/ui/properties/viewers/SkillViewer.vue';
|
||||||
|
import SavingThrowViewer from '/imports/ui/properties/viewers/SavingThrowViewer.vue';
|
||||||
|
import SlotViewer from '/imports/ui/properties/viewers/SlotViewer.vue';
|
||||||
|
import SlotFillerViewer from '/imports/ui/properties/viewers/SlotFillerViewer.vue';
|
||||||
import SpellListViewer from '/imports/ui/properties/viewers/SpellListViewer.vue';
|
import SpellListViewer from '/imports/ui/properties/viewers/SpellListViewer.vue';
|
||||||
import SpellViewer from '/imports/ui/properties/viewers/SpellViewer.vue';
|
import SpellViewer from '/imports/ui/properties/viewers/SpellViewer.vue';
|
||||||
|
import ToggleViewer from '/imports/ui/properties/viewers/ToggleViewer.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
action: ActionViewer,
|
action: ActionViewer,
|
||||||
@@ -26,6 +31,7 @@ export default {
|
|||||||
buff: BuffViewer,
|
buff: BuffViewer,
|
||||||
container: ContainerViewer,
|
container: ContainerViewer,
|
||||||
classLevel: ClassLevelViewer,
|
classLevel: ClassLevelViewer,
|
||||||
|
constant: ConstantViewer,
|
||||||
damage: DamageViewer,
|
damage: DamageViewer,
|
||||||
damageMultiplier: DamageMultiplierViewer,
|
damageMultiplier: DamageMultiplierViewer,
|
||||||
effect: EffectViewer,
|
effect: EffectViewer,
|
||||||
@@ -34,8 +40,12 @@ export default {
|
|||||||
item: ItemViewer,
|
item: ItemViewer,
|
||||||
note: NoteViewer,
|
note: NoteViewer,
|
||||||
proficiency: ProficiencyViewer,
|
proficiency: ProficiencyViewer,
|
||||||
// roll: RollViewer,
|
propertySlot: SlotViewer,
|
||||||
|
roll: RollViewer,
|
||||||
|
savingThrow: SavingThrowViewer,
|
||||||
|
slotFiller: SlotFillerViewer,
|
||||||
skill: SkillViewer,
|
skill: SkillViewer,
|
||||||
spellList: SpellListViewer,
|
spellList: SpellListViewer,
|
||||||
spell: SpellViewer,
|
spell: SpellViewer,
|
||||||
|
toggle: ToggleViewer,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user