diff --git a/app/imports/ui/creature/character/characterSheetTabs/BuildTab.vue b/app/imports/ui/creature/character/characterSheetTabs/BuildTab.vue index 64bd043e..7b530263 100644 --- a/app/imports/ui/creature/character/characterSheetTabs/BuildTab.vue +++ b/app/imports/ui/creature/character/characterSheetTabs/BuildTab.vue @@ -20,7 +20,51 @@ lg="6" > - Slots + + Slots + + + + + + + + mdi-file-hidden + + {{ hiddenCount }} hidden {{ hiddenCount > 1 ? 'slots' : 'slot' }} + + + + {{ getPropertyTitle(slot) }} + + + + + + { @@ -179,7 +226,10 @@ export default { ...this.highestLevels, ...this.classProperties ].sort((a, b) => a.order - b.order); - } + }, + hiddenCount() { + return this.hiddenSlots.length; + }, }, meteor: { creature(){ @@ -188,6 +238,29 @@ export default { variables() { return CreatureVariables.findOne({ _creatureId: this.creatureId }) || {}; }, + hiddenSlots(){ + return CreatureProperties.find({ + type: 'propertySlot', + 'ancestors.id': this.creatureId, + ignored: true, + $and: [ + { + $or: [ + {'slotCondition.value': {$nin: [false, 0, '']}}, + {'slotCondition.value': {$exists: false}}, + ] + },{ + $or: [ + { 'quantityExpected.value': {$in: [false, 0, '', undefined]} }, + { 'quantityExpected.value': {exists: false} }, + {spaceLeft: {$gt: 0}}, + ] + }, + ], + removed: {$ne: true}, + inactive: {$ne: true}, + }).fetch(); + }, classProperties(){ return CreatureProperties.find({ 'ancestors.id': this.creatureId, @@ -313,6 +386,19 @@ export default { } }); }, + getPropertyTitle, + unhideSlot(_id) { + updateCreatureProperty.call({ + _id, + path: ['ignored'], + value: false, + }, error => { + if (error){ + console.error(error); + snackbar({text: error.reason || error.message || error.toString()}); + } + }); + }, }, };