Removed variable names from items, now only use tags. Items can also be attuned
This commit is contained in:
@@ -1,19 +1,10 @@
|
|||||||
import SimpleSchema from 'simpl-schema';
|
import SimpleSchema from 'simpl-schema';
|
||||||
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
|
|
||||||
|
|
||||||
ItemSchema = new SimpleSchema({
|
const ItemSchema = new SimpleSchema({
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
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 name of the item, if there is more than one
|
||||||
plural: {
|
plural: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -47,6 +38,10 @@ ItemSchema = new SimpleSchema({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
attuned: {
|
||||||
|
type: Boolean,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
// Show increment/decrement buttons in item lists
|
// Show increment/decrement buttons in item lists
|
||||||
showIncrement: {
|
showIncrement: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|||||||
@@ -9,22 +9,13 @@
|
|||||||
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
|
@change="(value, ack) => $emit('change', {path: ['name'], value, ack})"
|
||||||
/>
|
/>
|
||||||
<text-field
|
<text-field
|
||||||
label="Variable name"
|
label="Plural name"
|
||||||
:value="model.variableName"
|
:value="model.plural"
|
||||||
style="flex-basis: 300px;"
|
:error-messages="errors.plural"
|
||||||
hint="Use this name in formulae to reference this attribute"
|
|
||||||
:error-messages="errors.variableName"
|
|
||||||
:debounce-time="debounceTime"
|
:debounce-time="debounceTime"
|
||||||
@change="(value, ack) => $emit('change', {path: ['variableName'], value, ack})"
|
@change="(value, ack) => $emit('change', {path: ['plural'], value, ack})"
|
||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<div class="layout row wrap">
|
||||||
<text-field
|
<text-field
|
||||||
label="Value"
|
label="Value"
|
||||||
@@ -72,18 +63,42 @@
|
|||||||
name="Advanced"
|
name="Advanced"
|
||||||
standalone
|
standalone
|
||||||
>
|
>
|
||||||
<v-switch
|
|
||||||
label="Requires attunement"
|
|
||||||
:input-value="model.requiresAttunement"
|
|
||||||
:error-messages="errors.requiresAttunement"
|
|
||||||
@change="e => $emit('change', {path: ['requiresAttunement'], value})"
|
|
||||||
/>
|
|
||||||
<v-switch
|
<v-switch
|
||||||
label="Show increment buttons"
|
label="Show increment buttons"
|
||||||
:input-value="model.showIncrement"
|
:input-value="model.showIncrement"
|
||||||
:error-messages="errors.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>
|
</form-section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user