Files
fvtt-hamalron/module/models/tarot.mjs
T

26 lines
1.2 KiB
JavaScript

import { SYSTEM } from "../config/system.mjs";
export default class HamalronTarot extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
const schema = {};
schema.type = new fields.StringField({ required: true, nullable: false, choices: Object.fromEntries(Object.entries(SYSTEM.TAROT_TYPES).map(([key, val]) => [key, val.label])), initial: "atout" });
schema.symbole = new fields.StringField({ required: true, nullable: false, choices: Object.fromEntries(Object.entries(SYSTEM.TAROT_SYMBOLES).map(([key, val]) => [key, val.label])), initial: "coupe" });
schema.valeur = new fields.StringField({
required: true, nullable: false, choices: Object.fromEntries(Object.entries(SYSTEM.TAROT_VALEURS).map(([key, val]) => [key, val.label])), initial: "1"
});
schema.description = new fields.HTMLField({ required: true, textSearch: true });
schema.image = new fields.FilePathField({
required: false,
categories: ["IMAGE"],
initial: "systems/fvtt-hamalron/assets/icons/tarot.svg",
})
return schema;
}
/** @override */
static LOCALIZATION_PREFIXES = ["HAMALRON.Tarot"];
}