make empty lists show Keine
This commit is contained in:
parent
b83213fc0b
commit
d7779f3c48
@ -179,6 +179,10 @@
|
||||
<div>{{localize (concat "DSA41.vornachteil.label_vorteile")}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.system.computed.num_vorteile 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.VorNachteil}}
|
||||
{{#if (eq system.kategorie "vorteil")}}
|
||||
<div class="list-item" data-item-id="{{_id}}">
|
||||
@ -197,6 +201,10 @@
|
||||
<div>{{localize (concat "DSA41.vornachteil.label_nachteile")}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.system.computed.num_nachteile 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.VorNachteil}}
|
||||
{{#if (eq system.kategorie "nachteil")}}
|
||||
<div class="list-item" data-item-id="{{_id}}">
|
||||
@ -216,6 +224,10 @@
|
||||
<div>{{localize (concat "DSA41.sonderfertigkeiten.label_allgemein")}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.system.computed.num_allgemeine_sonderfertigkeiten 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.Sonderfertigkeit}}
|
||||
{{#if (eq this.system.kategorie "allgemein")}}
|
||||
<div class="list-item" data-item-id="{{_id}}">
|
||||
@ -285,6 +297,11 @@
|
||||
<div class="center">{{localize "DSA41.weight"}}</div>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.itemTypes.Bewaffnung.length 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.Bewaffnung}}
|
||||
<div class="list-item" data-item-id="{{this._id}}">
|
||||
<div class="row" data-action="item-open">
|
||||
@ -312,6 +329,11 @@
|
||||
<div></div>
|
||||
<div class="center">{{localize "DSA41.weight"}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.itemTypes.Ruestung.length 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.Ruestung}}
|
||||
<div class="list-item" data-item-id="{{this._id}}">
|
||||
<div class="row" data-action="item-open">
|
||||
@ -331,6 +353,11 @@
|
||||
<div></div>
|
||||
<div class="center">{{localize "DSA41.weight"}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.itemTypes.Gegenstand.length 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.Gegenstand}}
|
||||
<div class="list-item" data-item-id="{{this._id}}">
|
||||
<div class="row" data-action="item-open">
|
||||
@ -354,6 +381,10 @@
|
||||
<div class="center">{{localize "DSA41.kampf.trefferpunkte"}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (or (ne actor.system.computed.num_waffen 0) (ne actor.system.computed.num_fernkampf_waffen 0))}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.system.computed.kampf.waffen}}
|
||||
<div class="list-item" data-item-id="{{item._id}}">
|
||||
<div class="row" data-action="item-open">
|
||||
@ -445,6 +476,10 @@
|
||||
<div>{{localize (concat "DSA41.sonderfertigkeiten.label_kampf")}}</div>
|
||||
</div>
|
||||
|
||||
{{#unless (ne actor.system.computed.num_kampf_sonderfertigkeiten 0)}}
|
||||
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#each actor.itemTypes.Sonderfertigkeit}}
|
||||
{{#if (eq this.system.kategorie "kampf")}}
|
||||
<div class="list-item" data-item-id="{{_id}}">
|
||||
|
||||
@ -24,6 +24,8 @@
|
||||
"weight": "Gewicht",
|
||||
"price": "Preis",
|
||||
|
||||
"list_empty": "Keine",
|
||||
|
||||
"chat": {
|
||||
"result": "Ergebnis",
|
||||
"success": "Geschafft",
|
||||
|
||||
14
src/main.mjs
14
src/main.mjs
@ -255,6 +255,13 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
attributes: {},
|
||||
attributes_without_modifiers: {},
|
||||
|
||||
num_vorteile: 0,
|
||||
num_nachteile: 0,
|
||||
num_allgemeine_sonderfertigkeiten: 0,
|
||||
num_kampf_sonderfertigkeiten: 0,
|
||||
num_waffen: 0,
|
||||
num_fernkampf_waffen: 0,
|
||||
|
||||
kampf: {
|
||||
talente: {},
|
||||
waffen: {},
|
||||
@ -354,6 +361,7 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
|
||||
for(const item of equipped_nahkampfwaffen) {
|
||||
if (item.system.nahkampfwaffe.aktiv) {
|
||||
this.computed.num_waffen += 1;
|
||||
let computed = this.computed.kampf.waffen[item._id] = {
|
||||
item: item,
|
||||
attacke: 0,
|
||||
@ -417,6 +425,7 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
}
|
||||
|
||||
for (const item of equipped_fernkampfwaffen) {
|
||||
this.computed.num_fernkampf_waffen += 1;
|
||||
let computed = this.computed.kampf.fernkampf_waffen[item._id] = {
|
||||
item: item,
|
||||
attacke: 0,
|
||||
@ -446,6 +455,11 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
wissens: talente.filter((x) => x.system.kategorie === "wissens"),
|
||||
handwerks: talente.filter((x) => x.system.kategorie === "handwerks"),
|
||||
};
|
||||
|
||||
this.computed.num_allgemeine_sonderfertigkeiten = this.parent.items.filter((x) => x.type === "Sonderfertigkeit" && x.system.kategorie === "allgemein").length;
|
||||
this.computed.num_kampf_sonderfertigkeiten = this.parent.items.filter((x) => x.type === "Sonderfertigkeit" && x.system.kategorie === "kampf").length;
|
||||
this.computed.num_vorteile = this.parent.items.filter((x) => x.type === "VorNachteil" && x.system.kategorie === "vorteil").length;
|
||||
this.computed.num_nachteile = this.parent.items.filter((x) => x.type === "VorNachteil" && x.system.kategorie === "nachteil").length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user