Fixed health bars not hiding
This commit is contained in:
@@ -292,7 +292,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Creatures from '/imports/api/creature/Creatures.js';
|
import Creatures from '/imports/api/creature/Creatures.js';
|
||||||
import CreatureProperties, { damageProperty } from '/imports/api/creature/CreatureProperties.js';
|
import { damageProperty } from '/imports/api/creature/CreatureProperties.js';
|
||||||
import AttributeCard from '/imports/ui/properties/components/attributes/AttributeCard.vue';
|
import AttributeCard from '/imports/ui/properties/components/attributes/AttributeCard.vue';
|
||||||
import AbilityListTile from '/imports/ui/properties/components/attributes/AbilityListTile.vue';
|
import AbilityListTile from '/imports/ui/properties/components/attributes/AbilityListTile.vue';
|
||||||
import ColumnLayout from '/imports/ui/components/ColumnLayout.vue';
|
import ColumnLayout from '/imports/ui/components/ColumnLayout.vue';
|
||||||
|
|||||||
@@ -7,26 +7,40 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CreatureProperties, { damageProperty } from '/imports/api/creature/CreatureProperties.js';
|
import Creatures from '/imports/api/creature/Creatures.js';
|
||||||
|
import { damageProperty } from '/imports/api/creature/CreatureProperties.js';
|
||||||
import HealthBarCard from '/imports/ui/properties/components/attributes/HealthBarCard.vue';
|
import HealthBarCard from '/imports/ui/properties/components/attributes/HealthBarCard.vue';
|
||||||
|
import getActiveProperties from '/imports/api/creature/getActiveProperties.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
HealthBarCard,
|
HealthBarCard,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
creatureId: String,
|
creatureId: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
meteor: {
|
meteor: {
|
||||||
|
creature(){
|
||||||
|
return Creatures.findOne(this.creatureId, {fields: {settings: 1}});
|
||||||
|
},
|
||||||
attributes(){
|
attributes(){
|
||||||
return CreatureProperties.find({
|
let creature = this.creature;
|
||||||
'ancestors.id': this.creatureId,
|
if (!creature) return;
|
||||||
type: 'attribute',
|
let filter = {
|
||||||
|
type: 'attribute',
|
||||||
attributeType: 'healthBar',
|
attributeType: 'healthBar',
|
||||||
removed: {$ne: true},
|
};
|
||||||
}, {
|
if (creature.settings.hideUnusedStats){
|
||||||
sort: {order: 1},
|
filter.hide = {$ne: true};
|
||||||
});
|
}
|
||||||
|
return getActiveProperties({
|
||||||
|
ancestorId: creature._id,
|
||||||
|
filter,
|
||||||
|
options: {sort: {order: 1}},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user