Removed variable names from items, now only use tags. Items can also be attuned

This commit is contained in:
Thaum Rystra
2020-04-30 14:52:41 +02:00
parent 4180e153dd
commit 1ca6bc834a
2 changed files with 40 additions and 30 deletions

View File

@@ -1,19 +1,10 @@
import SimpleSchema from 'simpl-schema';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
ItemSchema = new SimpleSchema({
const ItemSchema = new SimpleSchema({
name: {
type: String,
optional: true,
defaultValue: "New Item",
},
// Variable name to reference this item as ammunition or in formulae
variableName: {
type: String,
regEx: VARIABLE_NAME_REGEX,
min: 3,
defaultValue: 'newAttribute',
},
// Plural name of the item, if there is more than one
plural: {
type: String,
@@ -47,6 +38,10 @@ ItemSchema = new SimpleSchema({
type: Boolean,
optional: true,
},
attuned: {
type: Boolean,
optional: true,
},
// Show increment/decrement buttons in item lists
showIncrement: {
type: Boolean,

View File

@@ -9,22 +9,13 @@
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
/>
<text-field
label="Variable name"
:value="model.variableName"
style="flex-basis: 300px;"
hint="Use this name in formulae to reference this attribute"
:error-messages="errors.variableName"
label="Plural name"
:value="model.plural"
:error-messages="errors.plural"
:debounce-time="debounceTime"
@change="(value, ack) => $emit('change', {path: ['variableName'], value, ack})"
@change="(value, ack) => $emit('change', {path: ['plural'], value, ack})"
/>
</div>
<text-field
label="Plural name"
:value="model.plural"
:error-messages="errors.plural"
:debounce-time="debounceTime"
@change="(value, ack) => $emit('change', {path: ['plural'], value, ack})"
/>
<div class="layout row wrap">
<text-field
label="Value"
@@ -72,18 +63,42 @@
name="Advanced"
standalone
>
<v-switch
label="Requires attunement"
:input-value="model.requiresAttunement"
:error-messages="errors.requiresAttunement"
@change="e => $emit('change', {path: ['requiresAttunement'], value})"
/>
<v-switch
label="Show increment buttons"
:input-value="model.showIncrement"
:error-messages="errors.showIncrement"
@change="e => $emit('change', {path: ['showIncrement'], value})"
@change="value => $emit('change', {path: ['showIncrement'], value})"
/>
<smart-combobox
label="Tags"
class="mr-2"
multiple
chips
deletable-chips
:value="model.tags"
:error-messages="errors.tags"
:debounce-time="debounceTime"
@change="(value, ack) => $emit('change', {path: ['tags'], value, ack})"
/>
<v-switch
label="Requires attunement"
:input-value="model.requiresAttunement"
:error-messages="errors.requiresAttunement"
@change="value => $emit('change', {path: ['requiresAttunement'], value})"
/>
<v-expand-transition>
<div
v-show="model.requiresAttunement"
style="padding-top: 0.1px;"
>
<v-switch
label="Attuned"
:input-value="model.attuned"
:error-messages="errors.attuned"
@change="value => $emit('change', {path: ['attuned'], value})"
/>
</div>
</v-expand-transition>
</form-section>
</div>
</template>