From 3bb5e087afa94941e2d12248008acf8afe84f728 Mon Sep 17 00:00:00 2001 From: Byroks Date: Thu, 28 Mar 2024 21:26:26 +0100 Subject: [PATCH 1/3] Done --- lang/de.json | 12 ++++++++++++ source/helpers.ts | 4 ++++ source/module/actors/M5Character.ts | 1 + templates/sheets/character/spells.hbs | 26 ++++++++++++++++++++++++++ templates/sheets/item/class.hbs | 2 +- 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/lang/de.json b/lang/de.json index 6f95cdd..d976b42 100644 --- a/lang/de.json +++ b/lang/de.json @@ -161,6 +161,7 @@ "midgard5.faelschen": "Fälschen", "midgard5.fangen": "Fangen", "midgard5.fechten": "Fechten", + "midgard5.fechtkunst": "Fechtkunst", "midgard5.feueralchimie": "Feueralchimie", "midgard5.gassenwissen": "Gassenwissen", "midgard5.gaukeln": "Gaukeln", @@ -286,6 +287,16 @@ "midgard5.attack": "Angriff", "midgard5.damage": "Schaden", + "midgard5.skill-goup-alltag": "Alltag", + "midgard5.skill-goup-freiland": "Freiland", + "midgard5.skill-goup-halbwelt": "Halbwelt", + "midgard5.skill-goup-kampf": "Kampf", + "midgard5.skill-goup-koerper": "Körper", + "midgard5.skill-goup-sozial": "Sozial", + "midgard5.skill-goup-unterwelt": "Unterwelt", + "midgard5.skill-goup-waffen": "Waffen", + "midgard5.skill-goup-wissen": "Wissen", + "midgard5.spell-process-none": "Ohne", "midgard5.spell-process-artefakte": "Artefakte", "midgard5.spell-process-beherrschen": "Beherrschen", @@ -304,6 +315,7 @@ "midgard5.spell-process-nekromantie": "Nekromantie", "midgard5.spell-process-runenstaebe": "Runenstäbe", "midgard5.spell-process-thaumatherapie": "Thaumatherapie", + "midgard5.spell-process-thaumagraphie": "Thaumagraphie", "midgard5.spell-process-veraendern": "Verändern", "midgard5.spell-process-vigilsignien": "Vigilsignien", "midgard5.spell-process-wundertat": "Wundertat", diff --git a/source/helpers.ts b/source/helpers.ts index f0c0572..845cc7b 100644 --- a/source/helpers.ts +++ b/source/helpers.ts @@ -107,4 +107,8 @@ export const loadHelpers = async function () { } return length; }); + + Handlebars.registerHelper("console", (object: any) => { + console.log(object); + }); }; diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index 4b9546e..3f83d15 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -461,6 +461,7 @@ export class M5Character extends Actor { } else { item.system.equipped = true; data.info.magicUsing = item.system.magicUsing; + data.lernKostenZauber = item.system.lernKostenZauber; } if (typeof data.info.class === "string") { diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index 34fe0a0..4f7b9af 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -1,5 +1,8 @@
+ + + {{#console data }}{{/console}}
{{localize "midgard5.spellCasting"}}
@@ -77,4 +80,27 @@
+ +
+
+
{{localize "midgard5.pp"}} {{localize "midgard5.spells"}}
+ + + + + + +
+
+ + {{#each data.lernKostenZauber as |group name|}} + + + + + {{/each}} +
+
+
+
diff --git a/templates/sheets/item/class.hbs b/templates/sheets/item/class.hbs index 2d8e4ba..80604a3 100644 --- a/templates/sheets/item/class.hbs +++ b/templates/sheets/item/class.hbs @@ -49,7 +49,7 @@
{{#each data.lernKostenAllgemein as |wert name|}} - + {{/each}} -- 2.40.1 From 80bad6a6785ea6adb96d82f9def71d5f30a3fb31 Mon Sep 17 00:00:00 2001 From: Byroks Date: Thu, 28 Mar 2024 21:26:46 +0100 Subject: [PATCH 2/3] Update spells.hbs --- templates/sheets/character/spells.hbs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index 4f7b9af..eb0da4a 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -1,8 +1,4 @@
- - - - {{#console data }}{{/console}}
{{localize "midgard5.spellCasting"}}
-- 2.40.1 From 16b15fbd3ef00d6df5e5cc23b099c034607153fd Mon Sep 17 00:00:00 2001 From: Byroks Date: Fri, 29 Mar 2024 12:08:59 +0100 Subject: [PATCH 3/3] =?UTF-8?q?H=C3=A4ndisches=20increse=20&=20decrease=20?= =?UTF-8?q?von=20Zauber=20PP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/module/sheets/M5CharacterSheet.ts | 30 ++++++++++++++++++++++++ source/style/Character-sheet.less | 9 +++++++ templates/sheets/character/spells.hbs | 10 +++++--- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index 234c992..62b2e71 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -194,6 +194,36 @@ export default class M5CharacterSheet extends ActorSheet { }); }); + html.find(".pp-increase").on("click", async (event) => { + let target = event.target.closest("[data-pp-name]") as HTMLElement; + let ppName = target ? target.dataset.ppName : null; + const context = this.actor as any; + const item = context.items.find((x) => x.type === "class" && x.system.equipped); + item.update({ + system: { + lernKostenZauber: { + [ppName]: { pp: context.system.lernKostenZauber[ppName].pp + 1 }, + }, + }, + }); + this.render(); + }); + + html.find(".pp-decrease").on("click", async (event) => { + let target = event.target.closest("[data-pp-name]") as HTMLElement; + let ppName = target ? target.dataset.ppName : null; + const context = this.actor as any; + const item = context.items.find((x) => x.type === "class" && x.system.equipped); + item.update({ + system: { + lernKostenZauber: { + [ppName]: { pp: context.system.lernKostenZauber[ppName].pp - 1 }, + }, + }, + }); + this.render(); + }); + html.find(".fw-increase").on("click", async (event) => { let target = event.target.closest("[data-item-id]") as HTMLElement; let itemId = target ? target.dataset.itemId : null; diff --git a/source/style/Character-sheet.less b/source/style/Character-sheet.less index 898b404..e8ebd2c 100644 --- a/source/style/Character-sheet.less +++ b/source/style/Character-sheet.less @@ -388,4 +388,13 @@ .closebtn:hover { color: #000; } + + .pp-listing { + margin: 0 2rem; + flex: 1 0 16%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: baseline; + } } diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index eb0da4a..6884d0a 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -40,7 +40,7 @@ {{localize "midgard5.spell-effectDuration-short"}} {{localize "midgard5.ew"}} - + @@ -87,9 +87,13 @@
{{#each data.lernKostenZauber as |group name|}} - + - + + + + + {{/each}}
-- 2.40.1