Zero value stats now appear in character sheet
This commit is contained in:
@@ -204,18 +204,6 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNonZeroAttributeOfType = function(charId, type){
|
|
||||||
return CreatureProperties.find({
|
|
||||||
'ancestors.id': charId,
|
|
||||||
type: 'attribute',
|
|
||||||
attributeType: type,
|
|
||||||
value: {$ne: 0},
|
|
||||||
removed: {$ne: true},
|
|
||||||
}, {
|
|
||||||
sort: {order: 1}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AbilityListTile,
|
AbilityListTile,
|
||||||
@@ -246,13 +234,13 @@
|
|||||||
return getAttributeOfType(this.creatureId, 'modifier');
|
return getAttributeOfType(this.creatureId, 'modifier');
|
||||||
},
|
},
|
||||||
resources(){
|
resources(){
|
||||||
return getNonZeroAttributeOfType(this.creatureId, 'resource');
|
return getAttributeOfType(this.creatureId, 'resource');
|
||||||
},
|
},
|
||||||
spellSlots(){
|
spellSlots(){
|
||||||
return getNonZeroAttributeOfType(this.creatureId, 'spellSlot');
|
return getAttributeOfType(this.creatureId, 'spellSlot');
|
||||||
},
|
},
|
||||||
hitDice(){
|
hitDice(){
|
||||||
return getNonZeroAttributeOfType(this.creatureId, 'hitDice');
|
return getAttributeOfType(this.creatureId, 'hitDice');
|
||||||
},
|
},
|
||||||
checks(){
|
checks(){
|
||||||
return CreatureProperties.find({
|
return CreatureProperties.find({
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template lang="html">
|
<template lang="html">
|
||||||
<health-bar-card
|
<health-bar-card
|
||||||
:attributes="attributes"
|
:attributes="attributes"
|
||||||
@change="healthBarChanged"
|
@change="healthBarChanged"
|
||||||
@click="healthBarClicked"
|
@click="healthBarClicked"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
'ancestors.id': this.creatureId,
|
'ancestors.id': this.creatureId,
|
||||||
type: 'attribute',
|
type: 'attribute',
|
||||||
attributeType: 'healthBar',
|
attributeType: 'healthBar',
|
||||||
value: {$ne: 0},
|
|
||||||
}, {
|
}, {
|
||||||
sort: {order: 1},
|
sort: {order: 1},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user