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> <div slot="toolbar">Add {{propertyName}}</div>
<component <component
v-if="type" v-if="type"
stored
:is="type" :is="type"
class="creature-property-form" class="creature-property-form"
:model="model" :model="model"

View File

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

View File

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