Made spells into a special kind of action

This commit is contained in:
Thaum Rystra
2020-04-16 15:21:31 +02:00
parent e06196a54c
commit 1717ee4bc7
7 changed files with 389 additions and 251 deletions

View File

@@ -0,0 +1,34 @@
<template lang="html">
<v-list-tile
class="ability-list-tile"
v-on="hasClickListener ? {click} : {}"
>
<v-list-tile-content>
{{ model.name }}
</v-list-tile-content>
</v-list-tile>
</template>
<script>
export default {
props: {
model: {
type: Object,
required: true,
}
},
computed: {
hasClickListener(){
return this.$listeners && this.$listeners.click
},
},
methods: {
click(e){
this.$emit('click', e);
},
}
}
</script>
<style lang="css" scoped>
</style>

View File

@@ -1,22 +1,23 @@
<template lang="html">
<v-list-tile class="ability-list-tile" v-on="hasClickListener ? {click} : {}">
<v-list-tile
class="ability-list-tile"
v-on="hasClickListener ? {click} : {}"
>
<v-list-tile-action class="mr-4">
<div class="display-1 mod">
{{ numberToSignedString(mod) }}
</div>
<div class="title value">
{{ value }}
</div>
</v-list-tile-action>
<v-list-tile-action class="mr-4">
<div class="display-1 mod">
{{numberToSignedString(mod)}}
</div>
<div class="title value">
{{value}}
</div>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>
{{name}}
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile-content>
<v-list-tile-title>
{{ name }}
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
<script>
@@ -27,16 +28,16 @@ export default {
mod: Number,
name: String,
},
computed: {
hasClickListener(){
return this.$listeners && this.$listeners.click
},
},
methods: {
numberToSignedString,
click(e){
this.$emit('click', e);
},
},
computed: {
hasClickListener(){
return this.$listeners && this.$listeners.click
},
}
}
</script>

View File

@@ -100,30 +100,42 @@
:debounce-time="debounceTime"
@change="(value, ack) => $emit('change', {path: ['description'], value, ack})"
/>
<form-section
name="Advanced"
standalone
>
<v-combobox
label="Spell lists"
multiple
chips
deletable-chips
box
:value="model.spellLists"
:error-messages="errors.spellLists"
@change="(value) => $emit('change', {path: ['spellLists'], value})"
/>
</form-section>
<form-sections>
<form-section
name="Advanced"
>
<v-combobox
label="Spell lists"
multiple
chips
deletable-chips
box
:value="model.spellLists"
:error-messages="errors.spellLists"
@change="(value) => $emit('change', {path: ['spellLists'], value})"
/>
</form-section>
<form-section
name="Casting"
>
<action-form
v-bind="$props"
v-on="$listeners"
/>
</form-section>
</form-sections>
</div>
</template>
<script>
import FormSection from '/imports/ui/properties/forms/shared/FormSection.vue';
import FormSection, { FormSections } from '/imports/ui/properties/forms/shared/FormSection.vue';
import ActionForm from '/imports/ui/properties/forms/ActionForm.vue'
export default {
components: {
FormSections,
FormSection,
ActionForm,
},
props: {
model: {