add VorNachteil

This commit is contained in:
Sven Balzer 2024-12-05 23:56:22 +01:00
parent 5ef47a483f
commit 3dff7555e5
7 changed files with 116 additions and 13 deletions

View File

@ -94,6 +94,44 @@
<span>{{actor.system.computed.fk_basiswert}}</span> <span>{{actor.system.computed.fk_basiswert}}</span>
</div> </div>
<div class="grid2 gap">
<div class="list Vorteile">
<div class="list-header">
<div>{{localize (concat "DSA41.vornachteil.label_vorteile")}}</div>
</div>
{{#each actor.itemTypes.VorNachteil}}
{{#if (eq system.kategorie "vorteil")}}
<div class="list-item" data-item-id="{{_id}}">
<div>
<div class="fit-content" data-action="item-open" data-tooltip="<h4>{{name}}</h4>{{system.beschreibung}}">{{maybeLocalize name prefix=(concat "DSA41.vornachteil." system.kategorie ".name")}}</div>
</div>
<div></div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/if}}
{{/each}}
</div>
<div class="list Nachteile subgrid-rows">
<div class="list-header">
<div>{{localize (concat "DSA41.vornachteil.label_nachteile")}}</div>
</div>
{{#each actor.itemTypes.VorNachteil}}
{{#if (eq system.kategorie "nachteil")}}
<div class="list-item" data-item-id="{{_id}}">
<div>
<div class="fit-content" data-action="item-open" data-tooltip="<h4>{{name}}</h4>{{system.beschreibung}}">{{maybeLocalize name prefix=(concat "DSA41.vornachteil." system.kategorie ".name")}}</div>
</div>
<div></div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/if}}
{{/each}}
</div>
</div>
<div class="list Sonderfertigkeiten"> <div class="list Sonderfertigkeiten">
<div class="list-header"> <div class="list-header">
<div>{{localize (concat "DSA41.sonderfertigkeiten.label_allgemein")}}</div> <div>{{localize (concat "DSA41.sonderfertigkeiten.label_allgemein")}}</div>

View File

@ -0,0 +1,23 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
<div class="grid2 gap">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
{{>editable-input type="number" name="system.kosten" value=item.system.kosten placeholder=(localize "DSA41.vornachteil.kosten")}}
</div>
<div>
<select name="system.kategorie">
<option value="vorteil" {{#if (eq item.system.kategorie "vorteil") }}selected{{/if}}>{{localize "DSA41.vornachteil.kategorie.vorteil"}} </option>
<option value="nachteil" {{#if (eq item.system.kategorie "nachteil")}}selected{{/if}}>{{localize "DSA41.vornachteil.kategorie.nachteil"}} </option>
</select>
<div class="placeholder">{{localize "DSA41.vornachteil.kategorie.label"}}</div>
</div>
</div>
</div>
<div>
<prose-mirror name="system.beschreibung" value="{{item.system.beschreibung}}" compact="true">
</prose-mirror>
</div>
</div>

View File

@ -4,7 +4,9 @@
"Gegenstand": "Gegenstand", "Gegenstand": "Gegenstand",
"Ruestung": "Rüstung", "Ruestung": "Rüstung",
"Bewaffnung": "Bewaffnung", "Bewaffnung": "Bewaffnung",
"Talent": "Talent" "Talent": "Talent",
"Sonderfertigkeit": "Sonderfertigkeit",
"VorNachteil": "Vor-/Nachteil"
} }
}, },
@ -29,6 +31,20 @@
"talentwert_short": "TaW" "talentwert_short": "TaW"
}, },
"vornachteil": {
"label_vorteile": "Vorteile",
"label_nachteile": "Nachteile",
"kosten": "Kosten",
"kategorie": {
"label": "Kategorie",
"vorteil": "Vorteil",
"nachteil": "Nachteil"
}
},
"sonderfertigkeiten": { "sonderfertigkeiten": {
"label_allgemein": "Allgemeine Sonderfertigkeiten", "label_allgemein": "Allgemeine Sonderfertigkeiten",
"label_kampf": "Kampf-Sonderfertigkeiten", "label_kampf": "Kampf-Sonderfertigkeiten",

View File

@ -204,6 +204,9 @@
& .list { & .list {
display: grid; display: grid;
grid-template-rows: max-content;
grid-auto-rows: max-content;
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45); box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
@ -291,6 +294,14 @@
& .Sonderfertigkeiten { & .Sonderfertigkeiten {
grid-template-columns: minmax(min-content, max-content) auto min-content; grid-template-columns: minmax(min-content, max-content) auto min-content;
} }
& .Vorteile {
grid-template-columns: minmax(min-content, max-content) auto min-content;
}
& .Nachteile {
grid-template-columns: minmax(min-content, max-content) auto min-content;
}
} }
&[data-tab="tab2"] { &[data-tab="tab2"] {

View File

@ -19,6 +19,7 @@ Hooks.once("init", async function() {
CONFIG.Item.dataModels.Bewaffnung = DSA41_BewaffnungData; CONFIG.Item.dataModels.Bewaffnung = DSA41_BewaffnungData;
CONFIG.Item.dataModels.Talent = DSA41_TalentData; CONFIG.Item.dataModels.Talent = DSA41_TalentData;
CONFIG.Item.dataModels.Sonderfertigkeit = DSA41_SonderfertigkeitData; CONFIG.Item.dataModels.Sonderfertigkeit = DSA41_SonderfertigkeitData;
CONFIG.Item.dataModels.VorNachteil = DSA41_VorNachteilData;
DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet); DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet);
DocumentSheetConfig.registerSheet(Actor, "dsa41", DSA41_ActorSheet, { DocumentSheetConfig.registerSheet(Actor, "dsa41", DSA41_ActorSheet, {
@ -37,6 +38,7 @@ Hooks.once("init", async function() {
"Bewaffnung", "Bewaffnung",
"Talent", "Talent",
"Sonderfertigkeit", "Sonderfertigkeit",
"VorNachteil",
] ]
}); });
@ -548,6 +550,17 @@ class DSA41_SonderfertigkeitData extends TypeDataModel {
} }
} }
class DSA41_VorNachteilData extends TypeDataModel {
static defineSchema() {
return {
kategorie: new StringField(),
kosten: new NumberField({ integer: true, initial: 0 }),
beschreibung: new StringField(),
};
}
}
function DSA41_ApplicationMixin(BaseApplication) { function DSA41_ApplicationMixin(BaseApplication) {
class DSA41_Application extends HandlebarsApplicationMixin(BaseApplication) { class DSA41_Application extends HandlebarsApplicationMixin(BaseApplication) {
static DEFAULT_OPTIONS= { static DEFAULT_OPTIONS= {
@ -884,6 +897,7 @@ class DSA41_ItemSheetV2 extends DSA41_ApplicationMixin(ItemSheetV2) {
Ruestung: { template: "systems/dsa-4th-edition/src/ItemSheets/Ruestung.hbs" }, Ruestung: { template: "systems/dsa-4th-edition/src/ItemSheets/Ruestung.hbs" },
Talent: { template: "systems/dsa-4th-edition/src/ItemSheets/Talent.hbs" }, Talent: { template: "systems/dsa-4th-edition/src/ItemSheets/Talent.hbs" },
Sonderfertigkeit: { template: "systems/dsa-4th-edition/src/ItemSheets/Sonderfertigkeit.hbs" }, Sonderfertigkeit: { template: "systems/dsa-4th-edition/src/ItemSheets/Sonderfertigkeit.hbs" },
VorNachteil: { template: "systems/dsa-4th-edition/src/ItemSheets/VorNachteil.hbs" },
}; };
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {

View File

@ -15,7 +15,8 @@
"Bewaffnung": {}, "Bewaffnung": {},
"Talent": {}, "Talent": {},
"Sonderfertigkeit": {} "Sonderfertigkeit": {},
"VorNachteil": {}
} }
}, },