Added slotfiller property type to increase control over slot filling
This commit is contained in:
38
app/imports/api/properties/SlotFillers.js
Normal file
38
app/imports/api/properties/SlotFillers.js
Normal file
@@ -0,0 +1,38 @@
|
||||
// SlotFiller fillers specifically fill a slot with a bit more control than
|
||||
// other properties
|
||||
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
|
||||
let SlotFillerSchema = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
picture: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
// Overrides the type when searching for properties
|
||||
slotFillerType: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
// Fill more than one quantity in a slot, like feats and ability score
|
||||
// improvements, filtered out of UI if there isn't space in quantityExpected
|
||||
slotQuantityFilled: {
|
||||
type: SimpleSchema.Integer,
|
||||
defaultValue: 1,
|
||||
min: 0,
|
||||
},
|
||||
// Filters out of UI if condition isn't met, but isn't otherwise enforced
|
||||
slotFillerCondition: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
|
||||
export { SlotFillerSchema };
|
||||
@@ -18,6 +18,7 @@ import { RollSchema } from '/imports/api/properties/Rolls.js';
|
||||
import { ComputedSavingThrowSchema } from '/imports/api/properties/SavingThrows.js';
|
||||
import { ComputedSkillSchema } from '/imports/api/properties/Skills.js';
|
||||
import { ComputedSlotSchema } from '/imports/api/properties/Slots.js';
|
||||
import { SlotFillerSchema } from '/imports/api/properties/SlotFillers.js';
|
||||
import { ComputedSpellSchema } from '/imports/api/properties/Spells.js';
|
||||
import { ComputedSpellListSchema } from '/imports/api/properties/SpellLists.js';
|
||||
import { ToggleSchema } from '/imports/api/properties/Toggles.js';
|
||||
@@ -36,10 +37,11 @@ const propertySchemasIndex = {
|
||||
folder: FolderSchema,
|
||||
note: NoteSchema,
|
||||
proficiency: ProficiencySchema,
|
||||
propertySlot: ComputedSlotSchema,
|
||||
roll: RollSchema,
|
||||
savingThrow: ComputedSavingThrowSchema,
|
||||
skill: ComputedSkillSchema,
|
||||
propertySlot: ComputedSlotSchema,
|
||||
slotFiller: SlotFillerSchema,
|
||||
spellList: ComputedSpellListSchema,
|
||||
spell: ComputedSpellSchema,
|
||||
toggle: ToggleSchema,
|
||||
|
||||
@@ -16,6 +16,7 @@ import { RollSchema } from '/imports/api/properties/Rolls.js';
|
||||
import { SavingThrowSchema } from '/imports/api/properties/SavingThrows.js';
|
||||
import { SkillSchema } from '/imports/api/properties/Skills.js';
|
||||
import { SlotSchema } from '/imports/api/properties/Slots.js';
|
||||
import { SlotFillerSchema } from '/imports/api/properties/SlotFillers.js';
|
||||
import { SpellListSchema } from '/imports/api/properties/SpellLists.js';
|
||||
import { SpellSchema } from '/imports/api/properties/Spells.js';
|
||||
import { ToggleSchema } from '/imports/api/properties/Toggles.js';
|
||||
@@ -36,10 +37,11 @@ const propertySchemasIndex = {
|
||||
folder: FolderSchema,
|
||||
note: NoteSchema,
|
||||
proficiency: ProficiencySchema,
|
||||
propertySlot: SlotSchema,
|
||||
roll: RollSchema,
|
||||
savingThrow: SavingThrowSchema,
|
||||
skill: SkillSchema,
|
||||
propertySlot: SlotSchema,
|
||||
slotFiller: SlotFillerSchema,
|
||||
spellList: SpellListSchema,
|
||||
spell: SpellSchema,
|
||||
toggle: ToggleSchema,
|
||||
|
||||
Reference in New Issue
Block a user