f._id);
+ },
+ healthBars() {
+ return getAttributeOfType(this.creature, this.folderIds, 'healthBar');
+ },
abilities() {
- return getAttributeOfType(this.creature, 'ability');
+ return getAttributeOfType(this.creature, this.folderIds, 'ability');
},
stats() {
- return getAttributeOfType(this.creature, 'stat');
+ return getAttributeOfType(this.creature, this.folderIds, 'stat');
},
toggles() {
return CreatureProperties.find({
- 'ancestors.id': this.creatureId,
type: 'toggle',
+ 'ancestors.id': this.creatureId,
+ 'parent.id': { $nin: this.folderIds },
removed: { $ne: true },
deactivatedByAncestor: { $ne: true },
showUI: true,
@@ -457,64 +473,61 @@ export default {
});
},
modifiers() {
- return getAttributeOfType(this.creature, 'modifier');
+ return getAttributeOfType(this.creature, this.folderIds, 'modifier');
},
resources() {
- return getAttributeOfType(this.creature, 'resource');
+ return getAttributeOfType(this.creature, this.folderIds, 'resource');
},
spellSlots() {
- return getAttributeOfType(this.creature, 'spellSlot');
+ return getAttributeOfType(this.creature, this.folderIds, 'spellSlot');
},
hasSpells() {
- const cursor = getProperties(this.creature, {
+ const cursor = getProperties(this.creature, this.folderIds, {
type: 'spell',
})
return cursor && cursor.count();
},
hitDice() {
- return getAttributeOfType(this.creature, 'hitDice');
+ return getAttributeOfType(this.creature, this.folderIds, 'hitDice');
},
checks() {
- return getSkillOfType(this.creature, 'check');
+ return getSkillOfType(this.creature, this.folderIds, 'check');
},
savingThrows() {
- return getSkillOfType(this.creature, 'save');
+ return getSkillOfType(this.creature, this.folderIds, 'save');
},
skills() {
- return getSkillOfType(this.creature, 'skill');
+ return getSkillOfType(this.creature, this.folderIds, 'skill');
},
tools() {
- return getSkillOfType(this.creature, 'tool');
+ return getSkillOfType(this.creature, this.folderIds, 'tool');
},
weapons() {
- return getSkillOfType(this.creature, 'weapon');
+ return getSkillOfType(this.creature, this.folderIds, 'weapon');
},
armors() {
- return getSkillOfType(this.creature, 'armor');
+ return getSkillOfType(this.creature, this.folderIds, 'armor');
},
languages() {
- return getSkillOfType(this.creature, 'language');
+ return getSkillOfType(this.creature, this.folderIds, 'language');
},
events() {
- const events = getProperties(this.creature, { type: 'action', actionType: 'event' });
+ const events = getProperties(this.creature, this.folderIds, { type: 'action', actionType: 'event' });
return uniqBy(events.fetch(), e => e.variableName);
},
actions() {
- return getProperties(this.creature, { type: 'action', actionType: { $ne: 'event' } });
+ return getProperties(this.creature, this.folderIds, { type: 'action', actionType: { $ne: 'event' } });
},
appliedBuffs() {
- return getProperties(this.creature, { type: 'buff' });
+ return getProperties(this.creature, this.folderIds, { type: 'buff' });
},
multipliers() {
- return getProperties(this.creature, {
+ return getProperties(this.creature, this.folderIds, {
type: 'damageMultiplier'
}, {
sort: { value: 1, order: 1 }
});
},
- folders() {
- return getProperties(this.creature, { type: 'folder', groupStats: true });
- },
},
methods: {
clickProperty({ _id }) {
@@ -532,13 +545,23 @@ export default {
});
},
incrementChange(_id, { type, value }) {
- if (type === 'increment') {
- damageProperty.call({ _id, operation: 'increment', value: -value });
- }
+ damageProperty.call({
+ _id,
+ operation: type,
+ value: -value
+ }, error => {
+ if (error) {
+ snackbar({ text: error.reason || error.message || error.toString() });
+ console.error(error);
+ }
+ });
},
softRemove(_id) {
softRemoveProperty.call({ _id }, error => {
- if (error) console.error(error);
+ if (error) {
+ snackbar({ text: error.reason || error.message || error.toString() });
+ console.error(error);
+ }
});
},
castSpell() {
diff --git a/app/imports/ui/properties/components/attributes/AttributeCard.vue b/app/imports/ui/properties/components/attributes/AttributeCard.vue
index 7b3e1492..f1fd03f9 100644
--- a/app/imports/ui/properties/components/attributes/AttributeCard.vue
+++ b/app/imports/ui/properties/components/attributes/AttributeCard.vue
@@ -5,54 +5,19 @@
@mouseover="hasClickListener ? hovering = true : undefined"
@mouseleave="hasClickListener ? hovering = false : undefined"
>
-
-
-
- {{ computedValue }}
-
-
-
- {{ computedValue }}
-
-
- {{ model.name }}
-
-
+
-
-
diff --git a/app/imports/ui/properties/components/attributes/AttributeCardContent.vue b/app/imports/ui/properties/components/attributes/AttributeCardContent.vue
new file mode 100644
index 00000000..439ad70f
--- /dev/null
+++ b/app/imports/ui/properties/components/attributes/AttributeCardContent.vue
@@ -0,0 +1,97 @@
+
+
+
+
+ {{ computedValue }}
+
+
+
+ {{ computedValue }}
+
+
+ {{ model.name }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/imports/ui/properties/components/attributes/HealthBar.vue b/app/imports/ui/properties/components/attributes/HealthBar.vue
index da4bbb7d..cc83302b 100644
--- a/app/imports/ui/properties/components/attributes/HealthBar.vue
+++ b/app/imports/ui/properties/components/attributes/HealthBar.vue
@@ -6,7 +6,7 @@
style="min-height: 42px;"
:class="{ hover }"
class="my-1 health-bar"
- :data-id="_id"
+ :data-id="model._id"
>
- {{ name }}
+ {{ model.name }}
- {{ value }} / {{ maxValue }}
+ {{ model.value }} / {{ model.total }}