change Kampftalent.system.kategorie to be choices based and use DSA41_input

This commit is contained in:
Sven Balzer 2025-05-04 11:35:56 +02:00
parent f296b2280d
commit e7f6e91516
2 changed files with 10 additions and 6 deletions

View File

@ -12,11 +12,7 @@
</div>
<div class="grid gap">
<div>
<select name="system.kategorie">
<option value="waffenlos" {{#if (eq item.system.kategorie "waffenlos")}}selected{{/if}}>{{localize "DSA41.kampftalent.kategorie.waffenlos"}}</option>
<option value="nahkampf" {{#if (eq item.system.kategorie "nahkampf") }}selected{{/if}}>{{localize "DSA41.kampftalent.kategorie.nahkampf"}} </option>
<option value="fernkampf" {{#if (eq item.system.kategorie "fernkampf")}}selected{{/if}}>{{localize "DSA41.kampftalent.kategorie.fernkampf"}}</option>
</select>
{{DSA41_input "system.kategorie"}}
<div class="placeholder">{{localize "DSA41.talente.label_kategorie"}}</div>
</div>
</div>

View File

@ -800,7 +800,15 @@ class DSA41_TalentData extends TypeDataModel {
class DSA41_KampftalentData extends TypeDataModel {
static defineSchema() {
return {
kategorie: new StringField({ initial: "waffenlos" }),
kategorie: new StringField({
required: true,
choices: {
"waffenlos": "DSA41.kampftalent.kategorie.waffenlos",
"nahkampf": "DSA41.kampftalent.kategorie.nahkampf",
"fernkampf": "DSA41.kampftalent.kategorie.fernkampf",
},
initial: "waffenlos"
}),
behinderung: new StringField({ initial: "" }),
steigern: new SteigerungsKategorieField(),