From 17936bcd83790051268a8606d76f9b19a3040d3f Mon Sep 17 00:00:00 2001 From: LeFrique Date: Fri, 23 Feb 2024 17:37:42 +0100 Subject: [PATCH] Fixing Branch Update + Merged develop and solved merge conflicts + Added missing weight after update + Cleaned up not neaded parseFloat --- source/module/actors/M5Character.ts | 6 +- templates/sheets/character/gear.hbs | 129 ++++++---------------------- 2 files changed, 31 insertions(+), 104 deletions(-) diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index b691ef3..aacb4e6 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -204,7 +204,7 @@ export class M5Character extends Actor { ret.stats.heavyLoad = M5Character.heavyLoadValue(data.attributes.st); ret.stats.loadMax = M5Character.maxLoadValue(data.attributes.st); ret.stats.thrustLoad = M5Character.thrustLoadValue(data.attributes.st); - ret.stats.encumbrance = parseFloat((0).toPrecision(4)); + ret.stats.encumbrance = 0; if (!skip?.mods) { const aggregate = new M5ModAggregate(data, ret); @@ -472,9 +472,9 @@ export class M5Character extends Actor { const item = context.items.filter((x) => x.name === "Höchstlast"); if (ret.stats.encumbrance > ret.stats.loadMax) { if (item.length === 0) { - let messageContent = `Höchstlast von ${M5Character.name} überschritten: 1 AP Schaden durch Belastung alle 10 Minuten abziehen!`; + let messageContent = `Höchstlast wurde überschritten: 1 AP Schaden durch Belastung alle 10 Minuten abziehen!`; let chatData = { - speaker: ChatMessage.getSpeaker({actor: M5Character.name}), + speaker: ChatMessage.getSpeaker({actor: Actor.name}), content: messageContent, }; ChatMessage.create(chatData, {}); diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index ea6cfac..d5ef84b 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -37,6 +37,7 @@ {{localize "TYPES.Item.container"}} {{localize "midgard5.item-value"}} + {{localize "midgard5.item-weight"}} @@ -54,6 +55,11 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} + + {{#unless (or (eq item.weight "") (eq item.equipped?))}} + {{item.weight}} kg + {{/unless}} + {{#if item.equipped}} @@ -83,6 +89,7 @@ {{localize "TYPES.Item.item"}} {{localize "midgard5.item-quantity"}} {{localize "midgard5.item-value"}} + {{localize "midgard5.item-weight"}}   @@ -106,6 +113,11 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} + + {{#unless (or (eq item.weight "") (eq item.equipped?))}} + {{item.weight}} kg + {{/unless}} + {{#if item.equipped}} @@ -130,6 +142,11 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} + + {{#unless (or (eq item.weight "") (eq item.equipped?))}} + {{item.weight}} kg + {{/unless}} + {{#if item.equipped}} @@ -154,6 +171,11 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} + + {{#unless (or (eq item.weight "") (eq item.equipped?))}} + {{item.weight}} kg + {{/unless}} + {{#if item.equipped}} @@ -178,6 +200,11 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} + + {{#unless (or (eq item.weight "") (eq item.equipped?))}} + {{item.weight}} kg + {{/unless}} + {{#if item.equipped}} @@ -388,7 +415,7 @@
-
Lasten in Kilogramm
+
Lasten in Kilogramm
@@ -411,105 +438,5 @@
- -
-
{{localize "TYPES.Item.container"}}
- - - - - - - - - - - - - - {{#each data.calc.gear.containers as |item itemId|}} - - - - - - - - - {{/each}} - -
{{localize "TYPES.Item.container"}}{{localize "midgard5.item-value"}}{{localize "midgard5.item-weight"}}
- {{item.label}} - - {{#unless (or (eq item.value 0) (eq item.currency ""))}} - {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} - {{/unless}} - - {{#unless (or (eq item.weight "") (eq item.equipped?))}} - {{item.weight}} kg - {{/unless}} - - {{#if item.equipped}} - - {{else}} - - {{/if}} - {{#if item.rollExist}}{{/if}}
-
- - {{#each data.calc.gear.containers as |container containerId|}} -
-
{{container.label}}
- - - - - - - - - - - - - - - {{#each ../data.calc.gear.items as |item itemId|}} - {{#if (eq item.containerId containerId)}} - - - - - - - - - - {{/if}} - {{/each}} - -
{{localize "TYPES.Item.item"}}{{localize "midgard5.item-quantity"}}{{localize "midgard5.item-value"}}{{localize "midgard5.item-weight"}} 
- {{item.label}} - - - {{item.quantity}} - - - {{#unless (or (eq item.value 0) (eq item.currency ""))}} - {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} - {{/unless}} - - {{#unless (or (eq item.weight "") (eq item.equipped?))}} - {{item.weight}} kg - {{/unless}} - - {{#if item.equipped}} - - {{else}} - - {{/if}} - {{#if item.rollExist}}{{/if}}
-
- {{/each}}
\ No newline at end of file