From 8a9627c2784583ee355564e2039e2cacee90667a Mon Sep 17 00:00:00 2001 From: hjmaier <51607746+hjmaier@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:28:31 +0100 Subject: [PATCH] V 0.01 --- README.md | 2 + lang/de.json | 17 ++++++ less/Character-sheet.less | 16 ++++++ less/item-sheet.less | 16 ++++++ less/midgard5.less | 4 ++ midgard5.css | 24 ++++++++ midgard5.js | 12 ++++ module/sheets/m5CharacterSheet.js | 15 +++++ module/sheets/m5ItemSheet.js | 14 +++++ system.json | 31 +++++++++++ template.json | 75 +++++++++++++++++++++++++ templates/sheets/m5Character-Sheet.hbs | 77 ++++++++++++++++++++++++++ templates/sheets/m5Item-Sheet.hbs | 27 +++++++++ 13 files changed, 330 insertions(+) create mode 100644 README.md create mode 100644 lang/de.json create mode 100644 less/Character-sheet.less create mode 100644 less/item-sheet.less create mode 100644 less/midgard5.less create mode 100644 midgard5.css create mode 100644 midgard5.js create mode 100644 module/sheets/m5CharacterSheet.js create mode 100644 module/sheets/m5ItemSheet.js create mode 100644 system.json create mode 100644 template.json create mode 100644 templates/sheets/m5Character-Sheet.hbs create mode 100644 templates/sheets/m5Item-Sheet.hbs diff --git a/README.md b/README.md new file mode 100644 index 0000000..c526541 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Midgard 5 für FoundryVTT +Midgard M5 diff --git a/lang/de.json b/lang/de.json new file mode 100644 index 0000000..c359d9a --- /dev/null +++ b/lang/de.json @@ -0,0 +1,17 @@ +{ + "ACTOR.TypeCharacter": "Spielfigur", + "ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur", + "ACTOR.TypeVehicle": "Transportmittel / Pferd etc.", + "ITEM.TypeItem": "Gegenstand", + "midgard5.description": "Beschreibung", + "midgard5.item.value": "Wert", + "midgard5.quantity": "Menge", + "midgard5.ismagic": "Ist Magisch", + "midgard5.lp": "Lebenspunkte", + "midgard5.ap": "Ausdauerpunkte", + "midgard5.gw": "Gewandheit", + "midgard5.bonus": "Bonus", + "midgard5.aktuell": "Akt.", + "midgard5.maximum": "Max.", + "midgard5.attrvalue": "Wert" +} diff --git a/less/Character-sheet.less b/less/Character-sheet.less new file mode 100644 index 0000000..e1f4dab --- /dev/null +++ b/less/Character-sheet.less @@ -0,0 +1,16 @@ +// main: midgard5.less + +.midgard5.sheet.character { + form { + display: flex; + flex-direction: column; + } + .sheet-content { + height: 100%; + display: flex; + flex-direction: column; + .editor { + height: 100%; + } + } +} diff --git a/less/item-sheet.less b/less/item-sheet.less new file mode 100644 index 0000000..1f1922c --- /dev/null +++ b/less/item-sheet.less @@ -0,0 +1,16 @@ +// main: midgard5.less + +.midgard5.sheet.item { + form { + display: flex; + flex-direction: column; + } + .sheet-content { + height: 100%; + display: flex; + flex-direction: column; + .editor { + height: 100%; + } + } +} diff --git a/less/midgard5.less b/less/midgard5.less new file mode 100644 index 0000000..56e1890 --- /dev/null +++ b/less/midgard5.less @@ -0,0 +1,4 @@ +//out: ../midgard5.css + +@import "./item-sheet.less"; +@import "./Character-sheet.less"; diff --git a/midgard5.css b/midgard5.css new file mode 100644 index 0000000..2aac189 --- /dev/null +++ b/midgard5.css @@ -0,0 +1,24 @@ +.midgard5.sheet.item form { + display: flex; + flex-direction: column; +} +.midgard5.sheet.item .sheet-content { + height: 100%; + display: flex; + flex-direction: column; +} +.midgard5.sheet.item .sheet-content .editor { + height: 100%; +} +.midgard5.sheet.character form { + display: flex; + flex-direction: column; +} +.midgard5.sheet.character .sheet-content { + height: 100%; + display: flex; + flex-direction: column; +} +.midgard5.sheet.character .sheet-content .editor { + height: 100%; +} diff --git a/midgard5.js b/midgard5.js new file mode 100644 index 0000000..b8df74c --- /dev/null +++ b/midgard5.js @@ -0,0 +1,12 @@ +import m5ItemSheet from "./module/sheets/m5ItemSheet.js"; +import m5CharacterSheet from "./module/sheets/m5CharacterSheet.js"; + +Hooks.once("init", function () { + console.log("M5 | Initialisierung Midgard 5"); + + Items.unregisterSheet("core", ItemSheet); + Items.registerSheet("midgard5", m5ItemSheet, { makeDefault: true }); + + Actors.unregisterSheet("core", ActorSheet); + Actors.registerSheet("midgard5", m5CharacterSheet, { makeDefault: true }); +}); diff --git a/module/sheets/m5CharacterSheet.js b/module/sheets/m5CharacterSheet.js new file mode 100644 index 0000000..bf0ddd7 --- /dev/null +++ b/module/sheets/m5CharacterSheet.js @@ -0,0 +1,15 @@ +export default class m5CharacterSheet extends ActorSheet { + + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + template: "systems/midgard5/templates/sheets/m5Character-Sheet.hbs", + width: 530, + height: 400, + classes: ["midgard5", "sheet", "character"] + }); + } + + // get template() { + // return 'systems/midgard5/templates/sheets/m5Character-Sheet.hbs'; + // } + } \ No newline at end of file diff --git a/module/sheets/m5ItemSheet.js b/module/sheets/m5ItemSheet.js new file mode 100644 index 0000000..22ca65c --- /dev/null +++ b/module/sheets/m5ItemSheet.js @@ -0,0 +1,14 @@ +export default class m5ItemSheet extends ItemSheet { + + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + width: 530, + height: 340, + classes: ["midgard5", "sheet", "item"] + }); + } + + get template() { + return 'systems/midgard5/templates/sheets/m5Item-Sheet.hbs'; + } +} diff --git a/system.json b/system.json new file mode 100644 index 0000000..ecd955c --- /dev/null +++ b/system.json @@ -0,0 +1,31 @@ +{ + "name": "midgard5", + "title": "Midgard 5. Edition", + "description": "Midgard 5. Edition", + "version": 0.01, + "minimumCoreVersion": "0.7.9", + "compatibleCoreVersion": "0.7.9", + "templateVersion": 2, + "author": "Hans-Joachim Maier", + "esmodules": [ + "midgard5.js" + ], + "styles": [ + "midgard5.css" + ], + "packs": [], + "languages": [ + { + "lang": "de", + "name": "Deutsch", + "path": "lang/de.json" + } + ], + "gridDistance": 1, + "gridUnits": "m", + "primaryTokenAttribute": "lp", + "secondaryTokenAttribute": "ap", + "url": "https://github.com/GateKept/flatpacktemplate", + "manifest": "https://github.com/GateKept/flatpacktemplate/blob/master/system.json", + "initiative": "@gw.value + @gw.bonus" +} diff --git a/template.json b/template.json new file mode 100644 index 0000000..515f860 --- /dev/null +++ b/template.json @@ -0,0 +1,75 @@ +{ + "Actor":{ + "types":[ + "npc", + "character" + ], + "templates":{ + "characterDescription": { + "description": " " + }, + "characterBars":{ + "lp":{ + "value":10, + "min":0, + "max":10 + }, + "ap":{ + "value":5, + "min":0, + "max":5 + } + }, + "attributes":{ + "gw": { + "value": 50, + "bonus": 0 + } + } + }, + "character":{ + "templates": [ + "characterBars", + "attributes", + "characterDescription" + ] + }, + "npc":{ + "templates": [ + "characterBars", + "attributes", + "characterDescription" + ] + }, + "vehicle":{ + "templates": [ + "characterBars", + "attributes" + ] + } + }, + "Item":{ + "types":[ + "item" + ], + "templates":{ + "itemDescription": { + "description": " " + } + }, + "item":{ + "templates":[ + "itemDescription" + ], + "quantity":1, + "weight":0, + "magic":false, + "attributes":{ + + }, + "groups":{ + + } + } + } +} diff --git a/templates/sheets/m5Character-Sheet.hbs b/templates/sheets/m5Character-Sheet.hbs new file mode 100644 index 0000000..9dc8e36 --- /dev/null +++ b/templates/sheets/m5Character-Sheet.hbs @@ -0,0 +1,77 @@ +
\ No newline at end of file diff --git a/templates/sheets/m5Item-Sheet.hbs b/templates/sheets/m5Item-Sheet.hbs new file mode 100644 index 0000000..fd317aa --- /dev/null +++ b/templates/sheets/m5Item-Sheet.hbs @@ -0,0 +1,27 @@ + \ No newline at end of file