@@ -147,6 +149,10 @@ export default {
type: Array,
default: () => [],
},
+ parentSlotId: {
+ type: String,
+ default: undefined,
+ },
},
data(){return {
expanded: false,
@@ -197,6 +203,21 @@ export default {
}
return this.children;
},
+ computedSlotId() {
+ if (this.condenseChild) {
+ if (this.children[0].node.type === 'propertySlot') {
+ return this.children[0].node._id;
+ } else {
+ return undefined;
+ }
+ } else {
+ if (this.node.type === 'propertySlot') {
+ return this.node._id;
+ } else {
+ return undefined;
+ }
+ }
+ },
canExpand(){
return !!this.computedChildren.length || this.canFillWithMany;
},
@@ -230,41 +251,41 @@ export default {
diff --git a/app/imports/ui/properties/forms/shared/ComputedField.vue b/app/imports/ui/properties/forms/shared/ComputedField.vue
index d6b237e4..9d3ac194 100644
--- a/app/imports/ui/properties/forms/shared/ComputedField.vue
+++ b/app/imports/ui/properties/forms/shared/ComputedField.vue
@@ -6,7 +6,7 @@
@change="(value, ack) => $emit('change', {path: ['calculation'], value, ack})"
>
{{ model.value }}
@@ -28,8 +28,20 @@ export default {
type: Object,
default: () => ({}),
},
+ hideValue: {
+ type: Boolean,
+ },
},
computed: {
+ showValue() {
+ const value = this.model.value;
+ if (
+ this.hideValue ||
+ (value === undefined || value === null) ||
+ value == this.model.calculation
+ ) return false;
+ return true;
+ },
errorList(){
if (this.model.parseError){
return [this.model.parseError, ...this.model.errors];
diff --git a/app/imports/ui/properties/forms/shared/FormSection.vue b/app/imports/ui/properties/forms/shared/FormSection.vue
index 04d5b3d7..96946f77 100644
--- a/app/imports/ui/properties/forms/shared/FormSection.vue
+++ b/app/imports/ui/properties/forms/shared/FormSection.vue
@@ -4,7 +4,7 @@
{{ name }}
-
+
@@ -13,7 +13,7 @@
{{ name }}
-
+
diff --git a/app/imports/ui/properties/forms/shared/propertyFormIndex.js b/app/imports/ui/properties/forms/shared/propertyFormIndex.js
index e8d6eb9f..bd6c6ba9 100644
--- a/app/imports/ui/properties/forms/shared/propertyFormIndex.js
+++ b/app/imports/ui/properties/forms/shared/propertyFormIndex.js
@@ -15,6 +15,7 @@ const FeatureForm = () => import('/imports/ui/properties/forms/FeatureForm.vue')
const FolderForm = () => import('/imports/ui/properties/forms/FolderForm.vue');
const ItemForm = () => import('/imports/ui/properties/forms/ItemForm.vue');
const NoteForm = () => import('/imports/ui/properties/forms/NoteForm.vue');
+const PointBuyForm = () => import('/imports/ui/properties/forms/PointBuyForm.vue');
const ProficiencyForm = () => import('/imports/ui/properties/forms/ProficiencyForm.vue');
const ReferenceForm = () => import('/imports/ui/properties/forms/ReferenceForm.vue');
const RollForm = () => import('/imports/ui/properties/forms/RollForm.vue');
@@ -45,6 +46,7 @@ export default {
folder: FolderForm,
item: ItemForm,
note: NoteForm,
+ pointBuy: PointBuyForm,
proficiency: ProficiencyForm,
propertySlot: SlotForm,
reference: ReferenceForm,
diff --git a/app/imports/ui/properties/viewers/AttributeViewer.vue b/app/imports/ui/properties/viewers/AttributeViewer.vue
index 6a2844c8..6561dfd1 100644
--- a/app/imports/ui/properties/viewers/AttributeViewer.vue
+++ b/app/imports/ui/properties/viewers/AttributeViewer.vue
@@ -107,25 +107,18 @@
-
@@ -137,7 +130,6 @@
import propertyViewerMixin from '/imports/ui/properties/viewers/shared/propertyViewerMixin.js'
import numberToSignedString from '/imports/ui/utility/numberToSignedString.js';
import AttributeEffect from '/imports/ui/properties/components/attributes/AttributeEffect.vue';
- import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties.js';
import damageProperty from '/imports/api/creature/creatureProperties/methods/damageProperty.js';
import IncrementButton from '/imports/ui/components/IncrementButton.vue';
import getProficiencyIcon from '/imports/ui/utility/getProficiencyIcon.js';
@@ -211,31 +203,8 @@
},
},
meteor: {
- baseEffects(){
- if (this.context.creatureId && this.model.variableName){
- let creatureId = this.context.creatureId;
- return CreatureProperties.find({
- 'ancestors.id': creatureId,
- type: 'attribute',
- variableName: this.model.variableName,
- removed: {$ne: true},
- inactive: {$ne: true},
- }).map( prop => ({
- _id: prop._id,
- name: 'Attribute base value',
- operation: 'base',
- amount: prop.baseValue,
- stats: [prop.variableName],
- ancestors: prop.ancestors,
- }) ).filter(effect => effect.amount);
- } else {
- return [];
- }
- },
effects() {
- return CreatureProperties.find({
- _id: { $in: this.model.effects?.map(e => e._id) || [] }
- });
+ return this.model.effects;
},
},
}
diff --git a/app/imports/ui/properties/viewers/PointBuyViewer.vue b/app/imports/ui/properties/viewers/PointBuyViewer.vue
new file mode 100644
index 00000000..760b87ab
--- /dev/null
+++ b/app/imports/ui/properties/viewers/PointBuyViewer.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
diff --git a/app/imports/ui/properties/viewers/SkillViewer.vue b/app/imports/ui/properties/viewers/SkillViewer.vue
index 5cc7479e..3b31157a 100644
--- a/app/imports/ui/properties/viewers/SkillViewer.vue
+++ b/app/imports/ui/properties/viewers/SkillViewer.vue
@@ -47,6 +47,12 @@
name="Passive score"
:value="passiveScore"
/>
+
-
({
- _id: prop._id,
- name: 'Skill base value',
- operation: 'base',
- calculation: prop.baseValueCalculation,
- amount: {value: prop.baseValue?.value},
- stats: [prop.variableName],
- ancestors: prop.ancestors,
- }) ).filter(effect => effect.amount?.value);
- } else {
- return [];
- }
- },
effects() {
- return CreatureProperties.find({
- _id: { $in: this.model.effects?.map(e => e._id) || [] }
- });
+ return this.model.effects;
},
baseProficiencies(){
if (this.context.creatureId){
@@ -265,7 +239,7 @@ export default {
return {
_id: abilityProp._id,
name: abilityProp.name,
- operation: 'base',
+ operation: 'add',
amount: {value: abilityProp.modifier},
stats: [this.model.variableName],
ancestors: abilityProp.ancestors,
diff --git a/app/imports/ui/properties/viewers/shared/propertyViewerIndex.js b/app/imports/ui/properties/viewers/shared/propertyViewerIndex.js
index cef19b01..15d148e7 100644
--- a/app/imports/ui/properties/viewers/shared/propertyViewerIndex.js
+++ b/app/imports/ui/properties/viewers/shared/propertyViewerIndex.js
@@ -15,6 +15,7 @@ const FeatureViewer = () => import ('/imports/ui/properties/viewers/FeatureViewe
const FolderViewer = () => import ('/imports/ui/properties/viewers/FolderViewer.vue');
const ItemViewer = () => import ('/imports/ui/properties/viewers/ItemViewer.vue');
const NoteViewer = () => import ('/imports/ui/properties/viewers/NoteViewer.vue');
+const PointBuyViewer = () => import ('/imports/ui/properties/viewers/PointBuyViewer.vue');
const ProficiencyViewer = () => import ('/imports/ui/properties/viewers/ProficiencyViewer.vue');
const ReferenceViewer = () => import ('/imports/ui/properties/viewers/ReferenceViewer.vue');
const RollViewer = () => import ('/imports/ui/properties/viewers/RollViewer.vue');
@@ -45,6 +46,7 @@ export default {
folder: FolderViewer,
item: ItemViewer,
note: NoteViewer,
+ pointBuy: PointBuyViewer,
proficiency: ProficiencyViewer,
propertySlot: SlotViewer,
roll: RollViewer,
diff --git a/app/imports/ui/tabletop/TabletopComponent.vue b/app/imports/ui/tabletop/TabletopComponent.vue
index 81e4318c..690219e9 100644
--- a/app/imports/ui/tabletop/TabletopComponent.vue
+++ b/app/imports/ui/tabletop/TabletopComponent.vue
@@ -43,7 +43,7 @@ import TabletopMap from '/imports/ui/tabletop/TabletopMap.vue';
import Creatures from '/imports/api/creature/creatures/Creatures.js';
import TabletopActionCards from '/imports/ui/tabletop/TabletopActionCards.vue';
import MiniCharacterSheet from '/imports/ui/creature/character/MiniCharacterSheet.vue';
-import snackbar from '/imports/ui/components/snackbars/SnackbarQueue.js';
+import { snackbar } from '/imports/ui/components/snackbars/SnackbarQueue.js';
export default {
components: {