Fixed effects not being able to be added to stored buffs

This commit is contained in:
Stefan Zermatten
2020-03-16 14:16:50 +02:00
parent e3c6949491
commit 5ed8e08993
3 changed files with 5 additions and 6 deletions

View File

@@ -3,7 +3,6 @@
<div slot="toolbar">Add {{propertyName}}</div>
<component
v-if="type"
stored
:is="type"
class="creature-property-form"
:model="model"

View File

@@ -12,7 +12,7 @@
class="mt-4"
:model="buff"
:parent-target="parentTarget"
:stored="stored"
:stored="true"
@change="({path, value, ack}) => $emit('change', {path: [i, ...path], value, ack})"
@push="({path, value, ack}) => $emit('push', {path: [i, ...path], value, ack})"
@pull="({path, ack}) => $emit('pull', {path: [i, ...path], ack})"
@@ -40,14 +40,13 @@
<script>
import BuffForm from '/imports/ui/properties/forms/BuffForm.vue';
import {StoredBuffSchema, AppliedBuffSchema} from '/imports/api/properties/Buffs.js';
import { StoredBuffSchema } from '/imports/api/properties/Buffs.js';
export default {
components: {
BuffForm,
},
props: {
stored: Boolean,
model: {
type: Array,
default: () => ([]),
@@ -66,8 +65,7 @@
},
addBuff(){
this.addBuffLoading = true;
let schema = this.stored ? StoredBuffSchema : AppliedBuffSchema;
this.$emit('push', {path: [], value: schema.clean({}), ack: this.acknowledgeAddBuff});
this.$emit('push', {path: [], value: StoredBuffSchema.clean({}), ack: this.acknowledgeAddBuff});
},
},
}

View File

@@ -1,6 +1,7 @@
import ActionForm from '/imports/ui/properties/forms/ActionForm.vue';
import AttackForm from '/imports/ui/properties/forms/AttackForm.vue';
import AttributeForm from '/imports/ui/properties/forms/AttributeForm.vue';
import BuffForm from '/imports/ui/properties/forms/BuffForm.vue';
import ContainerForm from '/imports/ui/properties/forms/ContainerForm.vue';
import ClassLevelForm from '/imports/ui/properties/forms/ClassLevelForm.vue';
import DamageMultiplierForm from '/imports/ui/properties/forms/DamageMultiplierForm.vue';
@@ -21,6 +22,7 @@ export default {
action: ActionForm,
attack: AttackForm,
attribute: AttributeForm,
buff: BuffForm,
container: ContainerForm,
classLevel: ClassLevelForm,
damageMultiplier: DamageMultiplierForm,