register fields for database structur

pull/14/head
macniel 2025-09-25 20:37:44 +02:00
parent 81da532074
commit 2414f3b8f3
3 changed files with 33 additions and 3 deletions

View File

@ -19,4 +19,31 @@ export class SkillSheet extends ItemSheet {
get template() {
return `systems/DSA_4-1/templates/item/item-${this.item.type}-sheet.hbs`;
}
/** @override */
getData() {
// Retrieve the data structure from the base sheet. You can inspect or log
// the context variable to see the structure, but some key properties for
// sheets are the actor object, the data object, whether or not it's
// editable, the items array, and the effects array.
const context = super.getData();
// Use a safe clone of the actor data for further operations.
const skillData = context.data;
// Add the actor's data to context.data for easier access, as well as flags.
context.system = skillData.system;
context.flags = skillData.flags;
return context;
}
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.isEditable) return;
}
}

View File

@ -43,7 +43,10 @@
"character": {}
},
"Item": {
"skill": {}
"skill": {
"StringField": ["name", "category", "attributeReference1", "attributeReference2", "attributeReference3"],
"NumberField": ["handicapValue", "complexity"]
}
}
},
"socket": false,

View File

@ -18,10 +18,10 @@
<label>Erstes Attribut
<input type="text" name="system.attributeReference1.value" value="{{system.attributeReference1.value}}" />
</label>
<label>Erstes Attribut
<label>Zweites Attribut
<input type="text" name="system.attributeReference2.value" value="{{system.attributeReference2.value}}" />
</label>
<label>Erstes Attribut
<label>Drittes Attribut
<input type="text" name="system.attributeReference3.value" value="{{system.attributeReference3.value}}" />
</label>
<label>Behinderung