repairs skill sheet and buries display of skill requirements, for now.

pull/58/head
macniel 2025-10-14 14:11:20 +02:00
parent 09db6091ba
commit 6d178b8793
2 changed files with 22 additions and 7 deletions

View File

@ -1,6 +1,14 @@
import BaseItem from "./base-item.mjs";
const {BooleanField, ArrayField, NumberField, SchemaField, StringField, HTMLField} = foundry.data.fields;
const {
BooleanField,
DocumentIdField,
ArrayField,
NumberField,
SchemaField,
StringField,
HTMLField
} = foundry.data.fields;
export class SkillDataModel extends BaseItem {
@ -13,9 +21,9 @@ export class SkillDataModel extends BaseItem {
pa: new NumberField({required: false, integer: true, nullable: true, initial: 0}),
probe: new ArrayField(new StringField(), {exact: 3}), // References one of the eight attributes by name
voraussetzung: new SchemaField({
talent: new StringField({model: SkillDataModel}),
wert: new NumberField({}),
}), // Required skills at a given level
talent: new DocumentIdField(),
wert: new NumberField(),
}, {required: false}), // Required skills at a given level
talent: new HTMLField({required: true}),
behinderung: new NumberField({required: false}), // BE-X
komplexität: new NumberField({required: false}), // In case of languages

View File

@ -9,7 +9,7 @@ export class SkillSheet extends foundry.appv1.sheets.ItemSheet {
{
navSelector: '.sheet-tabs',
contentSelector: '.sheet-body',
initial: 'description',
initial: 'meta',
},
],
});
@ -40,11 +40,16 @@ export class SkillSheet extends foundry.appv1.sheets.ItemSheet {
Gesellschaft: "Gesellschaft",
Natur: "Natur",
Wissen: "Wissen",
Sprachen: "Sprache",
Sprachen: "Sprachen",
Schriften: "Schriften",
Handwerk: "Handwerk"
}
context.isCombat = context.system.gruppe === "Kampf"
context.isTalent = context.system.gruppe !== "Kampf"
context.isLanguage = context.system.gruppe === "Sprachen" || context.system.gruppe === "Schriften"
context.hasRequirement = context.system.voraussetzung.talent != null
return context;
}
@ -52,7 +57,9 @@ export class SkillSheet extends foundry.appv1.sheets.ItemSheet {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.isEditable)
if (!this.isEditable) {
}
}
}