Zero value stats now appear in character sheet

This commit is contained in:
Thaum Rystra
2020-04-29 11:10:23 +02:00
parent 4fd62d17bd
commit d63565633e
2 changed files with 7 additions and 20 deletions

View File

@@ -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({

View File

@@ -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},
}); });