adds ruletext and requisite

pull/14/head
macniel 2025-09-25 20:58:57 +02:00
parent 2414f3b8f3
commit 51ad48d058
4 changed files with 55 additions and 22 deletions

View File

@ -1,4 +1,4 @@
const { BooleanField, NumberField, SchemaField, SetField, StringField } = foundry.data.fields;
const { BooleanField, NumberField, SchemaField, SetField, StringField, HtmlField } = foundry.data.fields;
export class Skill extends foundry.abstract.TypeDataModel {
@ -9,6 +9,8 @@ export class Skill extends foundry.abstract.TypeDataModel {
attributeReference1: new StringField(), // References one of the eight attributes by name
attributeReference2: new StringField(), // References one of the eight attributes by name
attributeReference3: new StringField(), // References one of the eight attributes by name
requisite: new StringField(), // Required skills at a given level
text: new HtmlField(),
handicapValue: new NumberField(), // BE-X
complexity: new NumberField(), // In case of languages
derivedAttribute1: new NumberField(),

View File

@ -34,6 +34,15 @@ export class SkillSheet extends ItemSheet {
// Add the actor's data to context.data for easier access, as well as flags.
context.system = skillData.system;
context.flags = skillData.flags;
context.categoryOptions = {
combat: "Kampf",
physical: "Körperlich",
social: "Gesellschaft",
survival: "Natur",
knowledge: "Wissen",
languages: "Sprache und Schriften",
crafting: "Handwerk"
}
return context;
}

View File

@ -44,8 +44,9 @@
},
"Item": {
"skill": {
"StringField": ["name", "category", "attributeReference1", "attributeReference2", "attributeReference3"],
"NumberField": ["handicapValue", "complexity"]
"StringField": ["name", "category", "attributeReference1", "attributeReference2", "attributeReference3", "requisite"],
"NumberField": ["handicapValue", "complexity"],
"HtmlField": ["text"]
}
}
},

View File

@ -3,35 +3,56 @@
{{!-- Sheet Header --}}
<header class="sheet-header">
{{!-- Header stuff goes here --}}
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100"/>
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100" />
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="meta">Talent</a>
<a class="item" data-tab="description">Regeltext</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="form-fields">
<label>Erstes Attribut
<input type="text" name="system.attributeReference1.value" value="{{system.attributeReference1.value}}" />
</label>
<label>Zweites Attribut
<input type="text" name="system.attributeReference2.value" value="{{system.attributeReference2.value}}" />
</label>
<label>Drittes Attribut
<input type="text" name="system.attributeReference3.value" value="{{system.attributeReference3.value}}" />
</label>
<label>Behinderung
<input type="text" name="system.hanidcapValue.value" value="{{system.handicapValue.value}}" />
</label>
<label>Sprachenkomplexizität
<input type="text" name="system.complexity.value" value="{{system.complexity.value}}" />
</label>
<div class="tab meta" data-group="primary" data-tab="meta">
<label>Kategorie
<select type="text" name="system.category.value">
{{selectOptions categoryOptions selected=value}}
</select>
</label>
<label>Erstes Attribut
<input type="text" name="system.attributeReference1.value"
value="{{system.attributeReference1.value}}" />
</label>
<label>Zweites Attribut
<input type="text" name="system.attributeReference2.value"
value="{{system.attributeReference2.value}}" />
</label>
<label>Drittes Attribut
<input type="text" name="system.attributeReference3.value"
value="{{system.attributeReference3.value}}" />
</label>
<label>Behinderung
<input type="text" name="system.hanidcapValue.value" value="{{system.handicapValue.value}}" />
</label>
<label>Sprachenkomplexizität
<input type="text" name="system.complexity.value" value="{{system.complexity.value}}" />
</label>
</div>
<div class="tab description" data-group="primary" data-tab="description">
<label>Beschreibungstext
{{editor system.text target="system.text" button=true owner=owner editable=editable}}
</label>
<label>Voraussetzung
<input type="text" name="system.requisite.value" value="{{system.requisite.value}}" />
</label>
</div>
</div>
</section>
</form>