Prepare for version 0.9 (#8)
Foundry VTT System Release / build-and-release (push) Failing after 3m47s

Reviewed-on: #8
Co-authored-by: Byroks <byroks@gmail.com>
This commit was merged in pull request #8.
This commit is contained in:
Byroks authored and Byroks committed 2026-10-26 18:48:35 +01:00
1 parent 9568be0211
commit 49b8eddf15
84 files changed
+8046 -468

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
name: Foundry VTT System Release
on:
push:
# Der Workflow startet, sobald ein Tag gepusht wird (z.B. v1.0.4)
# Das ist sicherer als jeder normale Merge auf Main, da du so die Versionskontrolle behältst.
tags:
- "v*"
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Node.js einrichten
uses: actions/setup-node@v4
with:
node-size: 20
- name: Abhängigkeiten installieren
run: npm ci
# Falls du Vite/Sass nutzt, entkommentiere die nächste Zeile, um dein CSS/JS zu bauen:
- name: System kompilieren
run: npm run vite:build
- name: Release-Dateien vorbereiten (Script ausführen)
env:
GITEA_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
GITEA_REF_NAME: ${{ gitea.ref_name }}
GITEA_REF_TYPE: ${{ gitea.ref_type }}
run: node release.js
- name: Gitea Release erstellen und Assets hochladen
uses: actions/create-release@v1
env:
# Dieser Token wird von Gitea automatisch bereitgestellt
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ gitea.ref_name }}
release_name: Release ${{ gitea.ref_name }}
draft: false
prerelease: false
# Hier laden wir die bearbeitete system.json und die zip hoch
files: |
system.json
system.zip
+1 -1
View File
@@ -1,4 +1,4 @@
# fvtt-ts-react-boilerplate # midgard6-lvd
A TypeScript + React + Vite boilerplate for building Foundry VTT (V14) game systems on top of **ApplicationV2**, with full type safety via [`fvtt-types`](https://github.com/League-of-Foundry-Developers/foundry-vtt-types). A TypeScript + React + Vite boilerplate for building Foundry VTT (V14) game systems on top of **ApplicationV2**, with full type safety via [`fvtt-types`](https://github.com/League-of-Foundry-Developers/foundry-vtt-types).
+9
View File
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" height="800px" width="800px" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 298.935 298.935" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 298.935 298.935">
<g>
<path d="m149.468,77.394c-44.435,0-73.694,25.159-80.457,80.457-4.127,33.746-15.998,88.94-20.955,111.298-1.243,5.607 1.945,11.256 7.394,13.073l48.379,16.136c3.303,1.102 6.93,0.608 9.819-1.336 2.889-1.944 4.711-5.119 4.934-8.594l4.251-66.347c0.293-4.568-2.218-8.856-6.345-10.837l-31.892-15.306c-4.189-2.01-5.955-7.035-3.944-11.224l7.592-15.82c0.965-2.012 2.69-3.557 4.795-4.297 2.105-0.74 4.418-0.613 6.429,0.353l32.174,15.442c3.892,1.868 6.367,5.802 6.367,10.119v41.797c0,0.839 0.262,1.658 0.75,2.341l7.43,10.401c0.756,1.059 1.977,1.687 3.278,1.687 1.301,0 2.521-0.628 3.278-1.687l7.43-10.401c0.488-0.683 0.75-1.502 0.75-2.341v-41.798c0-4.317 2.476-8.251 6.368-10.119l32.174-15.442c2.011-0.965 4.324-1.092 6.429-0.353 2.105,0.74 3.83,2.285 4.795,4.297l7.593,15.82c2.01,4.189 0.244,9.214-3.944,11.224l-31.892,15.306c-4.127,1.981-6.637,6.269-6.345,10.837l4.251,66.347c0.223,3.475 2.045,6.649 4.934,8.594 2.888,1.944 6.516,2.438 9.819,1.336l48.379-16.136c5.459-1.821 8.639-7.455 7.394-13.073-4.956-22.359-16.828-77.552-20.955-111.298-6.763-55.297-36.022-80.456-80.457-80.456z"/>
<path d="m259.957,43.655c-38.229-35.915-89.823-49.669-138.289-41.264-0.95,0.165-1.624,1.012-1.567,1.975l.875,14.836c0.01,0.168-0.107,0.318-0.273,0.348-0.166,0.031-0.328-0.067-0.379-0.228l-4.511-14.337c-0.277-0.881-1.151-1.432-2.066-1.305-5.355,0.742-8.924,1.306-14.283,3.693-0.785,0.35-1.235,1.186-1.097,2.034l4.069,24.987c0.066,0.404-0.132,0.805-0.493,0.998-0.361,0.193-0.804,0.136-1.104-0.143l-20.075-18.659c-0.573-0.533-1.416-0.658-2.119-0.315-14.207,6.92-27.602,16.047-39.666,27.38-0.976,0.917-1.54,2.19-1.562,3.53-0.021,1.34 0.501,2.63 1.449,3.578l34.041,34.041c1.87,1.87 4.881,1.935 6.834,0.152 39.382-35.976 100.072-35.976 139.454,0 1.955,1.786 4.962,1.721 6.834-0.152l34.041-34.041c0.947-0.947 1.468-2.239 1.447-3.578-0.021-1.34-0.584-2.613-1.56-3.53z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+7
View File
@@ -0,0 +1,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg fill="#000000" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64px" height="64px" viewBox="0 0 260 260" enable-background="new 0 0 260 260" xml:space="preserve">
␍<g id="SVGRepo_bgCarrier" stroke-width="0"/>
␍<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
␍<g id="SVGRepo_iconCarrier"> <path d="M258,2l-16,48L97.06,181.76l-7.23-11.14l-11.68-7.58L210,18L258,2z M101.029,238.26l11.314-11.314l-31.176-48.02 l-48.02-31.176l-11.314,11.314l31.386,31.386l-34.26,37.693c-4.464-0.586-9.138,0.82-12.568,4.249 c-5.858,5.858-5.858,15.355,0,21.213c5.858,5.858,15.355,5.858,21.213,0c3.428-3.428,4.834-8.1,4.25-12.562l37.695-34.262 L101.029,238.26z"/> </g>
␍</svg>

After

Width:  |  Height:  |  Size: 937 B

+192
View File
@@ -0,0 +1,192 @@
{
"Midgard6": {
"name": "Name",
"Angriff": "Angriff",
"Schaden": "Schaden",
"Zaubern": "Zaubern",
"Fertigkeit": "Fertigkeit",
"Stufe": "Stufe",
"Schicksalsmünzen": "Schicksalsmünzen",
"Grad": {
"grad": "Grad",
"frei": "frei",
"eingesetzt": "eingesetzt",
"gesamt": "gesamt",
"erfahrung": "Erfahrung"
},
"Biographie": {
"spezies": "Spezies",
"kultur": "Kultur",
"abenteuertyp": "Abenteuertyp",
"glaube": "Glaube",
"mondgestalt": "Mondgestalt"
},
"Dialog": {
"abbrechen": "Abbrechen",
"würfeln": "Würfeln",
"speichern": "Speichern",
"löschen": "Löschen"
},
"Gegenstand": {
"wert": "Wert",
"gewicht": "Gewicht",
"anzahl": "Anzahl"
},
"Skills": {
"gruppen": {
"kampf": "Kampf",
"geist": "Geist",
"körper": "Körper",
"ausdruck": "Ausdruck",
"magie": "Magie"
},
"athletik": "Athletik",
"anführen": "Anführen",
"beweglichkeit": "Beweglichkeit",
"bildung": "Bildung",
"darbietung": "Darbietung",
"einschüchterung": "Einschüchterung",
"empathie": "Empathie",
"fernkampf": "Fernkampf",
"fingerfertigkeit": "Fingerfertigkeit",
"gassenwissen": "Gassenwissen",
"handwerk": "Handwerk",
"heilkunst": "Heilkunst",
"heimlichkeit": "Heimlichkeit",
"kulturwissen": "Kulturwissen",
"nahkampf": "Nahkampf",
"manipulation": "Manipulation",
"thaumaturgie": "Thaumaturgie",
"tierführung": "Tierführung",
"überlebenskunst": "Überlebenskunst",
"überzeugen": "Überzeugen",
"wahrnehmung": "Wahrnehmung",
"zaubern": "Zaubern",
"zauberwissen": "Zauberwissen"
},
"Attribute": {
"resistenzen": "Resistenzen",
"lp": "LP",
"ap": "AP"
},
"Resistenzen": {
"reflexe": "Reflexe",
"willenskraft": "Willenskraft",
"zähigkeit": "Zähigkeit"
},
"aktuell": "Aktuell",
"maximal": {
"short": "Max.",
"long": "Maximal"
},
"Zauber": {
"zauberdauer": "Zauberdauer",
"reichweite": "Reichweite",
"wirkungsdauer": "Wirkungsdauer",
"schaden": "Schaden",
"stufe": "Stufe",
"ursprung": "Ursprung",
"ziel": "Ziel",
"wirkungsweise": "Wirkungsweise",
"vorgang": "Zaubervorgang",
"equipped": "Favorisiert"
},
"Sheets": {
"Tabs": {
"eigenschaften": "Fertigkeiten",
"items": "Gegenstände",
"effects": "Effekte",
"zauber": "Zauber",
"biographie": "Biographie",
"hintergrund": "Hintergrund",
"sperre": "Sperre"
},
"spezialisierung": "Spezialisierung"
},
"Item": {
"Quantity": "Anzahl",
"Description": "Beschreibung",
"Eigenschaften": "Eigenschaften",
"rüstwert": "Rüstwert",
"schaden": "Schaden",
"fertigkeit": "Fertigkeit",
"spezialisierung": "Spezialisierung",
"waffenmerkmale": "Waffenmerkmale",
"merkmale": "Merkmale",
"einschränkung": "Einschränkung",
"helm": "Helm",
"type": {
"item": {
"singular": "Gegenstand",
"plural": "Gegenstände"
},
"weapon": {
"singular": "Waffe",
"plural": "Waffen"
},
"armor": {
"singular": "Rüstung",
"plural": "Rüstungen"
},
"zauber": {
"singular": "Zauber",
"plural": "Zauber"
},
"münze": {
"singular": "Münze",
"plural": "Münzen"
}
}
},
"Hintergrund": {
"gruppe": "Kategorie",
"type": {
"gunst": {
"singular": "Gunst",
"plural": "Günste"
},
"makel": {
"singular": "Makel",
"plural": "Makel"
},
"legende": {
"singular": "Legende",
"plural": "Legenden"
},
"schicksalsgabe": {
"singular": "Schicksalsgabe",
"plural": "Schicksalsgaben"
}
}
},
"RollList": {
"RollMode": "Wurf-Modus"
},
"Settings": {
"zauberAlsTag": {
"name": "Zaubereigenschaften als TAG",
"hint": "Stelle Zaubereigenschaften als TAG Liste im Chat da."
},
"beschreibungChatActive": {
"name": "Chat-Beschreibungen automatisch ausklappen",
"hint": "Legt fest, ob Beschreibungen von Zaubern und Co. im Chat eingeklappt angezeigt werden oder vollständig."
}
}
},
"TYPES": {
"Actor": {
"character": "Charakter"
},
"Item": {
"item": "Gegenstand",
"weapon": "Waffe",
"armor": "Rüstung",
"zauber": "Zauber",
"gunst": "Gunst",
"makel": "Makel",
"schicksalsgabe": "Schicksalsgabe",
"legende": "Legende",
"geld": "Geld"
}
}
}
+174 -13
View File
@@ -1,20 +1,181 @@
{ {
"BOILERPLATE": { "Midgard6": {
"Attributes": { "name": "Name",
"strength": "Strength", "Angriff": "Angriff",
"agility": "Agility", "Schaden": "Schaden",
"spirit": "Spirit" "Fertigkeit": "Fertigkeit",
"Stufe": "Stufe",
"Schicksalsmünzen": "Schicksalsmünzen",
"Grad": {
"grad": "Grad",
"frei": "frei",
"eingesetzt": "eingesetzt",
"gesamt": "gesamt",
"erfahrung": "Erfahrung"
}, },
"Sheet": { "Biographie": {
"Biography": "Biography", "spezies": "Spezies",
"Total": "Total", "kultur": "Kultur",
"TotalMod": "Total mod", "abenteuertyp": "Abenteuertyp",
"ChatPlaceholder": "Say something...", "glaube": "Glaube",
"SendToChat": "Send to chat" "mondgestalt": "Mondgestalt"
},
"Dialog": {
"abbrechen": "Abbrechen",
"würfeln": "Würfeln",
"speichern": "Speichern",
"löschen": "Löschen"
},
"Gegenstand": {
"wert": "Wert",
"gewicht": "Gewicht",
"anzahl": "Anzahl"
},
"Skills": {
"gruppen": {
"kampf": "Kampf",
"geist": "Geist",
"körper": "Körper",
"ausdruck": "Ausdruck",
"magie": "Magie"
},
"athletik": "Athletik",
"anführen": "Anführen",
"beweglichkeit": "Beweglichkeit",
"bildung": "Bildung",
"darbietung": "Darbietung",
"einschüchterung": "Einschüchterung",
"empathie": "Empathie",
"fernkampf": "Fernkampf",
"fingerfertigkeit": "Fingerfertigkeit",
"gassenwissen": "Gassenwissen",
"handwerk": "Handwerk",
"heilkunst": "Heilkunst",
"heimlichkeit": "Heimlichkeit",
"kulturwissen": "Kulturwissen",
"nahkampf": "Nahkampf",
"manipulation": "Manipulation",
"thaumaturgie": "Thaumaturgie",
"tierführung": "Tierführung",
"überlebenskunst": "Überlebenskunst",
"überzeugen": "Überzeugen",
"wahrnehmung": "Wahrnehmung",
"zaubern": "Zaubern",
"zauberwissen": "Zauberwissen"
},
"Attribute": {
"resistenzen": "Resistenzen",
"lp": "LP",
"ap": "AP"
},
"Resistenzen": {
"reflexe": "Reflexe",
"willenskraft": "Willenskraft",
"zähigkeit": "Zähigkeit"
},
"aktuell": "Aktuell",
"maximal": {
"short": "Max.",
"long": "Maximal"
},
"Zauber": {
"zauberdauer": "Zauberdauer",
"reichweite": "Reichweite",
"wirkungsdauer": "Wirkungsdauer",
"schaden": "Schaden",
"stufe": "Stufe",
"ursprung": "Ursprung",
"ziel": "Ziel",
"wirkungsweise": "Wirkungsweise",
"vorgang": "Zaubervorgang",
"equipped": "Favorisiert"
},
"Sheets": {
"Tabs": {
"eigenschaften": "Fertigkeiten",
"items": "Gegenstände",
"effects": "Effekte",
"zauber": "Zauber",
"biographie": "Biographie",
"hintergrund": "Hintergrund",
"sperre": "Sperre"
},
"spezialisierung": "Spezialisierung"
}, },
"Item": { "Item": {
"Quantity": "Quantity", "Quantity": "Anzahl",
"Description": "Description" "Description": "Beschreibung",
"Eigenschaften": "Eigenschaften",
"rüstwert": "Rüstwert",
"schaden": "Schaden",
"fertigkeit": "Fertigkeit",
"spezialisierung": "Spezialisierung",
"waffenmerkmale": "Waffenmerkmale",
"merkmale": "Merkmale",
"einschränkung": "Einschränkung",
"helm": "Helm",
"type": {
"item": {
"singular": "Gegenstand",
"plural": "Gegenstände"
},
"weapon": {
"singular": "Waffe",
"plural": "Waffen"
},
"armor": {
"singular": "Rüstung",
"plural": "Rüstungen"
},
"zauber": {
"singular": "Zauber",
"plural": "Zauber"
},
"münze": {
"singular": "Münze",
"plural": "Münzen"
}
}
},
"Hintergrund": {
"gruppe": "Kategorie",
"type": {
"gunst": {
"singular": "Gunst",
"plural": "Günste"
},
"makel": {
"singular": "Makel",
"plural": "Makel"
},
"legende": {
"singular": "Legende",
"plural": "Legenden"
},
"schicksalsgabe": {
"singular": "Schicksalsgabe",
"plural": "Schicksalsgaben"
}
}
},
"RollList": {
"RollMode": "Wurf-Modus"
}
},
"TYPES": {
"Actor": {
"character": "Charakter"
},
"Item": {
"item": "Gegenstand",
"weapon": "Waffe",
"armor": "Rüstung",
"zauber": "Zauber",
"gunst": "Gunst",
"makel": "Makel",
"schicksalsgabe": "Schicksalsgabe",
"legende": "Legende",
"geld": "Geld"
} }
} }
} }
-20
View File
@@ -1,20 +0,0 @@
{
"BOILERPLATE": {
"Attributes": {
"strength": "Force",
"agility": "Agilité",
"spirit": "Esprit"
},
"Sheet": {
"Biography": "Biographie",
"Total": "Total",
"TotalMod": "Modificateur total",
"ChatPlaceholder": "Dites quelque chose...",
"SendToChat": "Envoyer dans le chat"
},
"Item": {
"Quantity": "Quantité",
"Description": "Description"
}
}
}
+11 -47
View File
@@ -1,16 +1,12 @@
{ {
"name": "fvtt-ts-react-boilerplate", "name": "midgard6-lvd",
"version": "0.8.2", "version": "0.8.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "fvtt-ts-react-boilerplate", "name": "midgard6-lvd",
"version": "0.8.2", "version": "0.8.2",
"dependencies": {
"react": "^18.3.0",
"react-dom": "^18.3.0"
},
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.4",
"@types/react": "^18.3.0", "@types/react": "^18.3.0",
@@ -19,7 +15,7 @@
"eslint": "^9.39.4", "eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"fvtt-types": "^13.346.0-beta.20251209192131", "fvtt-types": "^13.346.0-beta.20250812191140",
"globals": "^17.7.0", "globals": "^17.7.0",
"prettier": "^3.8.4", "prettier": "^3.8.4",
"sass": "^1.101.0", "sass": "^1.101.0",
@@ -4994,9 +4990,9 @@
} }
}, },
"node_modules/fvtt-types": { "node_modules/fvtt-types": {
"version": "13.346.0-beta.20251209192131", "version": "13.346.0-beta.20250812191140",
"resolved": "https://registry.npmjs.org/fvtt-types/-/fvtt-types-13.346.0-beta.20251209192131.tgz", "resolved": "https://registry.npmjs.org/fvtt-types/-/fvtt-types-13.346.0-beta.20250812191140.tgz",
"integrity": "sha512-4HhASmSpoibRAo1eeEtkZCSqy68yGFuT6Mkh2nNjM35cot43yo5JBB64owGQ9PK30hY8Ko1OucdjSDf87zdYRg==", "integrity": "sha512-Xa+89ZzxvaGrY507LWb0DY3s6HIOak7pXZGjRuxT+6rLRjluQduiylqAOm4ZTQCRfh7+HdbrUsmrZOKoE/xadQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -5922,6 +5918,7 @@
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/js-yaml": { "node_modules/js-yaml": {
@@ -6332,6 +6329,7 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"js-tokens": "^3.0.0 || ^4.0.0" "js-tokens": "^3.0.0 || ^4.0.0"
@@ -7136,31 +7134,6 @@
"safe-buffer": "^5.1.0" "safe-buffer": "^5.1.0"
} }
}, },
"node_modules/react": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
"license": "MIT",
"dependencies": {
"loose-envify": "^1.1.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
"license": "MIT",
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
},
"peerDependencies": {
"react": "^18.3.1"
}
},
"node_modules/react-is": { "node_modules/react-is": {
"version": "16.13.1", "version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
@@ -7471,9 +7444,9 @@
} }
}, },
"node_modules/sass": { "node_modules/sass": {
"version": "1.101.0", "version": "1.105.2",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.101.0.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.105.2.tgz",
"integrity": "sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==", "integrity": "sha512-KxW6ZKZiBKWK3ziQ4YZ3cpqo8/1TlHXE8t9nBNvGDZFoBFbk2MD7RacxYFs8zy8hzeFwpFYkVyAhboi47uYPEQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -7491,15 +7464,6 @@
"@parcel/watcher": "^2.4.1" "@parcel/watcher": "^2.4.1"
} }
}, },
"node_modules/scheduler": {
"version": "0.23.2",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
"integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
"license": "MIT",
"dependencies": {
"loose-envify": "^1.1.0"
}
},
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+6 -8
View File
@@ -1,11 +1,13 @@
{ {
"name": "fvtt-ts-react-boilerplate", "name": "midgard6-lvd",
"version": "0.8.2", "version": "0.8.2",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite build --watch", "build": "sass src/styles/M6.scss dist/style.css --style=expanded --no-source-map",
"build": "vite build", "watch": "sass src/styles/M6.scss dist/style.css --style=expanded --source-map --watch",
"vite:build": "vite build",
"vite:watch": "vite build --watch",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
@@ -21,7 +23,7 @@
"eslint": "^9.39.4", "eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"fvtt-types": "^13.346.0-beta.20251209192131", "fvtt-types": "^13.346.0-beta.20250812191140",
"globals": "^17.7.0", "globals": "^17.7.0",
"prettier": "^3.8.4", "prettier": "^3.8.4",
"sass": "^1.101.0", "sass": "^1.101.0",
@@ -29,9 +31,5 @@
"typescript-eslint": "^8.62.0", "typescript-eslint": "^8.62.0",
"vite": "^5.4.0", "vite": "^5.4.0",
"vitest": "^4.1.9" "vitest": "^4.1.9"
},
"dependencies": {
"react": "^18.3.0",
"react-dom": "^18.3.0"
} }
} }
+64
View File
@@ -0,0 +1,64 @@
import fs from "fs";
import path from "path";
import archiver from "archiver";
// Pfade definieren (Passe an, falls dein Gitea-Benutzer/Repo-Name anders heißt)
const GITEA_URL = process.env.GITEA_URL;
const REPO = process.env.GITEA_REPOSITORY;
const RELEASE_TAG = process.env.GITEA_REF_NAME || "v1.0.0";
const systemJsonPath = path.resolve("./system.json");
// 1. system.json einlesen und Update-Pfade für Foundry patchen
const systemJson = JSON.parse(fs.readFileSync(systemJsonPath, "utf8"));
// Wenn das Script über ein Tag läuft, nehmen wir das Tag ohne das "v" als Versionsnummer
if (process.env.GITEA_REF_TYPE === "tag") {
systemJson.version = RELEASE_TAG.replace("v", "");
}
// Update-URLs dynamisch generieren
systemJson.manifest = `${GITEA_URL}/api/v1/repos/${REPO}/raw/system.json`;
systemJson.download = `${GITEA_URL}/api/v1/repos/${REPO}/releases/download/${RELEASE_TAG}/system.zip`;
// Modifizierte system.json zurückschreiben
fs.writeFileSync(systemJsonPath, JSON.stringify(systemJson, null, 2));
console.log(`✅ system.json erfolgreich für Version ${systemJson.version} aktualisiert.`);
// 2. zip-Archiv für Foundry erstellen
async function zipDirectory(sourceDir, outPath) {
const archive = archiver("zip", { zlib: { level: 9 } });
const stream = fs.createWriteStream(outPath);
return new Promise((resolve, reject) => {
archive
.directory(sourceDir, false)
.on("error", (err) => reject(err))
.pipe(stream);
stream.on("close", () => resolve());
archive.finalize();
});
}
// Kopiert wichtige Dateien in einen temporären Build-Ordner (dist) und zippt ihn
// Passe die Liste an, je nachdem was in deiner system.zip landen muss!
const filesToInclude = ["src/system.json", "templates", "dist", "lang", "assets"];
const distDir = path.resolve("./dist");
if (!fs.existsSync(distDir)) fs.mkdirSync(distDir);
for (const file of filesToInclude) {
if (fs.existsSync(file)) {
const dest = path.join(distDir, file);
fs.mkdirSync(path.dirname(dest), { recursive: true });
if (fs.lstatSync(file).isDirectory()) {
fs.cpSync(file, dest, { recursive: true });
} else {
fs.copyFileSync(file, dest);
}
}
}
await zipDirectory(distDir, "./system.zip");
console.log("✅ system.zip wurde erfolgreich generiert.");
+11
View File
@@ -0,0 +1,11 @@
export const systemID = "midgard6-lvd";
/**
* Translates repository paths to Foundry Data paths.
* @param {string} path - A path relative to the root of this repository.
* @returns {string} The path relative to the Foundry data folder.
*/
export const systemPath = (path) => `systems/${systemID}/${path}`;
export const assetPath = (path) => `systems/${systemID}/assets/${path}`;
export const swordSVG = "systems/midgard6-lvd/assets/sword.svg";
+23
View File
@@ -0,0 +1,23 @@
import { ItemData } from "./item-data.mjs";
function defineSchema() {
const fields = foundry.data.fields;
const baseData = ItemData.defineSchema();
const extendData = {
rüstwert: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 1,
min: 0
}),
zusätzlich: new fields.BooleanField({ inital: false }),
equipped: new fields.BooleanField({ inital: false })
};
return Object.assign(baseData, extendData);
}
export class ArmorData extends ItemData {
static defineSchema = defineSchema;
}
+380
View File
@@ -0,0 +1,380 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
locked: new fields.BooleanField({ initial: false }),
biographie: new fields.SchemaField({
mondgestalt: new fields.StringField({ initial: "" }),
abenteuertyp: new fields.StringField({ initial: "" }),
glaube: new fields.StringField({ initial: "" }),
spezies: new fields.StringField({ initial: "" }),
kultur: new fields.StringField({ initial: "" }),
beschreibung: new fields.HTMLField({ initial: "" })
}),
legende: new fields.HTMLField({ initial: "" }),
schicksalsmünzen: new fields.NumberField({ initital: 3, min: 0, required: true }),
grad: new fields.SchemaField({
erfahrungspunkteFrei: new fields.NumberField({
required: true,
min: 0,
initial: 0
}),
erfahrungspunkteEingesetzt: new fields.NumberField({
required: true,
min: 0,
initial: 0
}),
erfahrungsschatz: new fields.NumberField({
required: true,
min: 0,
initial: 0
}),
grad: new fields.NumberField({
required: true,
min: 1,
initial: 1
})
}),
rüstwert: new fields.SchemaField({
base: new fields.NumberField({
required: true,
min: 0,
initial: 0
}),
mod: new fields.NumberField({
required: true,
initial: 0
})
}),
resources: new fields.SchemaField({
leben: new fields.SchemaField({
value: new fields.NumberField({
required: true,
min: 0,
initial: 4
}),
max: new fields.NumberField({
required: true,
initial: 8
})
}),
ausdauer: new fields.SchemaField({
value: new fields.NumberField({
required: true,
min: 0,
initial: 4
}),
max: new fields.NumberField({
required: true,
initial: 44
})
})
}),
resistenzen: new fields.SchemaField(
{
reflexe: new fields.NumberField({
required: true,
nullable: false,
min: 0,
initial: 4
}),
willenskraft: new fields.NumberField({
required: true,
nullable: false,
min: 0,
initial: 4
}),
zähigkeit: new fields.NumberField({
required: true,
nullable: false,
min: 0,
initial: 4
})
},
{ label: "resistenzen" }
),
skills: new fields.SchemaField({
kampf: new fields.SchemaField(
{
anführen: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "anführen"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
fernkampf: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "fernkampf"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
nahkampf: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "nahkampf"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
})
},
{ label: "kampf" }
),
körper: new fields.SchemaField(
{
athletik: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "athletik"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
beweglichkeit: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "beweglichkeit"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
fingerfertigkeit: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "fingerfertigkeit"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
heimlichkeit: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "heimlichkeit"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
wahrnehmung: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "wahrnehmung"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
})
},
{ label: "körper" }
),
ausdruck: new fields.SchemaField(
{
darbietung: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "darbietung"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
einschüchterung: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "einschüchterung"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
empathie: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "empathie"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
gassenwissen: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "gassenwissen"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
manipulation: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "manipulation"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
überzeugen: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "überzeugen"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
})
},
{ label: "ausdruck" }
),
geist: new fields.SchemaField(
{
bildung: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "bildung"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
handwerk: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "handwerk"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
heilkunst: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "heilkunst"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
kulturwissen: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "kulturwissen"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
tierführung: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "tierführung"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
überlebenskunst: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "überlebenskunst"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
})
},
{ label: "geist" }
),
magie: new fields.SchemaField(
{
thaumaturgie: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "thaumaturgie"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
zaubern: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "zaubern"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
}),
zauberwissen: new fields.SchemaField({
value: new fields.NumberField({
required: true,
nullable: false,
max: 15,
min: 5,
initial: 5,
label: "zauberwissen"
}),
bonuses: new fields.ArrayField(new fields.ObjectField())
})
},
{ label: "magie" }
)
})
};
}
export class CharacterData extends foundry.abstract.TypeDataModel {
static defineSchema = defineSchema;
}
-33
View File
@@ -1,33 +0,0 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
biography: new fields.HTMLField({ initial: "" }),
attributes: new fields.SchemaField({
strength: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 10
}),
agility: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 10
}),
spirit: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 10
})
})
};
}
export class CharacterData extends foundry.abstract.TypeDataModel<
ReturnType<typeof defineSchema>,
Actor.Implementation
> {
static defineSchema = defineSchema;
}
+12
View File
@@ -0,0 +1,12 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
beschreibung: new fields.HTMLField({ initial: "" }),
gruppe: new fields.StringField({ initial: "" }),
linkId: new fields.StringField({ initial: "" })
};
}
export class HintergrundData extends foundry.abstract.TypeDataModel {
static defineSchema = defineSchema;
}
+34
View File
@@ -0,0 +1,34 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
beschreibung: new fields.HTMLField({ initial: "" }),
anzahl: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 1,
min: 0
}),
wert: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 1,
step: 1,
min: 0
}),
gewicht: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 1,
step: 1,
min: 0
}),
merkmale: new fields.ArrayField(new fields.StringField({}), { initial: [] })
};
}
export class ItemData extends foundry.abstract.TypeDataModel {
static defineSchema = defineSchema;
}
-20
View File
@@ -1,20 +0,0 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({ initial: "" }),
quantity: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 1,
min: 0
})
};
}
export class ItemData extends foundry.abstract.TypeDataModel<
ReturnType<typeof defineSchema>,
Item.Implementation
> {
static defineSchema = defineSchema;
}
+19
View File
@@ -0,0 +1,19 @@
import { ItemData } from "./item-data.mjs";
function defineSchema() {
const fields = foundry.data.fields;
const baseData = ItemData.defineSchema();
const extendData = {
schaden: new fields.StringField({ initial: "1d6" }),
equipped: new fields.BooleanField({ inital: false }),
fertigkeit: new fields.StringField({ initial: "system.skills.kampf.nahkampf" }),
spezialisierung: new fields.StringField({ initial: "" }),
customRoll: new fields.StringField({ initial: "" })
};
return Object.assign(baseData, extendData);
}
export class WeaponData extends ItemData {
static defineSchema = defineSchema;
}
+29
View File
@@ -0,0 +1,29 @@
function defineSchema() {
const fields = foundry.data.fields;
return {
beschreibung: new fields.HTMLField({ initial: "" }),
eigenschaften: new fields.SchemaField({
stufe: new fields.NumberField({
required: true,
nullable: false,
integer: true,
initial: 0,
min: 0,
max: 3
}),
ursprung: new fields.StringField({ initial: "Kleiner Zauber" }),
schaden: new fields.StringField({ initial: "" }),
reichweite: new fields.StringField({ initial: "Kurz" }),
zauberdauer: new fields.StringField({ initial: "1 Aktion" }),
wirkungsdauer: new fields.StringField({ initial: "1 Runde" }),
wirkungsweise: new fields.StringField({ initial: "Einfluss" }),
ziel: new fields.StringField({ initial: "1 Wesen" }),
vorgang: new fields.StringField({ initial: "Geste" })
}),
equipped: new fields.BooleanField({ initial: false })
};
}
export class ZauberData extends foundry.abstract.TypeDataModel {
static defineSchema = defineSchema;
}
+33
View File
@@ -0,0 +1,33 @@
export const loadHelpers = async function () {
Handlebars.registerHelper("ifeq", function (arg1, arg2, options) {
return arg1 == arg2 ? options.fn(this) : options.inverse(this);
});
Handlebars.registerHelper("unlesseq", function (arg1, arg2, options) {
return arg1 != arg2 ? options.fn(this) : options.inverse(this);
});
Handlebars.registerHelper("fetchPath", function (actor, arg1, arg2 = "") {
let arg = arg1;
if (typeof arg2 === "string") {
arg = arg + "" + arg2;
}
return foundry.utils.getProperty(actor, arg);
});
Handlebars.registerHelper("isdefined", function (value, options) {
return value !== undefined ? options.fn(this) : options.inverse(this);
});
Handlebars.registerHelper("localizeConcat", function (arg1, arg2) {
return game.i18n?.localize(arg1 + arg2);
});
Handlebars.registerHelper("splitArray", function (arr) {
if (!Array.isArray(arr)) {
return "";
}
return arr.join(", ");
});
};
+6
View File
@@ -0,0 +1,6 @@
export const loadPartials = async function () {
await foundry.applications.handlebars.loadTemplates([
"systems/midgard6-lvd/templates/chat/chat-message-header.hbs",
"systems/midgard6-lvd/templates/chat/secret-roll.hbs"
]);
};
+21
View File
@@ -0,0 +1,21 @@
export const loadSettings = async function () {
game.settings.register("midgard6-lvd", "zauberAlsTag", {
name: game.i18n.localize("Midgard6.Settings.zauberAlsTag.name"),
hint: game.i18n.localize("Midgard6.Settings.zauberAlsTag.hint"),
scope: "user",
config: true,
default: false,
type: Boolean,
requiresReload: true
});
// Automatically collapse chat message descriptions
game.settings.register("midgard6-lvd", "beschreibungChatActive", {
name: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.name"),
hint: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.hint"),
scope: "client",
config: true,
default: false,
type: Boolean
});
};
+57
View File
@@ -0,0 +1,57 @@
/**
* Searches through an object recursively and localizes strings.
* @param {Record<string, unknown>} object
*/
export function localizeHelper(object) {
for (const [key, value] of Object.entries(object)) {
// const type = foundry.utils.getType(value)
switch (typeof value) {
case "object":
if (value) localizeHelper(value);
break;
case "string":
if (key === "label") object[key] = game.i18n.localize(value);
break;
}
}
}
/* -------------------------------------------------- */
/**
* Prepare the data structure for Active Effects which are currently embedded in an Actor or Item.
* @param {ActiveEffect[]} effects A collection or generator of Active Effect documents to prepare sheet data for.
* @return {object} Data for rendering.
*/
export function prepareActiveEffectCategories(effects) {
const categories = {
temporary: {
type: "temporary",
label: game.i18n.localize("M6.Effect.Temporary"),
effects: []
},
passive: {
type: "passive",
label: game.i18n.localize("M6.Effect.Passive"),
effects: []
},
inactive: {
type: "inactive",
label: game.i18n.localize("M6.Effect.Inactive"),
effects: []
}
};
// Iterate over active effects, classifying them into categories
for (const e of effects) {
if (!e.active) categories.inactive.effects.push(e);
else if (e.isTemporary) categories.temporary.effects.push(e);
else categories.passive.effects.push(e);
}
// Sort each category
for (const c of Object.values(categories)) {
c.effects.sort((a, b) => (a.sort || 0) - (b.sort || 0));
}
return categories;
}
View File
File renamed without changes.
+79
View File
@@ -0,0 +1,79 @@
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { systemPath } from "../constants.mjs";
import { M6ItemSheet } from "./item-sheet.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ItemSheet with some very simple modifications.
*/
export class M6ArmorSheet extends M6ItemSheet {
static get DEFAULT_OPTIONS() {
return {
...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet
actions: {
...super.DEFAULT_OPTIONS.actions,
cycleEquip: this.#cycleEquip, // Fügt NUR für dieses Sheet die neue Action hinzu
cycleHelmet: this.#cycleHelmet
}
};
}
static TABS = {
primary: {
tabs: [
{
id: "eigenschaften",
icon: "fa-shield-halved"
},
{
id: "beschreibung",
icon: "fa-feather-pointed"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "eigenschaften",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/** @inheritdoc */
static PARTS = {
header: {
template: systemPath("templates/item/header.hbs")
},
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
eigenschaften: {
template: systemPath("templates/item/rüstung/eigenschaften.hbs"),
scrollable: [""]
},
beschreibung: {
template: systemPath("templates/item/description.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
static #cycleEquip() {
this.item.update({
system: {
equipped: !this.item.system.equipped
}
});
}
static #cycleHelmet() {
this.item.update({
system: {
zusätzlich: !this.item.system.zusätzlich
}
});
}
}
+829
View File
@@ -0,0 +1,829 @@
import { systemPath } from "../constants.mjs";
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { addSpezialisierung, editSepzialisierung } from "./components/spezialisierung-actions.mjs";
import { prepArmor, prepWeapons, prepWeight, prepSpells } from "./components/character-prep.mjs";
import { rollSpell, rollWeapon, rollSkill } from "./components/roll-actions.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ActorSheet with some very simple modifications.
*/
export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorSheetV2) {
/** @inheritdoc */
static DEFAULT_OPTIONS = {
classes: ["M6", "actor"],
window: {
resizable: true
},
position: {
width: 800,
height: 800
},
actions: {
viewDoc: this.#viewDoc,
createDoc: this.#createDoc,
deleteDoc: this.#deleteDoc,
toggleEffect: this.#toggleEffect,
rollSkill: rollSkill,
rollWeapon: rollWeapon,
rollSpell: rollSpell,
cycleEquip: this.#cycleEquip,
cycleLock: this.#cycleLock,
addSpezialisierung: addSpezialisierung,
editSepzialisierung: editSepzialisierung,
increaseDoc: this.#increaseDoc,
decreaseDoc: this.#decreaseDoc
},
form: {
submitOnChange: true
},
dragDrop: [{ dragSelector: ".draggable", dropSelector: null }]
};
/* -------------------------------------------------- */
static TABS = {
primary: {
tabs: [
{
id: "eigenschaften",
icon: "fa-shield-halved"
},
{
id: "items",
icon: "fa-suitcase"
},
{
id: "zauber",
icon: "fa-hand-sparkles"
},
{
id: "hintergrund",
icon: "fa-list"
},
{
id: "biographie",
icon: "fa-feather-pointed"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "eigenschaften",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/* -------------------------------------------------- */
/** @inheritdoc */
static PARTS = {
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
header: {
template: systemPath("templates/actor/header.hbs")
},
eigenschaften: {
template: systemPath("templates/actor/eigenschaften.hbs"),
scrollable: [""]
},
zauber: {
template: systemPath("templates/actor/zauber.hbs"),
scrollable: [""]
},
items: {
template: systemPath("templates/actor/items.hbs"),
scrollable: [""]
},
hintergrund: {
template: systemPath("templates/actor/hintergrund.hbs"),
scrollable: [""]
},
biographie: {
template: systemPath("templates/actor/biographie.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
_attachPartListeners(partId, html, bubble) {
super._attachPartListeners(partId, html, bubble);
switch (partId) {
case "hintergrund":
const collapsible = html.querySelectorAll("div[data-action=collapsible]");
if (collapsible) {
collapsible.forEach((node) => {
node.addEventListener(
"click",
function () {
node.classList.toggle("active");
var content = node.nextElementSibling;
content.classList.toggle("active");
node.getElementsByTagName("i")[0].classList.toggle("fa-compress");
},
{ capture: true }
);
});
}
break;
}
}
/* -------------------------------------------------- */
/** @inheritdoc */
_initializeApplicationOptions(options) {
const initialized = super._initializeApplicationOptions(options);
initialized.classes.push(initialized.document.type);
return initialized;
}
/* -------------------------------------------------- */
/** @inheritdoc */
async _prepareContext(options) {
const context = await super._prepareContext(options);
Object.assign(context, {
owner: this.document.isOwner,
limited: this.document.limited,
actor: this.actor,
system: this.actor.system,
skills: this.actor.system.skills,
flags: this.actor.flags,
config: CONFIG
});
console.warn(context);
return context;
}
/* -------------------------------------------------- */
/** @inheritdoc */
async _preparePartContext(partId, context) {
switch (partId) {
case "effects":
context.effects = prepareActiveEffectCategories(this.actor.allApplicableEffects());
context.tab = context.tabs[partId];
break;
case "eigenschaften":
context.armor = await prepArmor(this.actor);
context.skills = await this._getSkills();
context.resistenzen = await this._getResistenzen();
context.equippedWeapons = await prepWeapons(this.actor);
context.equippedSpells = await prepSpells(this.actor);
context.tab = context.tabs[partId];
break;
case "items":
context.itemTypes = await this._getItems();
context.gewicht = await prepWeight(this.actor);
context.tab = context.tabs[partId];
break;
case "zauber":
context.zauber = await this._getZauber();
context.tab = context.tabs[partId];
break;
case "hintergrund":
context.fields = await this._getFields();
context.tab = context.tabs[partId];
break;
case "biographie":
context.enrichedBeschreibung =
await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.actor.system.biographie.beschreibung,
{
// Whether to show secret blocks in the finished html
secrets: this.document.isOwner,
// Data to fill in for inline rolls
rollData: this.actor.getRollData(),
// Relative UUID resolution
relativeTo: this.actor
}
);
context.tab = context.tabs[partId];
break;
default:
context.tab = context.tabs[partId];
}
return context;
}
/**
* Handles the system fields for the form-fields generic.
* @returns {object[]}
*/
async _getFields() {
const doc = this.actor;
const source = doc._source;
const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields;
const fieldSets = [];
// TODO: Find a clever way to handle enrichment
for (const field of Object.values(systemFields ?? {})) {
const path = `system.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
const fieldset = { fieldset: true, legend: field.label, fields: [] };
await this.#addSystemFields(fieldset, field.fields, source, path);
fieldSets.push(fieldset);
} else {
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
return fieldSets;
}
/* -------------------------------------------------- */
async _getSkills() {
const doc = this.actor;
const source = doc._source;
const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.skills.fields;
const fieldSets = [];
// TODO: Find a clever way to handle enrichment
for (const field of Object.values(systemFields ?? {})) {
const path = `system.skills.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
const fieldset = {
fieldset: true,
legend: `Midgard6.Skills.gruppen.${field.label}`,
fields: []
};
await this.#addSkillFields(fieldset, field.fields, source, path);
fieldSets.push(fieldset);
} else {
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
return fieldSets;
}
async #addSkillFields(fieldset, schema, source, _path = "system") {
for (const field of Object.values(schema)) {
const path = `${_path}.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
this.#addSkillFields(fieldset, field.fields, source, path);
} else if (field.constructor.hasFormSupport) {
fieldset.fields.push({
field,
value: foundry.utils.getProperty(source, path),
localizationName: "Midgard6.Skills." + field.label,
bonuses: foundry.utils.getProperty(source, _path).bonuses
});
}
}
}
/* -------------------------------------------------- */
async _getResistenzen() {
const doc = this.actor;
const source = doc._source;
const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.resistenzen;
const fieldset = {
fieldset: true,
legend: `Midgard6.Attribute.${systemFields.label}`,
fields: []
};
for (const field of Object.values(systemFields.fields ?? {})) {
const path = `system.resistenzen.${field.name}`;
fieldset.fields.push({
field,
value: foundry.utils.getProperty(source, path),
localizationName: "Midgard6.Resistenzen." + field.name
});
}
return fieldset;
}
async _getResources() {
const doc = this.actor;
const source = doc._source;
const systemFields = CONFIG.Actor.dataModels[doc.type]?.schema.fields.resources.fields;
const fieldSets = [];
// TODO: Find a clever way to handle enrichment
for (const field of Object.values(systemFields ?? {})) {
const path = `system.skills.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
const fieldset = {
fieldset: true,
legend: `Midgard6.resources.${field.label}`,
fields: []
};
await this.#addSystemFields(fieldset, field.fields, source, path);
fieldSets.push(fieldset);
} else {
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
return fieldSets;
}
static async #cycleEquip(event, target) {
const item = this.actor.items.get(target.dataset.itemId);
item.update({
system: {
equipped: !item.system.equipped
}
});
}
static async #cycleLock(event) {
const actor = this.actor;
// Update the locked state
actor.update({ "system.locked": !actor.system.locked });
}
/* -------------------------------------------------- */
/**
* Recursively add system model fields to the fieldset.
*/
async #addSystemFields(fieldset, schema, source, _path = "system") {
for (const field of Object.values(schema)) {
const path = `${_path}.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
this.#addSystemFields(fieldset, field.fields, source, path);
} else if (field.constructor.hasFormSupport) {
fieldset.fields.push({
field,
value: foundry.utils.getProperty(source, path),
localizationName: "Midgard6.Skills." + field.label
});
}
}
}
/* -------------------------------------------------- */
/**
* Adapted from Actor#itemTypes.
*/
_getItems() {
const types = Object.fromEntries(
game.documentTypes.Item.map((t) => {
return [t, { label: game.i18n.localize(CONFIG.Item.typeLabels[t]), items: [] }];
})
);
for (const item of this.actor.items) {
types[item.type].items.push(item);
}
for (const item of this.actor.items) {
types[item.type].items.sort((a, b) => a.sort - b.sort);
}
// Only show Base if it's actually being used
if (types.base.items.length === 0) delete types.base;
return types;
}
_getZauber() {
return this.actor.items.filter((item) => item.type === "zauber");
}
/* -------------------------------------------------- */
/**
* Actions performed after any render of the Application.
* Post-render steps are not awaited by the render process.
* @param {ApplicationRenderContext} context Prepared context data.
* @param {RenderOptions} options Provided render options.
* @protected
* @inheritdoc
*/
async _onRender(context, options) {
await super._onRender(context, options);
this.#disableOverrides();
}
/* -------------------------------------------------- */
/* Event handlers */
/* -------------------------------------------------- */
static async #increaseDoc(event, target) {
const item = this.actor.items.get(target.dataset.itemId);
if (event.shiftKey || event.ctrlKey) {
return item.update({ ["system.anzahl"]: (item.system.anzahl += 10) });
}
return item.update({ ["system.anzahl"]: (item.system.anzahl += 1) });
}
static async #decreaseDoc(event, target) {
const item = this.actor.items.get(target.dataset.itemId);
if (event.shiftKey || event.ctrlKey) {
return item.update({ ["system.anzahl"]: (item.system.anzahl -= 10) });
}
return item.update({ ["system.anzahl"]: (item.system.anzahl -= 1) });
}
/**
* Renders an embedded document's sheet.
*
* @this M6ActorSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @protected
*/
static async #viewDoc(event, target) {
const doc = this._getEmbeddedDocument(target);
doc.sheet.render(true);
}
/* -------------------------------------------------- */
/**
* Handles item deletion.
*
* @this M6ActorSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @protected
*/
static async #deleteDoc(event, target) {
const doc = this._getEmbeddedDocument(target);
doc.delete();
}
/* -------------------------------------------------- */
/**
* Handle creating a new Owned Item or ActiveEffect for the actor using initial data defined in the HTML dataset.
*
* @this M6ActorSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @private
*/
static async #createDoc(event, target) {
const docCls = getDocumentClass(target.dataset.documentClass);
const docData = {
name: docCls.defaultName({
type: target.dataset.type,
parent: this.actor
})
};
for (const [dataKey, value] of Object.entries(target.dataset)) {
if (["action", "documentClass"].includes(dataKey)) continue;
foundry.utils.setProperty(docData, dataKey, value);
}
docCls.create(docData, { parent: this.actor });
}
/* -------------------------------------------------- */
/**
* Determines effect parent to pass to helper.
*
* @this M6ActorSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @private
*/
static async #toggleEffect(event, target) {
const effect = this._getEmbeddedDocument(target);
effect.update({ disabled: !effect.disabled });
}
/* -------------------------------------------------- */
/* Helper functions */
/* -------------------------------------------------- */
/**
* Fetches the embedded document representing the containing HTML element.
*
* @param {HTMLElement} target The element subject to search.
* @returns {Item|ActiveEffect} The embedded Item or ActiveEffect.
*/
_getEmbeddedDocument(target) {
const docRow = target.closest("[data-document-class]");
if (docRow.dataset.documentClass === "Item") {
return this.actor.items.get(docRow.dataset.itemId);
} else if (docRow.dataset.documentClass === "ActiveEffect") {
const parent =
docRow.dataset.parentId === this.actor.id
? this.actor
: this.actor.items.get(docRow?.dataset.parentId);
return parent.effects.get(docRow.dataset.effectId);
} else {
console.warn("Could not find document class");
}
}
/* -------------------------------------------------- */
/* Actor override handling */
/* -------------------------------------------------- */
/**
* Submit a document update based on the processed form data.
* @param {SubmitEvent} event The originating form submission event.
* @param {HTMLFormElement} form The form element that was submitted.
* @param {object} submitData Processed and validated form data to be used for a document update.
* @returns {Promise<void>}
* @protected
* @inheritdoc
*/
async _processSubmitData(event, form, submitData) {
const overrides = foundry.utils.flattenObject(this.actor.overrides);
for (const k of Object.keys(overrides)) delete submitData[k];
this.document.update(submitData);
}
/* -------------------------------------------------- */
/**
* Disables inputs subject to active effects.
*/
#disableOverrides() {
const flatOverrides = foundry.utils.flattenObject(this.actor.overrides);
for (const override of Object.keys(flatOverrides)) {
const input = this.element.querySelector(`[name="${override}"]`);
if (input) input.disabled = true;
}
}
/* -------------------------------------------------- */
/* Drag and drop */
/* -------------------------------------------------- */
/**
* Define whether a user is able to begin a dragstart workflow for a given drag selector.
* @param {string} selector The candidate HTML selector for dragging.
* @returns {boolean} Can the current user drag this selector?
* @protected
*/
_canDragStart(selector) {
return this.isEditable;
}
/* -------------------------------------------------- */
/**
* Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector.
* @param {string} selector The candidate HTML selector for the drop target.
* @returns {boolean} Can the current user drop on this selector?
* @protected
*/
_canDragDrop(selector) {
return this.isEditable;
}
/* -------------------------------------------------- */
/**
* Callback actions which occur at the beginning of a drag start workflow.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
_onDragStart(event) {
const li = event.currentTarget;
const dataset = event.target.dataset;
if ("link" in event.target.dataset) return;
let dragData = null;
if (li.dataset.effectId) {
const effect = this.item.effects.get(li.dataset.effectId);
dragData = effect.toDragData();
}
dragData = {
type: dataset.type,
itemId: dataset.itemId
};
if (!dragData) return;
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
}
/* -------------------------------------------------- */
/**
* Callback actions which occur when a dragged element is over a drop target.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
_onDragOver(event) {}
/* -------------------------------------------------- */
/**
* Callback actions which occur when a dragged element is dropped on a target.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
async _onDrop(event) {
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
const item = this.item;
const allowed = Hooks.call("dropItemSheetData", item, this, data);
if (allowed === false) return;
// Handle different data types
switch (data.type) {
case "ActiveEffect":
return this._onDropActiveEffect(event, data);
case "Actor":
return this._onDropActor(event, data);
case "Item":
return this._onDropItem(event, data);
case "Folder":
return this._onDropFolder(event, data);
}
}
/* -------------------------------------------------- */
/**
* Handle the dropping of ActiveEffect data onto an Actor Sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<ActiveEffect|boolean>} The created ActiveEffect object or false if it couldn't be created.
* @protected
*/
async _onDropActiveEffect(event, data) {
const aeCls = getDocumentClass("ActiveEffect");
const effect = await aeCls.fromDropData(data);
if (!this.item.isOwner || !effect) return false;
if (this.item.uuid === effect.parent?.uuid) return this._onEffectSort(event, effect);
aeCls.create(effect, { parent: this.item });
}
/* -------------------------------------------------- */
/**
* Sorts an Active Effect based on its surrounding attributes.
*
* @param {DragEvent} event
* @param {ActiveEffect} effect
*/
_onEffectSort(event, effect) {
const effects = this.item.effects;
const dropTarget = event.target.closest("[data-effect-id]");
if (!dropTarget) return;
const target = effects.get(dropTarget.dataset.effectId);
// Don't sort on yourself
if (effect.id === target.id) return;
// Identify sibling items based on adjacent HTML elements
const siblings = [];
for (let el of dropTarget.parentElement.children) {
const siblingId = el.dataset.effectId;
if (siblingId && siblingId !== effect.id) siblings.push(effects.get(el.dataset.effectId));
}
// Perform the sort
const sortUpdates = foundry.utils.performIntegerSort(effect, {
target,
siblings
});
const updateData = sortUpdates.map((u) => {
const update = u.update;
update._id = u.target._id;
return update;
});
// Perform the update
this.item.updateEmbeddedDocuments("ActiveEffect", updateData);
}
/* -------------------------------------------------- */
/**
* Handle dropping of an Actor data onto another Actor sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<object|boolean>} A data object which describes the result of the drop, or false if the drop was
* not permitted.
* @protected
*/
async _onDropActor(event, data) {
if (!this.item.isOwner) return false;
}
/* -------------------------------------------------- */
async _onDropItemCreate(actor, itemData) {
itemData = itemData instanceof Array ? itemData : [itemData];
return actor.createEmbeddedDocuments("Item", itemData);
}
/**
* Handle dropping of an item reference or item data onto an Actor Sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<Item[]|boolean>} The created or updated Item instances, or false if the drop was not permitted.
* @protected
*/
async _onDropItem(event, data) {
if (!this.actor.isOwner) return false;
if (this.actor.items.get(data.itemId)) return this._onSortItem(event, data);
const item = await Item.implementation.fromDropData(data);
const itemData = item.toObject();
return this._onDropItemCreate(this.actor, itemData);
}
/**
* Handle a drop event for an existing embedded Item to sort that Item relative to its siblings
* @param {Event} event
* @param {Item} item
* @private
*/
_onSortItem(event, item) {
// Get the drag source and drop target
const items = this.actor.items;
const dropTarget = event.target.closest("[data-item-id]");
const source = items.get(item.itemId);
if (!dropTarget) return;
const target = items.get(dropTarget.dataset.itemId);
// Don't sort on yourself
if (source.id === target.id) return;
// Identify sibling items based on adjacent HTML elements
const siblings = [];
for (let el of dropTarget.parentElement.children) {
const siblingId = el.dataset.itemId;
if (siblingId && siblingId !== source.id) siblings.push(items.get(siblingId));
}
// Perform the sort
const sortUpdates = foundry.utils.performIntegerSort(source, {
target,
siblings
});
const updateData = sortUpdates.map((u) => {
const update = u.update;
update._id = u.target.id;
return update;
});
// Perform the update
return this.actor.updateEmbeddedDocuments("Item", updateData);
}
/* -------------------------------------------------- */
/**
* Handle dropping of a Folder on an Actor Sheet.
* The core sheet currently supports dropping a Folder of Items to create all items as owned items.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<Item[]>}
* @protected
*/
async _onDropFolder(event, data) {
if (!this.item.isOwner) return [];
}
/* -------------------------------------------------- */
/* The following pieces set up drag */
/* handling and are unlikely to need modification */
/* -------------------------------------------------- */
// This is marked as private because there's no real need
// for subclasses or external hooks to mess with it directly
#dragDrop = this.#createDragDropHandlers();
/**
* Returns an array of DragDrop instances.
* @type {DragDrop[]}
*/
get dragDrop() {
return this.#dragDrop;
}
/* -------------------------------------------------- */
/**
* Create drag-and-drop workflow handlers for this Application.
* @returns {DragDrop[]} An array of DragDrop handlers.
* @private
*/
#createDragDropHandlers() {
return this.options.dragDrop.map((d) => {
d.permissions = {
dragstart: this._canDragStart.bind(this),
drop: this._canDragDrop.bind(this)
};
d.callbacks = {
dragstart: this._onDragStart.bind(this),
dragover: this._onDragOver.bind(this),
drop: this._onDrop.bind(this)
};
return new foundry.applications.ux.DragDrop(d);
});
}
}
-32
View File
@@ -1,32 +0,0 @@
import React from "react";
import { createRoot, type Root } from "react-dom/client";
import { CharacterSheetApp } from "./components/CharacterSheetApp";
export class CharacterSheet extends foundry.applications.sheets.ActorSheetV2 {
static DEFAULT_OPTIONS = {
classes: ["fvtt-ts-react-boilerplate", "sheet", "actor"],
position: { width: 600, height: 480 }
};
#root: Root | null = null;
override async _renderHTML(
...args: Parameters<foundry.applications.sheets.ActorSheetV2["_renderHTML"]>
) {
return args[0];
}
override _replaceHTML(
...args: Parameters<foundry.applications.sheets.ActorSheetV2["_replaceHTML"]>
) {
const content = args[1];
if (!this.#root) this.#root = createRoot(content);
this.#root.render(React.createElement(CharacterSheetApp, { actor: this.document }));
}
override async close(...args: Parameters<foundry.applications.sheets.ActorSheetV2["close"]>) {
this.#root?.unmount();
this.#root = null;
return super.close(...args);
}
}
@@ -1,23 +0,0 @@
import { describe, expect, it } from "vitest";
import { fmtMod, modifier } from "./CharacterSheetApp.logic";
describe("modifier", () => {
it("matches the d20-style table around the 10 baseline", () => {
expect(modifier(10)).toBe(0);
expect(modifier(11)).toBe(0);
expect(modifier(12)).toBe(1);
expect(modifier(9)).toBe(-1);
expect(modifier(20)).toBe(5);
});
});
describe("fmtMod", () => {
it("prefixes non-negative values with +", () => {
expect(fmtMod(0)).toBe("+0");
expect(fmtMod(3)).toBe("+3");
});
it("leaves negative values as-is", () => {
expect(fmtMod(-2)).toBe("-2");
});
});
@@ -1,6 +0,0 @@
// Pure game-logic helpers, deliberately kept free of any Foundry global.
// Code that touches `actor`/`ChatMessage`/etc. needs a running Foundry instance
// and isn't realistically unit-testable — this is the boundary to keep that out.
export const modifier = (score: number) => Math.floor((score - 10) / 2);
export const fmtMod = (mod: number) => (mod >= 0 ? `+${mod}` : `${mod}`);
@@ -1,38 +0,0 @@
.sheet {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.5rem;
}
.attributes {
display: flex;
gap: 1rem;
}
.attributeLabel {
display: flex;
flex-direction: column;
font-size: 0.8rem;
text-transform: capitalize;
.modifier {
font-weight: bold;
text-align: center;
}
}
.totals {
display: flex;
gap: 1rem;
font-weight: bold;
}
.chatRow {
display: flex;
gap: 0.5rem;
input {
flex: 1;
}
}
@@ -1,75 +0,0 @@
import React, { useState } from "react";
import styles from "./CharacterSheetApp.module.scss";
import { localize } from "../../i18n";
import { modifier, fmtMod } from "./CharacterSheetApp.logic";
export function CharacterSheetApp({ actor }: { actor: Actor.Implementation }) {
const system = actor.system;
const attrs = system.attributes;
const [chatMessage, setChatMessage] = useState("");
const updateAttribute = (key: "strength" | "agility" | "spirit", value: number) => {
actor.update({ system: { attributes: { [key]: value } } });
};
const updateBiography = (value: string) => {
actor.update({ system: { biography: value } });
};
const sendChatMessage = () => {
if (!chatMessage.trim()) return;
ChatMessage.create({
speaker: ChatMessage.getSpeaker({ actor }),
content: chatMessage
});
setChatMessage("");
};
// derived purely from current doc state — recomputed every render, no local state needed
const total = attrs.strength + attrs.agility + attrs.spirit;
const totalMod = modifier(attrs.strength) + modifier(attrs.agility) + modifier(attrs.spirit);
return (
<div className={styles.sheet}>
<h1>{actor.name}</h1>
<div className={styles.attributes}>
{(["strength", "agility", "spirit"] as const).map((key) => (
<label className={styles.attributeLabel} key={key}>
{localize(`BOILERPLATE.Attributes.${key}`)}
<input
type="number"
value={attrs[key]}
onChange={(e) => updateAttribute(key, Number(e.target.value))}
/>
<span className={styles.modifier}>{fmtMod(modifier(attrs[key]))}</span>
</label>
))}
</div>
<div className={styles.totals}>
<span>
{localize("BOILERPLATE.Sheet.Total")}: {total}
</span>
<span>
{localize("BOILERPLATE.Sheet.TotalMod")}: {fmtMod(totalMod)}
</span>
</div>
<label className={styles.attributeLabel}>
{localize("BOILERPLATE.Sheet.Biography")}
<textarea defaultValue={system.biography} onBlur={(e) => updateBiography(e.target.value)} />
</label>
<div className={styles.chatRow}>
<input
type="text"
placeholder={localize("BOILERPLATE.Sheet.ChatPlaceholder")}
value={chatMessage}
onChange={(e) => setChatMessage(e.target.value)}
onKeyDown={(e) => e.key === "Enter" && sendChatMessage()}
/>
<button type="button" onClick={sendChatMessage}>
{localize("BOILERPLATE.Sheet.SendToChat")}
</button>
</div>
</div>
);
}
@@ -1,13 +0,0 @@
.sheet {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.5rem;
}
.label {
display: flex;
flex-direction: column;
font-size: 0.8rem;
text-transform: capitalize;
}
-37
View File
@@ -1,37 +0,0 @@
import React from "react";
import styles from "./ItemSheetApp.module.scss";
import { localize } from "../../i18n";
export function ItemSheetApp({ item }: { item: Item.Implementation }) {
const system = item.system;
const updateQuantity = (value: number) => {
item.update({ system: { quantity: value } });
};
const updateDescription = (value: string) => {
item.update({ system: { description: value } });
};
return (
<div className={styles.sheet}>
<h1>{item.name}</h1>
<label className={styles.label}>
{localize("BOILERPLATE.Item.Quantity")}
<input
type="number"
min={0}
value={system.quantity}
onChange={(e) => updateQuantity(Number(e.target.value))}
/>
</label>
<label className={styles.label}>
{localize("BOILERPLATE.Item.Description")}
<textarea
defaultValue={system.description}
onBlur={(e) => updateDescription(e.target.value)}
/>
</label>
</div>
);
}
+88
View File
@@ -0,0 +1,88 @@
export async function prepArmor(actor) {
const actorData = actor.system;
// 1. Basis-Wert festlegen
let baseRüstwert = actorData.rüstwert.base || 0;
// 2. Ausgerüstete Rüstung finden und addieren
const equippedMainArmor = actor.items.filter(
(i) => i.type === "armor" && i.system.equipped && !i.system.zusätzlich
);
const equippedAddArmor = actor.items.filter(
(i) => i.type === "armor" && i.system.equipped && i.system.zusätzlich
);
let armorBonus = Math.max(...equippedMainArmor.map((x) => x.system.rüstwert), 0);
for (let armor of equippedAddArmor) {
armorBonus += armor.system.rüstwert;
}
// 3. Finalen Standard-Wert berechnen
actorData.rüstwert.mod = baseRüstwert + armorBonus;
const armors = [];
const einschränkungen = [];
[...equippedMainArmor, ...equippedAddArmor]?.forEach((armor) => {
einschränkungen.push(...armor.system.merkmale);
const w = {
name: armor.name,
rüstwert: armor.system.rüstwert,
img: armor.img,
id: armor.id
};
armors.push(w);
});
return { armors: armors, einschränkungen: [...new Set(einschränkungen)] };
}
export async function prepWeapons(actor) {
const weaponItems = actor.items.filter((x) => x.type === "weapon" && x.system.equipped);
const weapons = [];
weaponItems.forEach((weapon) => {
const skill = foundry.utils.getProperty(actor, weapon.system.fertigkeit);
const w = {
name: weapon.name,
skillValue: skill.value,
bonusValue:
skill.bonuses.find((x) => x.name === weapon.system.spezialisierung)?.level + 1 || "",
img: weapon.img,
skillPath: weapon.system.fertigkeit,
path: weapon.system.fertigkeit,
id: weapon.id
};
weapons.push(w);
});
return weapons;
}
export async function prepSpells(actor) {
const spellItems = actor.items.filter((x) => x.type === "zauber" && x.system.equipped);
const spells = [];
const skill = foundry.utils.getProperty(actor, "system.skills.magie.zaubern");
spellItems.forEach((spell) => {
const w = {
name: spell.name,
skillValue: skill.value,
bonusValue:
skill.bonuses.find((x) => x.name === spell.system.eigenschaften.ursprung)?.level + 1 || "",
img: spell.img,
skillPath: "system.skills.magie.zaubern",
path: "Zaubern",
id: spell.id
};
spells.push(w);
});
return spells;
}
export async function prepWeight(actor) {
const items = actor.items.filter((x) => x.system.gewicht && !x.system.equipped);
let gewicht = items.reduce(
(accumulator, item) => accumulator + item.system.gewicht * item.system.anzahl,
0
);
let traglast = Math.max(actor.system.skills.körper.athletik.value, 10);
return {
traglast,
gewicht
};
}
+361
View File
@@ -0,0 +1,361 @@
import { systemPath } from "../../constants.mjs";
export async function rollSpell(event, target) {
const dataset = target.dataset;
const skill = foundry.utils.getProperty(this.actor, "system.skills.magie.zaubern");
const item = this.actor.items.get(dataset.itemId);
const actor = this.actor;
const dialogResult = await rollDialog({
name: dataset.name,
skill,
damageRoll: item.system.eigenschaften.schaden,
preSelectedSpez: item.system.eigenschaften.ursprung,
actor
});
console.log("Dialog Result", dialogResult);
if (dialogResult === "abort") {
return;
}
// Construct the Roll instance
const skillValue = skill.value;
let die = "";
switch (dialogResult.vorteil) {
case -1:
die = "2d20kl";
break;
case 1:
die = "2d20kh";
break;
default:
die = "1d20";
break;
}
let rollTerm = "@die + @skill";
let rollFlavor = game.i18n.localize("Midgard6.Zaubern") + ": " + item.name;
let roll;
if (dialogResult.spezLevel) {
rollTerm += " + @spezBonus";
rollFlavor += ": " + dialogResult.spezName;
}
if (dialogResult.customRoll) {
roll = new Roll(dialogResult.customRoll, {}, { title: rollFlavor });
} else {
roll = new Roll(
rollTerm,
{
die: die,
skill: skillValue,
spezBonus: dialogResult.spezLevel + 1
},
{ title: rollFlavor }
);
}
if (item.system.eigenschaften.schaden) {
const attackRoll = await roll.evaluate();
roll = [
attackRoll,
await new Roll(
"@die",
{ die: item.system.eigenschaften.schaden },
{ title: game.i18n.localize("Midgard6.Schaden") }
).evaluate()
];
} else {
// Execute the roll
await roll.evaluate();
}
// The parsed terms of the roll formula
console.log("Roll:", roll); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm]
const chatData = {
rolls: roll,
speaker: ChatMessage.getSpeaker(),
flags: {
"midgard6-lvd": {
title: rollFlavor,
eigenschaften: item.system.eigenschaften,
isSpell: true,
beschreibung: await foundry.applications.ux.TextEditor.implementation.enrichHTML(
item.system.beschreibung,
{
// Whether to show secret blocks in the finished html
secrets: false,
// Data to fill in for inline rolls
rollData: this.actor.getRollData(),
// Relative UUID resolution
relativeTo: this.actor
}
)
}
}
};
ChatMessage.applyMode(chatData, dialogResult.rollMode);
await ChatMessage.create(chatData);
}
export async function rollSkill(event, target) {
const dataset = target.dataset;
const skill = foundry.utils.getProperty(this.actor, target.dataset.path.replace(".value", ""));
const actor = this.actor;
const dialogResult = await rollDialog({
name: dataset.name,
skill,
actor
});
console.log("Dialog Result", dialogResult);
if (dialogResult === "abort") {
return;
}
// Construct the Roll instance
const skillValue = skill.value || skill;
let die = "";
switch (dialogResult.vorteil) {
case -1:
die = "2d20kl";
break;
case 1:
die = "2d20kh";
break;
default:
die = "1d20";
break;
}
let rollTerm = "@die + @skill";
let rollFlavor = dataset.name;
let roll;
if (dialogResult.spezLevel) {
rollTerm += " + @spezBonus";
rollFlavor += ": " + dialogResult.spezName;
}
if (dialogResult.customRoll) {
roll = new Roll(dialogResult.customRoll, {}, { title: rollFlavor });
} else {
roll = new Roll(
rollTerm,
{
die: die,
skill: skillValue,
spezBonus: dialogResult.spezLevel + 1
},
{ title: rollFlavor }
);
}
// The parsed terms of the roll formula
console.log("Roll:", roll); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm]
// Execute the roll
await roll.evaluate();
const chatData = {
rolls: roll,
speaker: ChatMessage.getSpeaker(),
flags: {
"midgard6-lvd": {
title: rollFlavor
}
}
};
// Nutze applyRollMode, um Sichtbarkeiten (Whisper, Blind) korrekt zu setzen
ChatMessage.applyMode(chatData, dialogResult.rollMode);
// Erstelle die Nachricht mit den manipulierten Daten
await ChatMessage.create(chatData);
}
export async function rollWeapon(event, target) {
const dataset = target.dataset;
const weapon = this.actor.items.get(dataset.itemId);
const skill = foundry.utils.getProperty(this.actor, weapon.system.fertigkeit);
const actor = this.actor;
const dialogResult = await rollDialog({
name: weapon.name,
skill,
damageRoll: weapon.system.schaden,
preSelectedSpez: weapon.system.spezialisierung,
actor
});
console.log("Dialog Result", dialogResult);
if (dialogResult === "abort") {
return;
}
// Construct the Roll instance
const skillValue = skill.value;
let die = "";
switch (dialogResult.vorteil) {
case -1:
die = "2d20kl";
break;
case 1:
die = "2d20kh";
break;
default:
die = "1d20";
break;
}
let rollTerm = "@die + @skill";
let rollFlavor = game.i18n.localize("Midgard6.Angriff");
let attackRoll;
let damageRoll;
if (dialogResult.spezLevel) {
rollTerm += " + @spezBonus";
rollFlavor += " (" + dialogResult.spezName + ")";
}
rollFlavor += ": " + weapon.name;
if (dialogResult.customRoll) {
attackRoll = await new Roll(dialogResult.customRoll, {}, { title: rollFlavor }).evaluate();
} else {
attackRoll = await new Roll(
rollTerm,
{
die: die,
skill: skillValue,
spezBonus: dialogResult.spezLevel + 1
},
{
title: rollFlavor
}
).evaluate();
}
damageRoll = await new Roll(
"@die",
{ die: weapon.system.schaden },
{ title: game.i18n.localize("Midgard6.Schaden") }
).evaluate();
// The parsed terms of the roll formula
const chatData = {
rolls: [attackRoll, damageRoll],
speaker: ChatMessage.getSpeaker(),
flags: {
"midgard6-lvd": {
title: rollFlavor,
eigenschaften: weapon.eigenschaften,
merkmale: weapon.system.merkmale,
beschreibung: await foundry.applications.ux.TextEditor.implementation.enrichHTML(
weapon.system.beschreibung,
{
secrets: false,
rollData: this.actor.getRollData(),
relativeTo: this.actor
}
)
}
}
};
ChatMessage.applyMode(chatData, dialogResult.rollMode);
await ChatMessage.create(chatData);
}
async function rollDialog(rollDialogRequest) {
// Assamble dialog depending on roll type
let label = rollDialogRequest.name;
let skillValue = rollDialogRequest.skill.value || rollDialogRequest.skill;
let bonuses = rollDialogRequest.skill.bonuses || [];
let damageRoll = rollDialogRequest.damageRoll || "";
let preSelectedSpez = rollDialogRequest.preSelectedSpez || "";
let vorteil = 0;
let customRoll = "";
let spezLevel;
let spezName = "";
// 1. Define the path to .hbs template
const templatePath = systemPath("templates/dialog/roll-dialog.hbs");
const templateData = {
skillValue,
bonuses,
vorteil,
damageRoll,
preSelectedSpez,
customRoll,
rollModes: CONFIG.ChatMessage.modes
};
// 2. Render the Handlebars template into an HTML string
const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData);
// return new Promise((resolve, reject) => {
// const dialog = new foundry.applications.api.DialogV2({
return foundry.applications.api.DialogV2.wait({
window: { title: "Würfel Modifikatoren: " + label },
position: {
width: 600
},
classes: ["M6", "dialog"],
content,
actions: {},
render: (_event, dialog) => {
const dialogHTML = dialog.element;
const display = dialogHTML.querySelector("#rollDisplay");
// Variable bei jeder Änderung aktualisieren
document.querySelectorAll('input[name="vorteil-segment"]').forEach((radio) => {
radio.addEventListener("change", (e) => {
vorteil = parseInt(e.target.value);
switch (vorteil) {
case 1:
display.placeholder = `2d20kh + ${skillValue} (Vorteil)`;
break;
case -1:
display.placeholder = `2d20kl + ${skillValue} (Nachteil)`;
break;
default:
display.placeholder = `1d20 + ${skillValue}`;
break;
}
});
});
document.querySelectorAll('input[name="spezialisierung-segment"]').forEach((radio) => {
radio.addEventListener("change", (e) => {
spezLevel = parseInt(e.target.value);
spezName = e.target.dataset.name;
});
if (radio.dataset.name === preSelectedSpez) {
radio.click();
}
});
},
buttons: [
{
action: "abort",
label: "Midgard6.Dialog.abbrechen",
callback: (event, button, dialog) => {
return null;
}
},
{
action: "roll",
label: "Midgard6.Dialog.würfeln",
default: true,
callback: (event, button, dialog) => {
const rollData = {
customRoll: button.form.elements.customRoll.value,
customDamageRoll: button.form.elements.customDamageRoll?.value || "",
vorteil,
spezLevel,
spezName,
rollMode:
button.form.elements.rollMode?.value || game.settings.get("core", "messageMode")
};
return rollData;
}
}
]
});
}
@@ -0,0 +1,131 @@
import { systemPath } from "../../constants.mjs";
/* -------------------------------------------------- */
export async function addSpezialisierung(event, target) {
const dataset = target.dataset;
const path = dataset.path.replace(".value", "");
const name = dataset.name;
const skill = foundry.utils.getProperty(this.actor, path);
let level = 1;
const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs");
const templateData = {
level
};
const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData);
return foundry.applications.api.DialogV2.wait({
window: {
title:
game.i18n.localize("Midgard6.Sheets.spezialisierung") +
" " +
game.i18n.localize(`Midgard6.Skills.${name}`)
},
classes: ["M6", "dialog"],
position: {
width: 600
},
content,
actions: {},
render: (_event, dialog) => {
const dialogHTML = dialog.element;
// Variable bei jeder Änderung aktualisieren
dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
radio.addEventListener("change", (e) => {
level = parseInt(e.target.value);
});
});
},
buttons: [
{
action: "abort",
label: "Midgard6.Dialog.abbrechen"
},
{
action: "safe",
label: "Midgard6.Dialog.speichern",
default: true,
callback: async (event, button, dialog) => {
const spez = {
name: button.form.elements.spezName.value,
level,
path
};
skill.bonuses.push(spez);
await this.actor.update({ [`${path}.bonuses`]: skill.bonuses });
}
}
]
});
}
export async function editSepzialisierung(event, target) {
const dataset = target.dataset;
const path = dataset.path;
const name = dataset.name;
const skill = foundry.utils.getProperty(this.actor, path);
let level = 1;
let spezName = dataset.name;
const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs");
const templateData = {
spezName,
level
};
// 2. Render the Handlebars template into an HTML string
const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData);
return foundry.applications.api.DialogV2.wait({
window: {
title:
game.i18n.localize("Midgard6.Sheets.spezialisierung") +
" " +
game.i18n.localize(path.replace(/^.*\.(?=[^.]+$)/g, "Midgard6.Skills."))
},
classes: ["M6", "dialog"],
position: {
width: 600
},
content,
actions: {},
render: (_event, dialog) => {
const dialogHTML = dialog.element;
dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
radio.addEventListener("change", (e) => {
level = parseInt(e.target.value);
});
});
},
buttons: [
{
action: "abort",
label: "Midgard6.Dialog.abbrechen"
},
{
action: "delete",
label: "Midgard6.Dialog.löschen",
callback: async (event, button, dialog) => {
// const bonuses = this.actor[path].bonuses || [];
const bonuses = skill.bonuses.filter((x) => x.name !== name);
await this.actor.update({ [`${path}.bonuses`]: bonuses });
}
},
{
action: "safe",
label: "Midgard6.Dialog.speichern",
default: true,
callback: async (event, button, dialog) => {
const spez = {
name: button.form.elements.spezName.value,
level,
path
};
const index = skill.bonuses.findIndex((x) => x.name === name);
skill.bonuses.splice(index, 1, spez);
await this.actor.update({ [`${path}.bonuses`]: skill.bonuses });
}
}
]
});
}
+60
View File
@@ -0,0 +1,60 @@
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { systemPath } from "../constants.mjs";
import { M6ItemSheet } from "./item-sheet.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ItemSheet with some very simple modifications.
*/
export class M6HintergrundSheet extends M6ItemSheet {
static get DEFAULT_OPTIONS() {
return {
...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet
actions: {
...super.DEFAULT_OPTIONS.actions
}
};
}
static TABS = {
primary: {
tabs: [
{
id: "beschreibung",
icon: "fa-feather-pointed"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "beschreibung",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/** @inheritdoc */
static PARTS = {
header: {
template: systemPath("templates/hintergrund/header.hbs")
},
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
beschreibung: {
template: systemPath("templates/hintergrund/description.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
_addSpecifics(context) {
if (context.source.type === "legende") {
const schicksalsgaben = context.actor.items.filter((x) => x.type === "schicksalsgabe");
context.schicksalsgaben = schicksalsgaben;
}
}
}
+573
View File
@@ -0,0 +1,573 @@
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { systemPath } from "../constants.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ItemSheet with some very simple modifications.
*/
export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet) {
/** @inheritdoc */
static DEFAULT_OPTIONS = {
window: {
resizable: true
},
position: {
width: 650,
height: 450
},
classes: ["M6", "item", "standard-form"],
actions: {
viewDoc: this.#viewEffect,
createDoc: this.#createEffect,
deleteDoc: this.#deleteEffect,
toggleEffect: this.#toggleEffect
},
form: {
submitOnChange: true
},
// Custom property that's merged into `this.options`
dragDrop: [{ dragSelector: ".draggable", dropSelector: null }]
};
/* -------------------------------------------------- */
static TABS = {
primary: {
tabs: [
{
id: "beschreibung",
icon: "fa-feather-pointed"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "beschreibung",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/* -------------------------------------------------- */
/** @inheritdoc */
static PARTS = {
header: {
template: systemPath("templates/item/header.hbs")
},
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
beschreibung: {
template: systemPath("templates/item/description.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
_attachPartListeners(partId, html, bubble) {
super._attachPartListeners(partId, html, bubble);
if (partId === "eigenschaften") {
const inputs = html.querySelectorAll("input[data-action=splitIntoArray]");
if (inputs) {
inputs.forEach((input) => {
input.addEventListener("blur", this._onInputBlur.bind(this));
});
}
}
}
// Die eigentliche Funktion, die beim Verlassen des Feldes feuert
_onInputBlur(event) {
event.preventDefault();
const currentInput = event.currentTarget;
const value = currentInput.value;
console.log("Feld verlassen! Aktueller Wert:", value);
this.item.update({ [`${currentInput.name}`]: value.split(/[\s,]+/) });
}
/* -------------------------------------------------- */
/** @inheritdoc */
_initializeApplicationOptions(options) {
const initialized = super._initializeApplicationOptions(options);
initialized.classes.push(initialized.document.type);
return initialized;
}
/* -------------------------------------------------- */
/** @inheritdoc */
async _prepareContext(options) {
const context = await super._prepareContext(options);
Object.assign(context, {
owner: this.document.isOwner,
limited: this.document.limited,
item: this.item,
actor: this.actor,
system: this.item.system,
flags: this.item.flags,
itemFields: this.item.schema.fields,
config: CONFIG
});
return context;
}
/* -------------------------------------------------- */
/** @inheritdoc */
async _preparePartContext(partId, context) {
// TODO: Come up with clever way to automatically handle enriching HTML fields
switch (partId) {
case "effects":
context.effects = prepareActiveEffectCategories(this.item.effects);
context.tab = context.tabs[partId];
break;
case "beschreibung":
context.fields = await this._getFields();
context.enrichedBeschreibung =
await foundry.applications.ux.TextEditor.implementation.enrichHTML(
this.item.system.beschreibung,
{
// Whether to show secret blocks in the finished html
secrets: this.document.isOwner,
// Data to fill in for inline rolls
rollData: this.item.getRollData(),
// Relative UUID resolution
relativeTo: this.item
}
);
context.tab = context.tabs[partId];
break;
default:
await this._addSpecifics(context);
context.tab = context.tabs[partId];
}
return context;
}
/* -------------------------------------------------- */
/**
* Handles the system fields for the form-fields generic.
*/
async _getFields() {
const doc = this.item;
const source = doc._source;
const systemFields = CONFIG.Item.dataModels[doc.type]?.schema.fields;
const fieldSets = [];
// TODO: Find a clever way to handle enrichment
for (const field of Object.values(systemFields ?? {})) {
const path = `system.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
const fieldset = { fieldset: true, legend: field.label, fields: [] };
await this.#addSystemFields(fieldset, field.fields, source, path);
fieldSets.push(fieldset);
} else {
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
return fieldSets;
}
/* -------------------------------------------------- */
/**
* Recursively add system model fields to the fieldset.
*/
async #addSystemFields(fieldset, schema, source, _path = "system") {
for (const field of Object.values(schema)) {
const path = `${_path}.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
this.#addSystemFields(fieldset, field.fields, source, path);
} else if (field.constructor.hasFormSupport) {
fieldset.fields.push({ field, value: foundry.utils.getProperty(source, path) });
}
}
}
/* -------------------------------------------------- */
/**
* Actions performed after any render of the Application.
* Post-render steps are not awaited by the render process.
* @param {ApplicationRenderContext} context Prepared context data.
* @param {RenderOptions} options Provided render options.
* @protected
*/
_onRender(context, options) {
this.#dragDrop.forEach((d) => d.bind(this.element));
}
/* -------------------------------------------------- */
/* Event handlers */
/* -------------------------------------------------- */
/**
* Renders an embedded document's sheet.
*
* @this UTSItemSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @protected
*/
static async #viewEffect(event, target) {
const effect = this._getEffect(target);
effect.sheet.render(true);
}
/* -------------------------------------------------- */
/**
* Handles item deletion.
*
* @this UTSItemSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @protected
*/
static async #deleteEffect(event, target) {
const effect = this._getEffect(target);
effect.delete();
}
/* -------------------------------------------------- */
/**
* Handle creating a new Owned Item or ActiveEffect for the actor using initial data defined in the HTML dataset.
*
* @this UTSItemSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @private
*/
static async #createEffect(event, target) {
const aeCls = getDocumentClass("ActiveEffect");
const effectData = {
name: aeCls.defaultName({
type: target.dataset.type,
parent: this.item
})
};
for (const [dataKey, value] of Object.entries(target.dataset)) {
if (["action", "documentClass"].includes(dataKey)) continue;
foundry.utils.setProperty(effectData, dataKey, value);
}
aeCls.create(effectData, { parent: this.item });
}
/* -------------------------------------------------- */
/**
* Determines effect parent to pass to helper.
*
* @this UTSItemSheet
* @param {PointerEvent} event The originating click event.
* @param {HTMLElement} target The capturing HTML element which defined a [data-action].
* @private
*/
static async #toggleEffect(event, target) {
const effect = this._getEffect(target);
effect.update({ disabled: !effect.disabled });
}
/* -------------------------------------------------- */
/* Helper functions */
/* -------------------------------------------------- */
/**
* Fetches the row with the data for the rendered embedded document.
*
* @param {HTMLElement} target The element with the action.
* @returns {HTMLLIElement} The document's row.
*/
_getEffect(target) {
const li = target.closest(".effect");
return this.item.effects.get(li?.dataset?.effectId);
}
/* -------------------------------------------------- */
/* Drag and drop */
/* -------------------------------------------------- */
/**
* Define whether a user is able to begin a dragstart workflow for a given drag selector.
* @param {string} selector The candidate HTML selector for dragging.
* @returns {boolean} Can the current user drag this selector?
* @protected
*/
_canDragStart(selector) {
return this.isEditable;
}
/* -------------------------------------------------- */
/**
* Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector.
* @param {string} selector The candidate HTML selector for the drop target.
* @returns {boolean} Can the current user drop on this selector?
* @protected
*/
_canDragDrop(selector) {
return this.isEditable;
}
/* -------------------------------------------------- */
/**
* Callback actions which occur at the beginning of a drag start workflow.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
_onDragStart(event) {
const li = event.currentTarget;
if ("link" in event.target.dataset) return;
let dragData = null;
if (li.dataset.effectId) {
const effect = this.item.effects.get(li.dataset.effectId);
dragData = effect.toDragData();
}
if (!dragData) return;
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
}
/* -------------------------------------------------- */
/**
* Callback actions which occur when a dragged element is over a drop target.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
_onDragOver(event) {}
/* -------------------------------------------------- */
/**
* Callback actions which occur when a dragged element is dropped on a target.
* @param {DragEvent} event The originating DragEvent.
* @protected
*/
async _onDrop(event) {
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
const item = this.item;
const allowed = Hooks.call("dropItemSheetData", item, this, data);
// if (allowed === false) return;
// Handle different data types
switch (data.type) {
case "ActiveEffect":
return this._onDropActiveEffect(event, data);
case "Actor":
return this._onDropActor(event, data);
case "Item":
return this._onDropItem(event, data);
case "Folder":
return this._onDropFolder(event, data);
}
}
/* -------------------------------------------------- */
/**
* Handle the dropping of ActiveEffect data onto an Actor Sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<ActiveEffect|boolean>} The created ActiveEffect object or false if it couldn't be created.
* @protected
*/
async _onDropActiveEffect(event, data) {
const aeCls = getDocumentClass("ActiveEffect");
const effect = await aeCls.fromDropData(data);
if (!this.item.isOwner || !effect) return false;
if (this.item.uuid === effect.parent?.uuid) return this._onEffectSort(event, effect);
aeCls.create(effect, { parent: this.item });
}
/* -------------------------------------------------- */
/**
* Sorts an Active Effect based on its surrounding attributes.
*
* @param {DragEvent} event
* @param {ActiveEffect} effect
*/
_onEffectSort(event, effect) {
const effects = this.item.effects;
const dropTarget = event.target.closest("[data-effect-id]");
if (!dropTarget) return;
const target = effects.get(dropTarget.dataset.effectId);
// Don't sort on yourself
if (effect.id === target.id) return;
// Identify sibling items based on adjacent HTML elements
const siblings = [];
for (let el of dropTarget.parentElement.children) {
const siblingId = el.dataset.effectId;
if (siblingId && siblingId !== effect.id) siblings.push(effects.get(el.dataset.effectId));
}
// Perform the sort
const sortUpdates = foundry.utils.performIntegerSort(effect, {
target,
siblings
});
const updateData = sortUpdates.map((u) => {
const update = u.update;
update._id = u.target._id;
return update;
});
// Perform the update
this.item.updateEmbeddedDocuments("ActiveEffect", updateData);
}
/* -------------------------------------------------- */
/**
* Handle dropping of an Actor data onto another Actor sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<object|boolean>} A data object which describes the result of the drop, or false if the drop was
* not permitted.
* @protected
*/
async _onDropActor(event, data) {
if (!this.item.isOwner) return false;
}
/* -------------------------------------------------- */
/**
* Handle dropping of an item reference or item data onto an Actor Sheet.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<Item[]|boolean>} The created or updated Item instances, or false if the drop was not permitted.
* @protected
*/
async _onDropItem(event, data) {
if (!this.item.isOwner) return false;
// Prüfen, ob das Item von diesem Actor stammt und Shift NICHT gedrückt ist
const isSameActor = this.actor.uuid === item.parent?.uuid;
const isShift = event.shiftKey;
if (isSameActor) {
// Sortieren, nicht kopieren/verschieben
return this._onSortItem(event, item);
}
}
/**
* Handle a drop event for an existing embedded Item to sort that Item relative to its siblings
* @param {Event} event
* @param {Item} item
* @private
*/
_onSortItem(event, item) {
// Get the drag source and drop target
const items = this.actor.items;
const dropTarget = event.target.closest("[data-item-id]");
if (!dropTarget) return;
const target = items.get(dropTarget.dataset.itemId);
// Don't sort on yourself
if (item.id === target.id) return;
// Identify sibling items based on adjacent HTML elements
const siblings = [];
for (let el of dropTarget.parentElement.children) {
const siblingId = el.dataset.itemId;
if (siblingId && siblingId !== item.id) siblings.push(items.get(el.dataset.itemId));
}
// Perform the sort
const sortUpdates = foundry.utils.SortingHelpers.performIntegerSort(item, {
target,
siblings
});
const updateData = sortUpdates.map((u) => {
const update = u.update;
update._id = u.target._id;
return update;
});
// Perform the update
return this.actor.updateEmbeddedDocuments("Item", updateData);
}
/* -------------------------------------------------- */
/**
* Handle dropping of a Folder on an Actor Sheet.
* The core sheet currently supports dropping a Folder of Items to create all items as owned items.
* @param {DragEvent} event The concluding DragEvent which contains drop data.
* @param {object} data The data transfer extracted from the event.
* @returns {Promise<Item[]>}
* @protected
*/
async _onDropFolder(event, data) {
if (!this.item.isOwner) return [];
}
/* -------------------------------------------------- */
/* The following pieces set up drag */
/* handling and are unlikely to need modification */
/* -------------------------------------------------- */
// This is marked as private because there's no real need
// for subclasses or external hooks to mess with it directly
#dragDrop = this.#createDragDropHandlers();
/**
* Returns an array of DragDrop instances.
* @type {DragDrop[]}
*/
get dragDrop() {
return this.#dragDrop;
}
/* -------------------------------------------------- */
/**
* Create drag-and-drop workflow handlers for this Application.
* @returns {DragDrop[]} An array of DragDrop handlers.
* @private
*/
#createDragDropHandlers() {
return this.options.dragDrop.map((d) => {
d.permissions = {
dragstart: this._canDragStart.bind(this),
drop: this._canDragDrop.bind(this)
};
d.callbacks = {
dragstart: this._onDragStart.bind(this),
dragover: this._onDragOver.bind(this),
drop: this._onDrop.bind(this)
};
return new foundry.applications.ux.DragDrop(d);
});
}
async _addSpecifics(context) {
return null;
}
}
-32
View File
@@ -1,32 +0,0 @@
import React from "react";
import { createRoot, type Root } from "react-dom/client";
import { ItemSheetApp } from "./components/ItemSheetApp";
export class ItemSheet extends foundry.applications.sheets.ItemSheetV2 {
static DEFAULT_OPTIONS = {
classes: ["fvtt-ts-react-boilerplate", "sheet", "item"],
position: { width: 480, height: 360 }
};
#root: Root | null = null;
override async _renderHTML(
...args: Parameters<foundry.applications.sheets.ItemSheetV2["_renderHTML"]>
) {
return args[0];
}
override _replaceHTML(
...args: Parameters<foundry.applications.sheets.ItemSheetV2["_replaceHTML"]>
) {
const content = args[1];
if (!this.#root) this.#root = createRoot(content);
this.#root.render(React.createElement(ItemSheetApp, { item: this.document }));
}
override async close(...args: Parameters<foundry.applications.sheets.ItemSheetV2["close"]>) {
this.#root?.unmount();
this.#root = null;
return super.close(...args);
}
}
+75
View File
@@ -0,0 +1,75 @@
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { systemPath } from "../constants.mjs";
import { M6ItemSheet } from "./item-sheet.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ItemSheet with some very simple modifications.
*/
export class M6WeaponSheet extends M6ItemSheet {
static get DEFAULT_OPTIONS() {
return {
...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet
actions: {
...super.DEFAULT_OPTIONS.actions,
cycleEquip: this.#cycleEquip
}
};
}
static TABS = {
primary: {
tabs: [
{
id: "eigenschaften",
icon: "fa-shield-halved"
},
{
id: "beschreibung",
icon: "fa-feather-pointed"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "eigenschaften",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/** @inheritdoc */
static PARTS = {
header: {
template: systemPath("templates/item/header.hbs")
},
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
eigenschaften: {
template: systemPath("templates/item/waffen/eigenschaften.hbs"),
scrollable: [""]
},
beschreibung: {
template: systemPath("templates/item/description.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
async _addSpecifics(context) {
context.bonuses =
foundry.utils.getProperty(this.actor, this.item.system.fertigkeit)?.bonuses || [];
}
static #cycleEquip() {
this.item.update({
system: {
equipped: !this.item.system.equipped
}
});
}
}
+108
View File
@@ -0,0 +1,108 @@
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
import { systemPath } from "../constants.mjs";
import { M6ItemSheet } from "./item-sheet.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ItemSheet with some very simple modifications.
*/
export class M6ZauberSheet extends M6ItemSheet {
static get DEFAULT_OPTIONS() {
return {
...super.DEFAULT_OPTIONS, // Kopiert alle bestehenden Actions aus M6ItemSheet
actions: {
...super.DEFAULT_OPTIONS.actions,
cycleEquip: this.#cycleEquip // Fügt NUR für dieses Sheet die neue Action hinzu
}
};
}
static TABS = {
primary: {
tabs: [
{
id: "eigenschaften",
icon: "fa-shield-halved"
},
{
id: "beschreibung",
icon: "fa-feather-pointed"
}
],
initial: "eigenschaften",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/** @inheritdoc */
static PARTS = {
header: {
template: systemPath("templates/zauber/header.hbs")
},
tabs: {
template: systemPath("templates/shared/tabs.hbs")
},
eigenschaften: {
template: systemPath("templates/zauber/eigenschaften.hbs"),
scrollable: [""]
},
beschreibung: {
template: systemPath("templates/zauber/description.hbs"),
scrollable: [""]
}
};
async _addSpecifics(context) {
context.zauberFields = await this._getFields();
context.bonuses =
foundry.utils.getProperty(this.actor, "system.skills.magie.zaubern")?.bonuses || [];
}
static #cycleEquip() {
this.item.update({
system: {
equipped: !this.item.system.equipped
}
});
}
/* -------------------------------------------------- */
/**
* Handles the system fields for the form-fields generic.
*/
async _getFields() {
const doc = this.item;
const source = doc._source;
const systemFields = CONFIG.Item.dataModels[doc.type]?.schema.fields;
const fieldSets = {};
// TODO: Find a clever way to handle enrichment
for (const field of Object.values(systemFields ?? {})) {
const path = `system.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
const fieldset = { fieldset: true, legend: field.label, fields: {} };
await this.#addSystemFields(fieldset, field.fields, source, path);
fieldSets[field.name] = fieldset;
} else {
fieldSets[field.name] = { field, value: foundry.utils.getProperty(source, path) };
}
}
return fieldSets;
}
/* -------------------------------------------------- */
/**
* Recursively add system model fields to the fieldset.
*/
async #addSystemFields(fieldset, schema, source, _path = "system") {
for (const field of Object.values(schema)) {
const path = `${_path}.${field.name}`;
if (field instanceof foundry.data.fields.SchemaField) {
this.#addSystemFields(fieldset, field.fields, source, path);
} else if (field.constructor.hasFormSupport) {
fieldset.fields[field.name] = { field, value: foundry.utils.getProperty(source, path) };
}
}
}
}
+200
View File
@@ -0,0 +1,200 @@
@import url("flex/bootstrap-grid.css");
@import url("./header.scss");
@import url("./tabs.scss");
@import url("./resistenzen.scss");
@import url("./dialog.scss");
@import url("./items-page.scss");
@import url("./hintergrund.scss");
@import url("./icons.scss");
@import url("./chat-messages.scss");
:root {
--M6-background-grey: #d3d7d7;
--M6-background-brown: #eedecd;
--M6-background-white: #fdfeff;
--M6-text-grey: #595d5f;
--M6-text-brown: #be7742;
}
.inline-roll {
background-color: var(--M6-background-brown);
}
.M6 {
fieldset {
border-radius: 0;
border: none;
background-color: var(--M6-background-grey);
&.highlight {
background-color: var(--M6-background-brown);
}
legend {
color: var(--M6-text-brown);
font-size: 24px;
}
}
h5 {
color: var(--M6-text-grey);
}
i {
font-size: 18px;
text-shadow: 0 0 10px var(--M6-background-white);
}
i:hover {
text-shadow: 0 0 10px var(--M6-background-brown);
}
prose-mirror.active {
background-color: var(--M6-background-white);
}
}
.application {
overflow: visible;
}
.M6 {
background-color: var(--M6-background-white);
color: var(--M6-text-grey);
input {
background-color: var(--M6-background-white);
color: black;
border-radius: 0;
transition: none;
&.skill {
max-width: 2rem;
text-align: center;
margin-left: 0.5rem;
height: 24px;
}
&.attribut {
max-width: 2rem;
text-align: center;
margin: 0 0.5rem;
}
&.text {
&.center {
text-align: center;
}
&.right {
text-align: end;
}
}
}
input:disabled {
border: none;
}
input:focus {
outline: none;
}
select {
background-color: var(--M6-background-white);
color: black;
border-radius: 0;
transition: none;
margin-bottom: 4px;
option:hover {
background-color: var(--M6-background-brown);
}
}
p {
&.center {
text-align: center;
}
&.right {
text-align: end;
}
}
.armor-box {
position: absolute;
margin-left: -8px;
i {
font-size: 20px;
}
}
.armor-value {
position: absolute;
right: 8px;
font-size: 16px;
color: var(--M6-background-white);
}
.sheet-header {
img {
border-radius: 0 0 50% 50%;
border: solid 8px var(--M6-background-grey);
border-top: none;
flex: 0 0 100px;
object-fit: fill;
}
}
.tab {
height: 100%;
padding-top: 10px;
}
.tab {
ul {
list-style: none;
padding-left: 5px;
}
.itemHeader {
border-bottom: 1px solid var(--color-border-light-primary);
.type-label {
font-size: 20px;
}
.document-controls {
flex: 0 0 100px;
}
}
.item {
img {
border: none;
flex: 0 0 30px;
padding-right: 5px;
}
.document-controls {
flex: 0 0 50px;
}
}
}
.tab[data-tab="effects"] {
ul {
list-style: none;
padding-left: 5px;
margin-top: 0;
margin-bottom: 0;
}
.effects-header {
font-size: 16px;
border-bottom: 1px solid var(--color-border-light-primary);
.document-controls {
flex: 0 0 100px;
}
}
.effect {
.effect-label {
img {
border: none;
flex: 0 0 30px;
padding-right: 5px;
}
.effect-name {
line-height: 24px;
}
}
.effect-duration {
flex: 0 0 130px;
}
.document-controls {
flex: 0 0 80px;
}
}
.effect-label {
flex: 2;
}
}
}
+96
View File
@@ -0,0 +1,96 @@
.chat-message {
background: none;
border-radius: 0;
}
.message-header {
.message-names {
color: var(--M6-text-brown);
font-weight: bold;
font-size: 18px;
}
.portrait {
padding: 0 4px;
}
}
.chat-message.message {
background-color: var(--M6-background-grey);
fieldset {
background-color: var(--M6-background-white);
&.highlight {
background-color: var(--M6-background-brown);
}
legend {
color: var(--M6-text-brown);
font-size: 18px;
font-weight: bold;
}
}
.collapsible {
background-color: var(--M6-background-white);
cursor: pointer;
padding: 12px;
font-size: 15px;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
margin: 8px 4px;
&.active {
background-color: var(--M6-background-brown);
box-shadow: none;
margin-bottom: 0px;
}
}
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
/* Style the collapsible content. Note: hidden by default */
.content {
padding: 0 18px;
display: none;
width: auto;
overflow: hidden;
background-color: var(--M6-background-white);
&.active {
display: block;
width: auto;
margin: 8px 4px;
margin-top: 0;
}
.hidden {
display: none;
}
}
.tags {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 0.125rem;
list-style-type: none;
padding-left: 0;
margin: 0.25rem;
.hidden {
display: none;
}
}
.tag {
background-color: var(--M6-background-brown);
color: black;
font-family: var(--sans-serif);
font-size: var(--font-size-10);
text-transform: uppercase;
letter-spacing: 0.05em;
text-rendering: optimizeLegibility;
align-items: center;
border-radius: 2px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
display: inline-flex;
font-weight: 500;
padding: 0.3em;
}
}
+123
View File
@@ -0,0 +1,123 @@
.application.dialog.M6 {
background-color: var(--M6-background-white);
color: var(--M6-text-grey);
fieldset {
border-radius: 0;
border: none;
background-color: var(--M6-background-grey);
&.highlight {
background-color: var(--M6-background-brown);
}
legend {
color: var(--M6-text-brown);
font-size: 24px;
}
}
h5 {
color: var(--M6-text-grey);
}
i {
font-size: 18px;
text-shadow: 0 0 10px var(--M6-background-white);
}
i:hover {
text-shadow: 0 0 10px var(--M6-background-brown);
}
input {
background-color: var(--M6-background-white);
color: black;
border-radius: 0;
&.skill {
max-width: 2rem;
text-align: center;
margin-left: 0.5rem;
}
&.attribut {
max-width: 2rem;
text-align: center;
margin: 0 0.5rem;
}
&.text {
&.right {
text-align: end;
}
}
}
p {
&.center {
text-align: center;
}
}
fieldset {
background-color: var(--M6-background-grey);
legend {
color: var(--M6-text-brown);
font-size: 20px;
}
}
}
/* Container für die gesamte Reihe */
.segmented-button-row {
display: inline-flex;
overflow: hidden;
height: 32px;
}
/* Einzelnes Segment */
.segmented-button {
position: relative;
cursor: pointer;
display: flex;
align-items: center;
}
/* Versteckt den echten Radio-Button, behält aber die Tastatur-Navigation */
.segmented-button input[type="radio"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
/* Inhalt des Segments (Layout & Abstände) */
.segmented-button__content {
display: flex;
align-items: center;
justify-content: center;
padding: 0 8px;
height: 100%;
transition:
background-color 0.2s,
color 0.2s;
background-color: transparent;
user-select: none;
}
/* --- ZUSTÄNDE --- */
/* Selektiert (Selected State) */
.segmented-button input[type="radio"]:checked + .segmented-button__content {
// background-color: #e8def8; /* M3 Secondary Container Color */
text-shadow: 0 0 10px var(--M6-text-brown) !important;
color: #1d192b; /* M3 On-Secondary Container Text */
.icon {
text-shadow: 0 0 10px var(--M6-text-brown) !important;
}
}
/* Hover-Effekt */
.segmented-button:hover .segmented-button__content {
background-color: rgba(73, 69, 79, 0.08);
}
.segmented-button input[type="radio"]:checked:hover + .segmented-button__content {
background-color: rgba(232, 222, 248, 0.85);
}
/* Tastatur-Fokus (Barrierefreiheit) */
.segmented-button input[type="radio"]:focus-visible + .segmented-button__content {
outline: 2px solid #6750a4;
outline-offset: -2px;
}
+1978
View File
File diff suppressed because it is too large. Load diff
+7
View File
@@ -0,0 +1,7 @@
/*!
* Bootstrap Grid v4.1.3 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/@-ms-viewport{width:device-width}html{box-sizing:border-box;-ms-overflow-style:scrollbar}*,::after,::before{box-sizing:inherit}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margLine truncated
/*# sourceMappingURL=bootstrap-grid.min.css.map */
+52
View File
@@ -0,0 +1,52 @@
.application.sheet.M6 {
.sheet-header {
margin-top: 8px;
margin-right: 12px;
.profile-img {
position: absolute;
top: 24px;
left: calc(50% - 50px - 6px);
background-color: var(--M6-background-white);
&:hover {
cursor: pointer;
}
}
.text {
margin-bottom: 4px;
}
.container {
padding: 8px;
background-color: var(--M6-background-grey);
}
}
&.item {
.custom-input {
&.left {
padding-left: 30px;
}
&.right {
padding-right: 30px;
}
}
.input-icon {
position: absolute;
top: 40%;
transform: translateY(-50%);
color: #888;
/* Prevent the icon from blocking input clicks if it's purely decorative */
pointer-events: none;
&.left {
left: 18px;
}
&.right {
right: 18px;
}
}
}
.icon-checked {
background-color: var(--M6-text-brown);
}
}
+33
View File
@@ -0,0 +1,33 @@
.application.sheet.M6 {
.collapsible {
background-color: var(--M6-background-white);
cursor: pointer;
padding: 12px;
font-size: 15px;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
&.active {
background-color: var(--M6-background-brown);
box-shadow: none;
margin-bottom: 0px;
}
}
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
/* Style the collapsible content. Note: hidden by default */
.content {
padding: 0 18px;
display: none;
width: 100%;
overflow: hidden;
background-color: var(--M6-background-white);
&.active {
display: block;
width: 100%;
margin-bottom: 4px;
}
}
}
+21
View File
@@ -0,0 +1,21 @@
.sword {
width: 24px;
height: 24px;
/* Das SVG wird als Maske geladen */
mask: url("../assets/sword.svg") no-repeat center / contain;
-webkit-mask: url("../assets/sword.svg") no-repeat center / contain;
/* Standardfarbe (wird durch die Maske in die Form des SVGs gepresst) */
background-color: var(--M6-text-grey);
}
.helmet {
width: 24px;
height: 24px;
/* Das SVG wird als Maske geladen */
mask: url("../assets/helmet.svg") no-repeat center / contain;
-webkit-mask: url("../assets/helmet.svg") no-repeat center / contain;
/* Standardfarbe (wird durch die Maske in die Form des SVGs gepresst) */
background-color: var(--M6-text-grey);
}
+54
View File
@@ -0,0 +1,54 @@
.application.sheet.M6.actor {
.tab[data-tab="items"] {
ul {
padding-bottom: 20px;
margin: 0;
list-style: none;
padding-left: 5px;
}
.sticky-progress-container {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #f1f1f1;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
padding: 10px 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 9999; /* Bleibt immer im Vordergrund */
}
/* Der graue Hintergrund des Balkens */
.progress-background {
width: 90%; /* Breite des Balkens auf dem Bildschirm */
max-width: 800px; /* Maximale Breite auf großen Bildschirmen */
background-color: #e0e0e0;
overflow: hidden; /* Schneidet den inneren Balken sauber ab */
transform: skewX(-30deg);
}
/* Der eigentliche, animierte Ladebalken */
.progress-bar {
height: 20px;
background-color: var(--M6-background-brown); /* Grün */
text-align: center;
line-height: 20px;
color: white;
font-size: 12px;
font-weight: bold;
width: 100%;
}
progress::-moz-progress-bar {
background: var(--M6-background-brown);
}
progress::-webkit-progress-value {
background: var(--M6-background-brown);
}
progress {
color: var(--M6-background-brown);
}
}
}
+21
View File
@@ -0,0 +1,21 @@
.application.sheet.M6.actor {
.resistenzenHeader {
font-weight: bold;
font-size: 16px;
text-align: center;
}
.resistenzenAttribut {
max-width: 2rem;
text-align: center;
margin: 0;
}
.fa-dice-d20 {
border-radius: 40%;
background-color: var(--M6-background-grey);
margin-right: -7px;
position: relative;
font-size: 18px;
}
}
+69
View File
@@ -0,0 +1,69 @@
.application.sheet.M6 {
section {
&.window-content {
backdrop-filter: blur(0rem);
overflow: visible;
min-height: 0;
}
}
.tabs {
border: none;
position: absolute;
flex-direction: column;
align-items: flex-start;
gap: 0.625rem;
left: calc(100% + 3px);
top: 20%;
.sheet-stack {
display: flex;
flex-direction: column;
align-items: center;
color: var(--M6-text-grey);
.container {
position: relative;
text-align: center;
width: 32px;
height: 36px;
.background {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
mask: var(--mask-square) no-repeat center;
background-color: var(--M6-background-grey);
}
.border {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
background-color: var(--M6-background-grey);
mask: var(--mask-square) no-repeat center;
}
.value {
position: relative;
font-family: var(--cosmere-font-header);
font-weight: 600;
color: var(--M6-text-brown);
z-index: 1;
}
}
}
.active {
text-shadow: 0 0 10px var(--M6-text-brown);
.container {
width: 38px;
height: 36px;
}
}
}
}
+119
View File
@@ -0,0 +1,119 @@
import { systemPath } from "./constants.mjs";
import { loadHelpers } from "./helpers/handlebar-helpers.mjs";
import { loadPartials } from "./helpers/partials.mjs";
import { loadSettings } from "./helpers/settings.mjs";
import { CharacterData } from "./data/character-data.mjs";
import { WeaponData } from "./data/weapon-data.mjs";
import { ItemData } from "./data/item-data.mjs";
import { ArmorData } from "./data/armor-data.mjs";
import { ZauberData } from "./data/zauber-data.mjs";
import { HintergrundData } from "./data/hintergrund-data.mjs";
import { M6ActorSheet } from "./sheets/character-sheet.mjs";
import { M6ItemSheet } from "./sheets/item-sheet.mjs";
import { M6WeaponSheet } from "./sheets/weapon-sheet.mjs";
import { M6ArmorSheet } from "./sheets/armor-sheet.mjs";
import { M6ZauberSheet } from "./sheets/zauber-sheet.mjs";
import { M6HintergrundSheet } from "./sheets/hintergrund-sheet.mjs";
import { M6ChatMessage } from "./ui/chat-message.mjs";
import "./styles/M6.scss";
Hooks.once("init", () => {
CONFIG.ChatMessage.documentClass = M6ChatMessage;
CONFIG.ChatMessage.template = systemPath("templates/chat/message-default.hbs");
CONFIG.Actor.dataModels.character = CharacterData;
CONFIG.Actor.trackableAttributes = {
pc: {
bar: ["resources.leben", "resources.ausdauer"],
value: ["level"]
},
npc: {
bar: ["resources.leben", "resources.ausdauer"],
value: []
}
};
CONFIG.Item.dataModels.item = ItemData;
CONFIG.Item.dataModels.geld = ItemData;
CONFIG.Item.dataModels.weapon = WeaponData;
CONFIG.Item.dataModels.armor = ArmorData;
CONFIG.Item.dataModels.zauber = ZauberData;
CONFIG.Item.dataModels.hintergrund = HintergrundData;
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "midgard6-lvd", M6ActorSheet, {
types: ["character"],
makeDefault: true
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ItemSheet, {
types: ["item"],
makeDefault: true
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ItemSheet, {
types: ["geld"]
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6WeaponSheet, {
types: ["weapon"]
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ArmorSheet, {
types: ["armor"]
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ZauberSheet, {
types: ["zauber"]
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Item,
"midgard6-lvd",
M6HintergrundSheet,
{
types: ["gunst"]
}
);
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Item,
"midgard6-lvd",
M6HintergrundSheet,
{
types: ["makel"]
}
);
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Item,
"midgard6-lvd",
M6HintergrundSheet,
{
types: ["schicksalsgabe"]
}
);
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Item,
"midgard6-lvd",
M6HintergrundSheet,
{
types: ["legende"]
}
);
loadSettings();
loadHelpers();
loadPartials();
});
Hooks.on("renderChatMessageHTML", (message, html, data) => {
const collapsible = html.querySelectorAll("div[data-action=collapsible]");
if (collapsible) {
collapsible.forEach((node) => {
node.addEventListener(
"click",
function () {
node.classList.toggle("active");
var content = node.nextElementSibling;
content.classList.toggle("active");
node.getElementsByTagName("i")[0].classList.toggle("fa-compress");
},
{ capture: true }
);
});
}
});
-28
View File
@@ -1,28 +0,0 @@
import { CharacterData } from "./data/character-data";
import { ItemData } from "./data/item-data";
import { CharacterSheet } from "./sheets/character-sheet";
import { ItemSheet } from "./sheets/item-sheet";
Hooks.once("init", () => {
CONFIG.Actor.dataModels.character = CharacterData;
CONFIG.Item.dataModels.item = ItemData;
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Actor,
"fvtt-ts-react-boilerplate",
CharacterSheet,
{
types: ["character"],
makeDefault: true
}
);
foundry.applications.apps.DocumentSheetConfig.registerSheet(
Item,
"fvtt-ts-react-boilerplate",
ItemSheet,
{
types: ["item"],
makeDefault: true
}
);
});
+18
View File
@@ -0,0 +1,18 @@
import { CharacterData } from "../data/character-data";
import { ItemData } from "../data/item-data";
import { WeaponData } from "../data/weapon-data";
import { ArmorData } from "../data/armor-data";
import { ZauberData } from "../data/zauber-data";
import { HintergrundData } from "../data/hintergrund-data";
declare module "fvtt-types/configuration" {
interface DataModelConfig {
Actor: { character: typeof CharacterData };
Item: {
item: typeof ItemData,
weapon: typeof WeaponData,
armor: typeof ArmorData,
zauber: typeof ZauberData
hintergrund: typeof HintergrundData };
}
}
-9
View File
@@ -1,9 +0,0 @@
import type { CharacterData } from "../data/character-data";
import type { ItemData } from "../data/item-data";
declare module "fvtt-types/configuration" {
interface DataModelConfig {
Actor: { character: typeof CharacterData };
Item: { item: typeof ItemData };
}
}
File renamed without changes.
+170
View File
@@ -0,0 +1,170 @@
// import { processMessage } from "./message-logic/process-message.js";
export class M6ChatMessage extends ChatMessage {
// Default avatar for the chat message
static DEFAULT_AVATAR = "icons/svg/mystery-man.svg";
/**
* Render the HTML for the ChatMessage which should be added to the log
* @param {object} [options] Additional options passed to the Handlebars template.
* @param {boolean} [options.canDelete] Render a delete button. By default, this is true for GM users.
* @param {boolean} [options.canClose] Render a close button for dismissing chat card notifications.
* @returns {Promise<HTMLElement>}
*/
async renderHTML({ canDelete, canClose = false, ...rest } = {}) {
// Default message template
this.template = CONFIG.ChatMessage.template;
// By default, GM users have the trash-bin icon in the chat log itself
canDelete ??= game.user.isGM || game.user === this.author;
if (typeof this.system.renderHTML === "function") {
const html = await this.system.renderHTML({ canDelete, canClose, ...rest });
Hooks.callAll("renderChatMessageHTML", this, html);
return html;
}
// Determine some metadata
const speakerActor = this.speakerActor;
const data = this.toObject(false);
if (!this.isRoll || this.isContentVisible) {
data.content = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
data?.flags?.m6?.description || this.content,
{
rollData: this.getRollData(),
secrets: speakerActor?.isOwner ?? game.user.isGM
}
);
}
const isWhisper = this.whisper.length;
// Construct message data
this.messageData = {
// Base messageData and permissions
...rest,
message: data,
canDelete,
canClose,
isGM: game.user.isGM,
isWhisper: this.whisper.length,
whisperTo: this.whisper.map((u) => game.users.get(u)?.name).filterJoin(", "),
isContentVisible: this.isContentVisible,
// User and author data
user: game.user,
author: this.author,
// Display info
title: this.flags["midgard6-lvd"]?.title,
name: this.flags["midgard6-lvd"]?.name,
description: this.flags["midgard6-lvd"]?.description,
alias: this.alias,
speakerActor,
// If the user can't see the currently visible content, then prefer the author's avatar;
// Otherwise, use the character's avatar (if present), and fall back to the default avatar
// as a last resort
portrait:
((this.isContentVisible ? speakerActor?.img : undefined) ?? this.author?.avatar) ||
this.constructor.DEFAULT_AVATAR,
// CSS classes
cssClass: [
this.style === CONST.CHAT_MESSAGE_STYLES.IC ? "ic" : null,
this.style === CONST.CHAT_MESSAGE_STYLES.EMOTE ? "emote" : null,
isWhisper ? "whisper" : null,
this.blind ? "blind" : null
].filterJoin(" "),
// System-specific flags
eigenschaften: this.isContentVisible ? this.getFlag("midgard6-lvd", "eigenschaften") : "",
merkmale: this.isContentVisible ? this.getFlag("midgard6-lvd", "merkmale") : "",
beschreibung: this.isContentVisible ? this.getFlag("midgard6-lvd", "beschreibung") : "",
zeigeZauberAlsTag: game.settings.get("midgard6-lvd", "zauberAlsTag"),
isSpell: this.getFlag("midgard6-lvd", "isSpell"),
isRoll: this?.isRoll || false
};
// Render additional message data
if (this.isRoll) {
await this.#renderRollContent(this.messageData);
}
// Add a check in for in case modules are adding content to use that as the description
// if (this.messageData?.message?.content) {
// this.messageData.description = this.messageData?.message?.content;
// }
// Render the chat message
let html = await foundry.applications.handlebars.renderTemplate(
this.template,
this.messageData
);
html = foundry.utils.parseHTML(html);
// Flag expanded state of dice rolls
Hooks.callAll("renderChatMessageHTML", this, html, this.messageData);
// Get whether descriptions should auto-expand for this user or not and apply the styling
const autoExpand = game.settings.get("midgard6-lvd", "beschreibungChatActive");
if (autoExpand) {
const collapsibleContent = html.querySelector(".collapsible.beschreibung");
if (collapsibleContent) {
collapsibleContent.classList.toggle("active");
var content = collapsibleContent.nextElementSibling;
content.classList.toggle("active");
collapsibleContent.getElementsByTagName("i")[0].classList.toggle("fa-compress");
}
}
return html;
}
// Code pulled from core since this is a private method as of V13
async #renderRollContent(messageData) {
const data = messageData.message;
const renderRolls = async (isPrivate) => {
let html = "";
let content = [];
for (const roll of this.rolls) {
html = await roll.render({
isPrivate
});
content.push({ options: roll.options, html });
}
return content;
};
// Suppress the "to:" whisper flavor for private rolls
if (this.blind || this.whisper.length) messageData.isWhisper = false;
// Display standard Roll HTML content
if (this.isContentVisible) {
const el = document.createElement("div");
el.innerHTML = data.content; // Ensure the content does not already contain custom HTML
if (!el.childElementCount && this.rolls.length) {
data.content = await this.#renderRollHTML(false);
}
} else {
// Otherwise, show "rolled privately" messages for Roll content
const name = this.author?.name ?? game.i18n.localize("CHAT.UnknownUser");
data.flavor = game.i18n.format("CHAT.PrivateRollContent", {
user: foundry.utils.escapeHTML(name)
});
data.content = await renderRolls(true);
messageData.alias = name;
}
}
async #renderRollHTML(isPrivate) {
let html = "";
let content = [];
for (const roll of this.rolls) {
html = await roll.render({
isPrivate,
message: this
});
content.push({ options: roll.options, html });
}
return content;
}
}
+29 -15
View File
@@ -1,14 +1,14 @@
{ {
"id": "fvtt-ts-react-boilerplate", "id": "midgard6-lvd",
"version": "0.8.2", "version": "0.8.2",
"title": "FVTT TS+React Boilerplate", "title": "Midgard: Legenden von Damatu",
"url": "", "url": "",
"description": "A TypeScript + React + Vite boilerplate for Foundry VTT V14 system development", "description": "Eine Midgard: LvD implementation",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"authors": [ "authors": [
{ {
"name": "Nyukhu", "name": "Byroks",
"url": "https://foundryvtt.com", "url": "https://git.byroks.de",
"flags": {} "flags": {}
} }
], ],
@@ -16,15 +16,15 @@
"styles": ["dist/style.css"], "styles": ["dist/style.css"],
"languages": [ "languages": [
{ {
"lang": "en", "lang": "de",
"name": "English", "name": "Deutsch",
"path": "lang/en.json", "path": "lang/de.json",
"flags": {} "flags": {}
}, },
{ {
"lang": "fr", "lang": "en",
"name": "Français", "name": "English",
"path": "lang/fr.json", "path": "lang/en.json",
"flags": {} "flags": {}
} }
], ],
@@ -33,17 +33,31 @@
"character": {} "character": {}
}, },
"Item": { "Item": {
"item": {} "item": {},
"weapon": {},
"armor": {},
"zauber": {},
"gunst": {},
"makel": {},
"schicksalsgabe": {},
"legende": {},
"geld": {}
} }
}, },
"compatibility": { "compatibility": {
"minimum": "14", "minimum": "13",
"verified": "14" "verified": "14"
}, },
"manifest": "", "manifest": "",
"download": "", "download": "",
"grid": { "grid": {
"distance": 5, "distance": 1,
"units": "ft" "units": "m"
},
"flags": {
"hotReload": {
"extensions": ["css", "scss", "html", "hbs", "json"],
"paths": ["dist", "templates", "lang", "src", "src/styles/M6.scss"]
}
} }
} }
+24
View File
@@ -0,0 +1,24 @@
{{! Beschreibung Allgemein Tab }}
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
>
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Sheets.Tabs.biographie"}}</legend>
{{#if editable}}
<prose-mirror
style="height:100%"
name="system.biographie.beschreibung"
data-document-u-u-i-d="{{actor.uuid}}"
value="{{system.biographie.beschreibung}}"
collaborate="true"
toggled="true"
>
{{{enrichedBeschreibung}}}
</prose-mirror>
{{else}}
{{{enrichedBeschreibung}}}
{{/if}}
</fieldset>
</section>
+280
View File
@@ -0,0 +1,280 @@
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
>
<div class="container">
<div class="row">
<div class="col-7">
{{#each skills}}
{{#if fieldset}}
<fieldset>
<legend>{{localize legend}}</legend>
{{#each fields}}
<div class="row align-items-center">
<div class="col-6 row align-items-center" style="width: 100%; margin-left: 0">
<a
class="col-8"
data-action="rollSkill"
data-name="{{localize localizationName}}"
data-path="{{field.fieldPath}}"
{{#unless @root.editable}}disabled{{/unless}}
>
<p>{{localize
localizationName
}}</p>
</a>
<a
data-action="rollSkill"
data-name="{{localize localizationName}}"
data-path="{{field.fieldPath}}"
{{#unless @root.editable}}disabled{{/unless}}
>
<i
class="fa-solid fa-dice-d20"
style="padding:2px 0; margin-right: -14px"
></i>
</a>
<input
class="skill"
type="number"
name="{{field.fieldPath}}"
value="{{value}}"
{{#unless @root.editable}}disabled{{/unless}}
{{#if @root.system.locked}}disabled{{/if}}
/>
<a
data-action="addSpezialisierung"
data-name="{{field.label}}"
data-path="{{field.fieldPath}}"
{{#unless @root.editable}}disabled{{/unless}}
{{#if @root.system.locked}}disabled{{/if}}
>+</a>
</div>
<div class="col d-flex flex-wrap" style="gap: 4px 8px; width: 100%">
{{#each bonuses}}
<a data-action="editSepzialisierung"
data-name="{{name}}"
data-level="{{level}}"
data-path="{{path}}"
style="white-space: nowrap;"
{{#unless @root.editable}}disabled{{/unless}}
{{#if @root.system.locked}}disabled{{/if}}
{{#unless @last}}style="margin-right: 4px"{{/unless}}>{{name}}: {{level}}{{#unless @last}},{{/unless}}</a>
{{/each}}
</div>
</div>
{{/each}}
</fieldset>
{{/if}}
{{/each}}
</div>
<div class="col-5">
<fieldset class="">
<legend>{{localize "Midgard6.Attribute.resistenzen"}}</legend>
<div class="row">
{{#each resistenzen.fields}}
<div class="col-4">
<p class="resistenzenHeader">{{localize localizationName}}</p>
<div class="d-flex justify-content-center align-items-center">
<a
class=""
data-action="rollSkill"
data-name="{{localize localizationName}}"
data-path="{{field.fieldPath}}"
{{#unless @root.editable}}disabled{{/unless}}
>
<i class="fa-solid fa-dice-d20" style=""></i>
</a>
<input
class="resistenzenAttribut"
type="number"
name="{{field.fieldPath}}"
value="{{value}}"
{{#if @root.system.locked}}disabled{{/if}}
/>
</div>
</div>
{{/each}}
</div>
</fieldset>
<div class="d-flex">
<fieldset class="col highlight">
<legend>{{localize "Midgard6.Attribute.lp"}}</legend>
<div class="d-flex align-items-end">
<div>
<p class="resistenzenHeader">{{localize "Midgard6.aktuell"}}</p>
<div class="d-flex align-items-center">
<div class="armor-box">
<i class="fa-solid fa-shield"></i>
<span class="armor-value">{{system.rüstwert.mod}}</span>
</div>
<input
class="attribut"
type="number"
name="system.resources.leben.value"
value="{{system.resources.leben.value}}"
/>
</div>
</div>
<p class="center">/</p>
<div>
<p class="resistenzenHeader">{{localize "Midgard6.maximal.short"}}</p>
<input
class="attribut"
type="number"
name="system.resources.leben.max"
value="{{system.resources.leben.max}}"
{{#if @root.system.locked}}disabled{{/if}}
/>
</div>
</div>
</fieldset>
<fieldset class="col highlight">
<legend>{{localize "Midgard6.Attribute.ap"}}</legend>
<div class="d-flex align-items-end">
<div>
<p class="resistenzenHeader">{{localize "Midgard6.aktuell"}}</p>
<input
class="attribut"
type="number"
name="system.resources.ausdauer.value"
value="{{system.resources.ausdauer.value}}"
/>
</div>
<p class="center">/</p>
<div>
<p class="resistenzenHeader">{{localize "Midgard6.maximal.short"}}</p>
<input
class="attribut"
type="number"
name="system.resources.ausdauer.max"
value="{{system.resources.ausdauer.max}}"
{{#if @root.system.locked}}disabled{{/if}}
/>
</div>
</div>
</fieldset>
</div>
<div>
<fieldset class="col highlight">
<legend>{{localize "Midgard6.Schicksalsmünzen"}}</legend>
<div class="d-flex justify-content-start align-items-center">
<input
style="max-width: 3rem"
class="attribut"
type="number"
name="system.schicksalsmünzen"
value="{{system.schicksalsmünzen}}"
/>
<div style="margin-left: 16px">
<ul style="margin: 0px; list-style-type: disclosure-closed;">
<li style="font-weight:bold">Misserfolg <i class="fas fa-arrow-right" style="font-size:12px"></i> geringer Erfolg</li>
<li style="font-weight:bold">Würfelwurf wiederholen</li>
<li style="font-weight:bold">Geistesblitz</li>
<li style="font-weight:bold">Mitspielende belohnen</li>
</ul>
</div>
</div>
</fieldset>
</div>
<div>
<fieldset class="highlight">
<legend>{{localize "Midgard6.Item.type.weapon.plural" }}</legend>
<div class="container">
{{#each equippedWeapons as |weapon|}}
<div class="item row align-items-center">
<div class="col-10">
<div class="d-flex justify-content-start align-items-center">
<img class="" style="margin-right: 4px" src="{{weapon.img}}" alt="{{weapon.name}}" width="24" height="24" />
<p>{{weapon.name}}: </p>
<p>
<i class="fas fa-dice-d20" style="font-size:12px; margin:0 2px 0 4px"></i>
+ {{weapon.skillValue}} {{#if weapon.bonusValue}}+ {{weapon.bonusValue}}{{/if}}</p>
</div>
</div>
<div class="col-2 document-controls">
<a
class="item-control"
title="{{localize 'Midgard6.Angriff'}} {{weapon.name}}"
data-action="rollWeapon"
data-item-id="{{weapon.id}}"
data-skillPath="{{weapon.path}}"
{{#unless @root.editable}}disabled{{/unless}}
>
<i class="fas fa-dice-d20"></i>
</a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</div>
<div>
<fieldset class="highlight">
<legend>{{localize "Midgard6.Item.type.armor.plural" }}</legend>
<div class="container">
{{#each armor.armors as |armor|}}
<div class="item row align-items-center">
<div class="col-10">
<div class="d-flex justify-content-start align-items-center">
<img class="" style="margin-right: 4px" src="{{armor.img}}" alt="{{armor.name}}" width="24" height="24" />
<p>{{armor.name}}</p>
</div>
</div>
<div class="col-2">
<div class="armor-box" style="position: relative; margin-left: 0px; top: 12px">
<i class="fa-solid fa-shield"></i>
<span class="armor-value" style="position: relative; right:-8px; top: -22px">{{armor.rüstwert}}</span>
</div>
</div>
</div>
{{/each}}
{{#if armor.einschränkungen}}
<p class="resistenzenHeader">{{localize "Midgard6.Item.einschränkung"}}</p>
<p>{{splitArray armor.einschränkungen}}</p>
{{/if}}
</div>
</fieldset>
</div>
<div>
<fieldset class="highlight">
<legend>{{localize "Midgard6.Item.type.zauber.plural" }}</legend>
<div class="container">
{{#each equippedSpells as |weapon|}}
<div class="item row align-items-center">
<div class="col-10">
<div class="d-flex justify-content-start align-items-center">
<img class="" style="margin-right: 4px" src="{{weapon.img}}" alt="{{weapon.name}}" width="24" height="24" />
<p>{{weapon.name}}: </p>
<p>
<i class="fas fa-dice-d20" style="font-size:12px; margin:0 2px 0 4px"></i>
+ {{weapon.skillValue}} {{#if weapon.bonusValue}}+ {{weapon.bonusValue}}{{/if}}</p>
</div>
</div>
<div class="col-2 document-controls">
<a
class="item-control"
title="{{localize 'Midgard6.Angriff'}} {{weapon.name}}"
data-action="rollSpell"
data-item-id="{{weapon.id}}"
data-skillPath="{{weapon.path}}"
{{#unless @root.editable}}disabled{{/unless}}
>
<i class="fas fa-dice-d20"></i>
</a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</div>
</div>
</div>
</div>
</section>
+28
View File
@@ -0,0 +1,28 @@
<header class="sheet-header">
<div class="container">
<div class="row">
<div class="col-6">
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{actor.name}}" />
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.Biographie.spezies"}}" name="system.biographie.spezies" value="{{system.biographie.spezies}}" />
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.Biographie.kultur"}}" name="system.biographie.kultur" value="{{system.biographie.kultur}}" />
</div>
<img
class="profile-img"
style="z-index:1"
src="{{actor.img}}"
alt="{{actor.name}}"
{{#if editable}}
data-action="editImage"
data-edit="img"
{{/if}}
data-tooltip="{{actor.name}}"
height="100" width="100"
>
<div class="col-6">
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.abenteuertyp"}}" name="system.biographie.abenteuertyp" value="{{system.biographie.abenteuertyp}}" />
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.glaube"}}" name="system.biographie.glaube" value="{{system.biographie.glaube}}" />
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.mondgestalt"}}" name="system.biographie.mondgestalt" value="{{system.biographie.mondgestalt}}" />
</div>
</div>
</div>
</header>
+266
View File
@@ -0,0 +1,266 @@
{{! Beschreibung Allgemein Tab }}
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
>
<div class="container">
<div class="row">
<div class="col-12">
<fieldset>
<legend>{{localize "Midgard6.Grad.grad"}}</legend>
<div class="d-flex justify-content-center align-items-center">
<input
type="number"
class="text center"
style="max-width:3rem;"
name="system.grad.grad"
value="{{system.grad.grad}}"
/>
<p style="font-size:18px; font-weight: bold; padding: 0 8px">{{localize
"Midgard6.Grad.erfahrung"
}}</p>
<div
class="d-flex align-items-center justify-content-center flex-column"
style="position: relative;"
>
<label style="position: absolute; bottom: 100%; font-size: 12px;">{{localize
"Midgard6.Grad.frei"
}}</label>
<input
type="number"
class="text center"
style="max-width:3rem;"
name="system.grad.erfahrungspunkteFrei"
value="{{system.grad.erfahrungspunkteFrei}}"
/>
</div>
<p style=" font-size:32px; padding: 0 8px">+</p>
<div
class="d-flex align-items-center justify-content-center flex-column"
style="position: relative;"
>
<label style="position: absolute; bottom: 100%; font-size: 12px;">{{localize
"Midgard6.Grad.eingesetzt"
}}</label>
<input
type="number"
class="text center"
style="max-width:3rem;"
name="system.grad.erfahrungspunkteEingesetzt"
value="{{system.grad.erfahrungspunkteEingesetzt}}"
/>
</div>
<p style=" font-size:32px; padding: 0 8px">=</p>
<div
class="d-flex align-items-center justify-content-center flex-column"
style="position: relative;"
>
<label style="position: absolute; bottom: 100%; font-size: 12px;">{{localize
"Midgard6.Grad.gesamt"
}}</label>
<input
type="number"
class="text center"
style="max-width:3rem;"
name="system.grad.erfahrungsschatz"
value="{{system.grad.erfahrungsschatz}}"
/>
</div>
</div>
</fieldset>
</div>
<div class="col-12">
<fieldset>
<legend>{{localize "Midgard6.Hintergrund.type.gunst.singular"}}
&
{{localize "Midgard6.Hintergrund.type.makel.singular"}}</legend>
<div class="row">
<div class="col-6">
{{#with itemTypes.gunst}}
{{#each this.items as |gunst|}}
<div
class="collapsible"
data-action="collapsible"
data-item-id="{{gunst._id}}"
data-type="Item"
data-document-class="Item"
>{{gunst.name}}
<div>
<i class="fas fa-expand"></i>
{{#if @root.editable}}
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=gunst.name}}"
style="z-index:9999"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</div>
<div class="content">
{{{gunst.system.beschreibung}}}
</div>
{{/each}}
{{/with}}
</div>
<div class="col-6">
{{#with itemTypes.makel}}
{{#each this.items as |makel|}}
<div
type="button"
class="collapsible"
data-action="collapsible"
data-item-id="{{makel._id}}"
data-type="Item"
data-document-class="Item"
>{{makel.name}}
<div>
<i class="fas fa-expand"></i>
{{#if @root.editable}}
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=gunst.name}}"
style="z-index:9999"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</div>
<div class="content">
{{{makel.system.beschreibung}}}
</div>
{{/each}}
{{/with}}
</div>
</div>
</fieldset>
</div>
<div class="col-6" style="height: 100%">
<fieldset>
<legend>{{localize "Midgard6.Hintergrund.type.legende.plural"}}</legend>
<div class="row">
<div class="col">
{{#with itemTypes.legende}}
<div class="itemHeader" style="margin-bottom: 8px">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="legende"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</div>
{{#each this.items as |legende|}}
<div
class="collapsible"
data-action="collapsible"
data-item-id="{{legende._id}}"
data-type="Item"
data-document-class="Item"
>{{legende.name}}
<div>
<i class="fas fa-expand"></i>
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=item.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
{{#if @root.editable}}
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=legende.name}}"
style="z-index:9999"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</div>
<div class="content">
{{{legende.system.beschreibung}}}
</div>
{{/each}}
{{/with}}
</div>
</div>
</fieldset>
</div>
<div class="col-6">
<fieldset>
<legend>{{localize "Midgard6.Hintergrund.type.schicksalsgabe.plural"}}</legend>
<div class="row">
<div class="col">
{{#with itemTypes.schicksalsgabe}}
<div class="itemHeader" style="margin-bottom: 8px">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="schicksalsgabe"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</div>
{{#each this.items as |schicksalsgabe|}}
<div
class="collapsible"
data-action="collapsible"
data-item-id="{{schicksalsgabe._id}}"
data-type="Item"
data-document-class="Item"
>{{schicksalsgabe.name}}
<div>
<i class="fas fa-expand"></i>
{{#if @root.editable}}
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=schicksalsgabe.name}}"
style="z-index:9999"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</div>
<div class="content">
{{{gunst.system.beschreibung}}}
</div>
{{/each}}
{{/with}}
</div>
</div>
</fieldset>
</div>
</div>
</div>
</section>
+237
View File
@@ -0,0 +1,237 @@
{{! Items Tab }}
<section class="standard-form tab scrollable {{tab.cssClass}}" data-group="primary" data-tab="items">
<div class="container">
<div class="row">
<div class="col-6">
<fieldset >
<legend>{{localize "Midgard6.Item.type.münze.plural" }}</legend>
<ul class="itemTypes">
{{#with itemTypes.geld}}
<li class="itemHeader">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="geld"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</li>
<ul class="items">
{{#each this.items as |item|}}
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
{{#if @root.editable}}
<div class="document-controls">
<a
class="item-control"
data-action="decreaseDoc"
data-item-id="{{item._id}}"
>
<i class="fas fa-minus"></i>
</a>
<a
class="item-control"
data-action="increaseDoc"
data-item-id="{{item._id}}"
>
<i class="fas fa-plus"></i>
</a>
</div>
<div class="document-controls">
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=item.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
</div>
{{/if}}
</li>
{{/each}}
</ul>
{{/with}}
</fieldset>
<fieldset >
<legend>{{localize "Midgard6.Item.type.item.plural" }}</legend>
<ul class="itemTypes">
{{#with itemTypes.item}}
<li class="itemHeader">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="item"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</li>
<ul class="items">
{{#each this.items as |item|}}
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=item.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</li>
{{/each}}
</ul>
{{/with}}
</fieldset>
</div>
<div class="col-6">
{{!-- Waffen --}}
<fieldset class="highlight">
<legend>{{localize "Midgard6.Item.type.weapon.plural" }}</legend>
<ul class="itemTypes">
{{#with itemTypes.weapon}}
<li class="itemHeader">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="weapon"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</li>
<ul class="items">
{{#each this.items as |item|}}
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
<a class="sword" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}background-color: var(--M6-text-brown){{/if}}">
</a>
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=item.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</li>
{{/each}}
</ul>
{{/with}}
</fieldset>
{{!-- Rüstung --}}
<fieldset>
<legend>{{localize "Midgard6.Item.type.armor.plural" }}</legend>
<ul class="itemTypes">
{{#with itemTypes.armor}}
<li class="itemHeader">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type=this.label}}"
data-action="createDoc"
data-document-class="Item"
data-type="armor"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type=this.label}}
</a>
{{/if}}
</div>
</li>
<ul class="items">
{{#each this.items as |item|}}
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
<a class="fa-solid fa-shield" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}color: var(--M6-text-brown){{/if}}"></a>
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=item.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</li>
{{/each}}
</ul>
{{/with}}
</fieldset>
</div>
</div>
</div>
</ul>
<div class="sticky-progress-container">
<div class="progress-background">
<progress
class="progress-bar"
value="{{gewicht.gewicht}}"
max="{{gewicht.traglast}}"
></progress>
</div>
</div>
</section>
+60
View File
@@ -0,0 +1,60 @@
{{! Items Tab }}
<section class="standard-form tab scrollable {{tab.cssClass}}" data-group="primary" data-tab="zauber">
<div class="container">
<div class="row">
<div class="col-12">
<fieldset >
<legend>{{localize "Midgard6.Item.type.zauber.plural" }}</legend>
<ul class="itemTypes">
<li class="itemHeader">
<div class="document-controls">
{{#if @root.editable}}
<a
class="item-control item-create"
title="{{localize 'DOCUMENT.Create' type="Zauber"}}"
data-action="createDoc"
data-document-class="Item"
data-type="zauber"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.Create" type="Zauber"}}
</a>
{{/if}}
</div>
</li>
<ul class="items">
{{#each zauber as |zauber|}}
<li class="item row align-content-center draggable" data-item-id="{{zauber._id}}" data-type="Zauber" data-document-class="Item">
<p class="col-3" style="padding-top: 8px">{{zauber.name}}</p>
<p class="col-3 item-name">{{zauber.system.eigenschaften.ursprung}}</p>
<p class="col-2 item-name">{{localize "Midgard6.Zauber.stufe"}} {{zauber.system.eigenschaften.stufe}}</p>
<a class="align-self-center col-1 fa-solid {{#if zauber.system.equipped}}fa-book-open{{else}}fa-book{{/if}}" {{#unless @root.editable}}disabled{{/unless}} data-action="cycleEquip" data-item-id="{{zauber._id}}" style="{{#if zauber.system.equipped}}color: var(--M6-text-brown);{{/if}}"></a>
<a class="align-self-center col-2 fa-solid fa-dice-d20" data-action="rollSpell" {{#unless @root.editable}}disabled{{/unless}} data-name="{{zauber.name}}" data-item-id="{{zauber._id}}"></a>
<div class="col-1 d-flex document-controls" style="margin: 0.5rem 0; padding: 0">
{{#if @root.editable}}
<a
class="item-control item-edit"
title="{{localize 'DOCUMENT.Update' type=zauber.name}}"
data-action="viewDoc"
>
<i class="fas fa-edit"></i>
</a>
<a
class="item-control item-delete"
title="{{localize 'DOCUMENT.Delete' type=zauber.name}}"
data-action="deleteDoc"
>
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</li>
{{/each}}
</ul>
</fieldset>
</div>
</div>
</div>
</ul>
</section>
+37
View File
@@ -0,0 +1,37 @@
<header class="message-header flexrow">
<div class="portrait">
<img src="{{portrait}}" alt="{{alias}}" inert />
</div>
<div class="message-names flexcol">
<span class="message-sender">
{{alias}}
</span>
<span class="whisper-to">
{{author.name}}
</span>
{{#if isWhisper}}
<span class="whisper-to">{{localize "CHAT.To"}}: {{whisperTo}}</span>
{{/if}}
</div>
<div class="message-metadata">
{{!-- <time class="message-timestamp">{{timeSinceShort message.timestamp}}</time> --}}
{{#if canDelete}}
<a aria-label="{{localize 'Delete'}}" class="message-delete" data-action="deleteMessage">
<i class="fa-solid fa-trash" inert></i>
</a>
{{/if}}
{{#if canClose}}
<a
aria-label="{{localize 'CHAT.Dismiss'}}"
class="message-dismiss"
data-action="dismissMessage"
>
<i class="fa-solid fa-xmark" inert></i>
</a>
{{/if}}
</div>
{{#if message.flavor}}
<span class="flavor-text">{{{message.flavor}}}</span>
{{/if}}
</header>
+69
View File
@@ -0,0 +1,69 @@
<li class="chat-message message flexcol {{cssClass}}" data-message-id="{{message._id}}" {{#if borderColor}}style="border-color:{{borderColor}}"{{/if}}>
{{> "systems/midgard6-lvd/templates/chat/chat-message-header.hbs"}}
{{!-- <hr> --}}
{{#if isContentVisible}}
{{#if isSpell}}
<div class="tags {{#unless zeigeZauberAlsTag}}hidden{{/unless}}">
{{#each eigenschaften as |eigenschaft|}}
{{#if eigenschaft}}
<div class="tag">{{eigenschaft}}</div>
{{/if}}
{{/each}}
</div>
<div
class="collapsible {{#if zeigeZauberAlsTag}}hidden{{/if}}"
data-action="collapsible"
>{{localize "Midgard6.Item.merkmale"}}
<div>
<i class="fas fa-expand"></i>
</div>
</div>
<div class="content">
{{#each eigenschaften as |eigenschaft|}}
{{#if eigenschaft}}
<p>{{localizeConcat "Midgard6.Zauber." @key}}: {{eigenschaft}}</p>
{{/if}}
{{/each}}
</div>
{{/if}}
{{#if merkmale}}
<div class="tags">
{{#each merkmale as |merkmal|}}
<div class="tag">{{merkmal}}</div>
{{/each}}
</div>
{{/if}}
{{#if isRoll}}
{{#each message.content as |roll|}}
<fieldset>
{{#if roll.options.title}}<legend>{{roll.options.title}}</legend>{{/if}}
{{{roll.html}}}
</fieldset>
{{/each}}
{{else}}
<fieldset>
{{#if title}}<legend>{{title}}</legend>{{/if}}
{{{message.content}}}
</fieldset>
{{/if}}
{{#if beschreibung}}
<div
class="collapsible beschreibung"
data-action="collapsible"
>{{localize "Midgard6.Item.Description"}}
<div>
<i class="fas fa-expand"></i>
</div>
</div>
<div class="content">
{{{beschreibung}}}
</div>
{{/if}}
{{else}}
{{> "systems/midgard6-lvd/templates/chat/secret-roll.hbs"}}
{{/if}}
</li>
+13
View File
@@ -0,0 +1,13 @@
<fieldset>
{{#if isRoll}}
<legend>???</legend>
<div class="dice-roll">
<div class="dice-result">
<div class="dice-formula">???</div>
<h4 class="dice-total">?</h4>
</div>
</div>
{{else}}
<p>???</p>
{{/if}}
</fieldset>
+9
View File
@@ -0,0 +1,9 @@
<div class="form-group">
<label>{{localize "Type"}}</label>
<div class="form-fields">
<select name="type">
{{selectOptions types selected=type}}
</select>
</div>
</div>
+91
View File
@@ -0,0 +1,91 @@
<section class="standard-form" style="margin-bottom: 1rem">
<fieldset>
<legend>Modifikation</legend>
<div class="container">
<div class="row">
{{! <div class="d-flex align-items-center"> }}
<div class="col-6">
<input
type="text"
style="margin-left: 8px;"
name="customRoll"
id="rollDisplay"
placeholder="1d20 + {{skillValue}}"
value="{{customRoll}}"
/>
</div>
<div class="d-flex col-6" style="padding-left: 8px;">
<div class="segmented-button-row">
<!-- Option 1 -->
<label class="segmented-button">
<input type="radio" name="vorteil-segment" value="-1" />
<span class="segmented-button__content">
<i class="icon fa-solid fa-arrow-down" style="color:red"></i>
<i class="icon fa-solid fa-dice-d20" style=""></i>
</span>
</label>
<!-- Option 2 -->
<label class="segmented-button">
<input type="radio" name="vorteil-segment" value="0" checked />
<span class="segmented-button__content">
<i class="icon fa-solid fa-dice-d20" style=""></i>
</span>
</label>
<!-- Option 3 -->
<label class="segmented-button">
<input type="radio" name="vorteil-segment" value="1" />
<span class="segmented-button__content">
<i class="icon fa-solid fa-dice-d20" style=""></i>
<i class="icon fa-solid fa-arrow-up" style="color:blue"></i>
</span>
</label>
</div>
</div>
{{! </div> }}
<div class="col-12 d-flex">
<div class="flexrow" style="padding-left: 8px">
<div class="segmented-button-row">
<!-- Option 1 -->
{{#each bonuses}}
<label class="segmented-button">
<input
type="radio"
name="spezialisierung-segment"
value="{{level}}"
data-name="{{name}}"
{{#ifeq name preSelectedSpez}}checked{{/ifeq}}
/>
<span class="segmented-button__content">
{{name}}:
{{level}}
</span>
</label>
{{/each}}
</div>
</div>
</div>
{{#if damageRoll}}
<div class="col-6">
<input
type="text"
style="margin-left: 8px;"
name="customRollDamage"
id="rollDamageDisplay"
placeholder="{{damageRoll}}"
value="{{customDamageRoll}}"
/>
</div>
{{/if}}
</div>
<div class="d-flex">
<select style="max-width: 15rem; margin-left: 8px" name="rollMode" data-type="String">
{{selectOptions rollModes selected=rollMode localize=true}}
</select>
</div>
</div>
</fieldset>
</section>
@@ -0,0 +1,46 @@
<section class="standard-form" style="margin-bottom: 1rem">
<fieldset>
<legend>{{localize "Midgard6.Sheets.spezialisierung"}}</legend>
<div class="">
<div class="d-flex align-items-center justify-content-between">
<input
type="text"
style="margin-left: 8px; max-width:10rem"
name="spezName"
id="spezName"
placeholder="Spezialisierungs Name"
value="{{spezName}}"
/>
<div class="flexrow" style="padding-left: 8px">
<div class="segmented-button-row">
<!-- Option 1 -->
<p>{{localize "Midgard6.Stufe"}}:</p>
<label class="segmented-button">
<input type="radio" name="level-segment" value="1" checked />
<span class="segmented-button__content">
<p>1</p>
</span>
</label>
<!-- Option 2 -->
<label class="segmented-button">
<input type="radio" name="level-segment" value="2" />
<span class="segmented-button__content">
<p>2</p>
</span>
</label>
<!-- Option 3 -->
<label class="segmented-button">
<input type="radio" name="level-segment" value="3" />
<span class="segmented-button__content">
<p>3</p>
</span>
</label>
</div>
</div>
</div>
</div>
</fieldset>
</section>
+25
View File
@@ -0,0 +1,25 @@
{{! Beschreibung Allgemein Tab }}
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
style="overflow: hidden"
>
{{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }}
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Description"}}</legend>
{{#if editable}}
<prose-mirror
style="height:100%"
name="system.beschreibung"
data-document-u-u-i-d="{{item.uuid}}"
value="{{system.beschreibung}}"
toggled="true"
>
{{{enrichedBeschreibung}}}
</prose-mirror>
{{else}}
{{{enrichedBeschreibung}}}
{{/if}}
</fieldset>
</section>
+46
View File
@@ -0,0 +1,46 @@
<header class="sheet-header">
<div class="container">
<div class="row align-items-end" style="height: 108px" >
<img
class="profile-img"
style="z-index:1"
src="{{item.img}}"
alt="{{item.name}}"
{{#if editable}}
data-action="editImage"
data-edit="img"
{{/if}}
data-tooltip="{{item.name}}"
height="100" width="100"
>
<div class="col-12">
<input class="text" type="text" style="color: var(--M6-text-brown); font-weight: bold; font-size:24px; background-color: var(--Midgard6-background-grey)" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{item.name}}" />
</div>
<div class="col-6">
</div>
<div class="col-6">
</div>
<div class="col-6">
<input class="right" type="text" placeholder="{{localize "Midgard6.Hintergrund.gruppe"}}" name="system.gruppe" value="{{system.gruppe}}" />
</div>
<div class="col-6">
<select
class="text right"
style="text-align: right"
name="system.linkId"
value="{{system.linkId}}"
id="linkId"
placeholder="{{system.linkId}}"
>
<option {{#unless system.linkId}}selected{{/unless}}value=""></option>
{{#each schicksalsgaben as |schicksalsgabe|}}
<option {{#ifeq schicksalsgabe.id ../system.linkId}}selected{{/ifeq}} value="{{schicksalsgabe.id}}">
{{schicksalsgabe.name}}
</option>
{{/each}}
</select>
</div>
</div>
</div>
</header>
+25
View File
@@ -0,0 +1,25 @@
{{! Beschreibung Allgemein Tab }}
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
style="overflow: hidden"
>
{{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }}
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Description"}}</legend>
{{#if editable}}
<prose-mirror
style="height:100%"
name="system.beschreibung"
data-document-u-u-i-d="{{item.uuid}}"
value="{{system.beschreibung}}"
toggled="true"
>
{{{enrichedBeschreibung}}}
</prose-mirror>
{{else}}
{{{enrichedBeschreibung}}}
{{/if}}
</fieldset>
</section>
+35
View File
@@ -0,0 +1,35 @@
<header class="sheet-header">
<div class="container">
<div class="row align-items-end" style="height: 108px" >
<img
class="profile-img"
style="z-index:1"
src="{{item.img}}"
alt="{{item.name}}"
{{#if editable}}
data-action="editImage"
data-edit="img"
{{/if}}
data-tooltip="{{item.name}}"
height="100" width="100"
>
<div class="col-12">
<input class="text" type="text" style="color: var(--M6-text-brown); font-weight: bold; font-size:24px; background-color: var(--Midgard6-background-grey)" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{item.name}}" />
</div>
<div class="col-6">
</div>
<div class="col-6">
<input class="custom-input right text" type="number" placeholder="{{localize "Midgard6.Gegenstand.anzahl"}}" name="system.anzahl" value="{{item.system.anzahl}}" />
<i class="fa-solid fa-sack-dollar input-icon left"></i>
</div>
<div class="col-6">
<input class="custom-input left text" type="number" placeholder="{{localize "Midgard6.Gegenstand.wert"}}" name="system.wert" value="{{item.system.wert}}" />
<i class="fa-solid fa-sack-dollar input-icon left"></i>
</div>
<div class="col-6">
<input class="custom-input right text" type="number" placeholder="{{localize "Midgard6.Gegenstand.gewicht"}}" name="system.gewicht" value="{{item.system.gewicht}}" />
<i class="fa-solid fa-weight-hanging input-icon right"></i>
</div>
</div>
</div>
</header>
+46
View File
@@ -0,0 +1,46 @@
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
style="overflow: hidden"
>
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Eigenschaften"}}</legend>
<div class="container">
<div class="row">
<div class="col-6">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.rüstwert"}}</p>
<input
type="text"
style=" max-width:10rem"
name="system.rüstwert"
id="rollDisplay"
placeholder="0"
value="{{system.rüstwert}}"
/>
</div>
</div>
<div class="col-6">
<div class="d-flex">
<p>{{localize "Midgard6.Item.helm"}}</p>
<a class="helmet" data-action="cycleHelmet" data-item-id="{{item._id}}" style="margin-left: 4px; {{#if item.system.zusätzlich}}background-color: var(--M6-text-brown){{/if}}"></a>
</div>
</div>
<div class="col-12">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.einschränkung"}}</p>
<input
style="margin-left: 8px;"
type="text"
data-action="splitIntoArray"
id="system.merkmale"
list="merkmalOptions"
value="{{splitArray system.merkmale}}"
/>
</div>
</div>
</div>
</div>
</fieldset>
</section>
+72
View File
@@ -0,0 +1,72 @@
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
style="overflow: hidden"
>
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Eigenschaften"}}</legend>
<div class="container">
<div class="row">
<div class="col-6">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.schaden"}}</p>
<input
type="text"
style=" max-width:10rem"
name="system.schaden"
id="rollDisplay"
placeholder="1d6"
value="{{system.schaden}}"
/>
</div>
</div>
<div class="col-6"></div>
<div class="col-6">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.fertigkeit"}}</p>
<select
type="text"
style="margin-left: 8px; max-width:10rem"
name="system.fertigkeit"
id="fertigkeit"
placeholder="Nahkampf"
/>
<option {{#ifeq system.fertigkeit "system.skills.kampf.fernkampf"}}selected{{/ifeq}} value="system.skills.kampf.fernkampf">{{localize
"Midgard6.Skills.fernkampf"
}}</option>
<option {{#ifeq system.fertigkeit "system.skills.kampf.nahkampf"}}selected{{/ifeq}} value="system.skills.kampf.nahkampf">{{localize
"Midgard6.Skills.nahkampf"
}}</option>
</select>
</div>
</div>
<div class="col-6">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.spezialisierung"}}</p>
<select
type="text"
style="margin-left: 8px; max-width:10rem"
name="system.spezialisierung"
id="system.spezialisierung"
placeholder=""
/>
<option {{#ifeq system.spezialisierung ""}}selected{{/ifeq}} value=""></option>
{{#each bonuses as |bonus|}}
<option {{#ifeq bonus.name ../system.spezialisierung}}selected{{/ifeq}} value="{{bonus.name}}">
{{bonus.name}}
</option>
{{/each}}
</select>
</div>
</div>
<div class="col-12">
<div class="d-flex justify-content-between">
<p>{{localize "Midgard6.Item.waffenmerkmale"}}</p>
<input style="margin-left: 8px;" type="text" data-action="splitIntoArray" id="merkmale" name="system.merkmale" list="merkmalOptions" value="{{splitArray system.merkmale}}">
</div>
</div>
</div>
</div>
</fieldset>
</section>
+59
View File
@@ -0,0 +1,59 @@
{{! Effects Tab }}
<section class="tab effects flexcol scrollable {{tab.cssClass}}" data-group="primary" data-tab="effects">
<ul class="effects-list">
{{#each effects as |section sid|}}
<li class="effects-header flexrow draggable" data-effect-type="{{section.type}}">
<div class="effect-label flexrow">
{{localize section.label}}
</div>
<div class="effect-source">
{{localize "EFFECT.FIELDS.origin.label"}}
</div>
<div class="effect-duration">{{localize "EFFECT.TABS.duration"}}</div>
<div class="document-controls flexrow">
<a class="effect-controls"
data-action="createDoc" data-document-class="ActiveEffect"
{{!-- <!-- eslint-disable-next-line @html-eslint/no-duplicate-attrs --> --}}
{{#if (eq section.type "inactive" )}} data-disabled="true"
{{else if (eq section.type "temporary" )}} data-duration.rounds="1" {{/if}}
data-origin="{{@root.document.uuid}}"
title="{{localize 'DOCUMENT.Create' type=(localize 'DOCUMENT.ActiveEffect')}}"
data-img="icons/svg/aura.svg"
>
<i class="fas fa-plus"></i>
{{localize "DOCUMENT.New" type=(localize "UTS.Effect.Label")}}
</a>
</div>
</li>
<ul class="effect-list">
{{#each section.effects as |effect|}}
<li class="effect flexrow draggable" data-effect-id="{{effect.id}}" data-parent-id="{{effect.parent.id}}"
data-document-class="ActiveEffect">
<div class="effect-label flexrow">
<img class="effect-image" src="{{effect.img}}" alt="{{effect.name}}" height="24" width="24">
<div class="effect-name">{{effect.name}}</div>
</div>
<div class="effect-source">{{effect.sourceName}}</div>
<div class="effect-duration">{{effect.duration.label}}</div>
<div class="document-controls flexrow">
{{#if @root.editable}}
<a class="effect-control" data-action="toggleEffect" title="{{localize 'UTS.Effect.Toggle'}}">
<i class="fas {{#if effect.disabled}}fa-check{{else}}fa-times{{/if}}"></i>
</a>
{{/if}}
<a class="effect-control" data-action="viewDoc" title="{{localize 'DOCUMENT.Update' type=(localize 'DOCUMENT.ActiveEffect')}}">
<i class="fas fa-edit"></i>
</a>
{{#if @root.editable}}
<a class="effect-control" data-action="deleteDoc" title="{{localize 'DOCUMENT.Delete' type=(localize 'DOCUMENT.ActiveEffect')}}">
<i class="fas fa-trash"></i>
</a>
{{/if}}
</div>
</li>
{{/each}}
</ul>
{{/each}}
</ul>
</section>
+42
View File
@@ -0,0 +1,42 @@
<nav class="tabs" data-application-part="navigation" style="">
{{#each tabs}}
<a
class="sheet-stack {{cssClass}}"
data-tab="{{id}}"
data-group="primary"
data-action="tab"
data-tooltip="{{localize label}}"
>
<div class="container">
<div class="background"></div>
<div class="border"></div>
<span class="value">
<i class="fa-solid {{icon}}"></i>
</span>
</div>
</a>
{{/each}}
{{#isdefined system.locked}}
{{#if @root.editable}}
<a
class="sheet-stack {{cssClass}}"
data-tab="lock"
data-group="primary"
data-action="cycleLock"
data-tooltip="{{localize 'Midgard6.Sheets.Tabs.sperre'}}"
>
<div class="container">
<div class="background"></div>
<div class="border"></div>
<span class="value">
{{#if system.locked}}
<i class="fa fa-lock"></i>
{{else}}
<i class="fa fa-lock-open"></i>
{{/if}}
</span>
</div>
</a>
{{/if}}
{{/isdefined}}
</nav>
+26
View File
@@ -0,0 +1,26 @@
{{! Beschreibung Allgemein Tab }}
<section
class="standard-form tab {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
style="overflow: hidden"
>
{{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }}
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Description"}}</legend>
{{#if editable}}
<prose-mirror
style="height:100%"
name="system.beschreibung"
data-document-u-u-i-d="{{actor.uuid}}"
value="{{system.beschreibung}}"
collaborate="true"
toggled="true"
>
{{{enrichedBeschreibung}}}
</prose-mirror>
{{else}}
{{{enrichedBeschreibung}}}
{{/if}}
</fieldset>
</section>
+31
View File
@@ -0,0 +1,31 @@
<section
class="standard-form tab scrollable {{tab.cssClass}}"
data-tab="{{tab.id}}"
data-group="{{tab.group}}"
>
<fieldset style="height:100%">
<legend>{{localize "Midgard6.Item.Eigenschaften"}}</legend>
<div class="container">
<div class="row">
{{#each zauberFields.eigenschaften.fields}}
{{#unlesseq field.name "ursprung"}}
{{#unlesseq field.name "stufe"}}
<div class="col-6">
<div class="d-flex justify-content-between">
<p>{{localizeConcat "Midgard6.Zauber." field.name}}</p>
<input
type="text"
style="margin-bottom: 4px; max-width:10rem"
name="{{field.fieldPath}}"
placeholder="{{localizeConcat 'Midgard6.Zauber.' field.name}}"
value="{{value}}"
/>
</div>
</div>
{{/unlesseq}}
{{/unlesseq}}
{{/each}}
</div>
</div>
</fieldset>
</section>
+45
View File
@@ -0,0 +1,45 @@
<header class="sheet-header">
<div class="container">
<div class="row align-items-end" style="height: 108px" >
<div class="col-12">
<input class="text" type="text" style="color: var(--M6-text-brown); font-weight: bold; font-size:24px; background-color: var(--Midgard6-background-grey)" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{item.name}}" />
</div>
<div class="col-6" style="height:32px">
</div>
<div class="col-6">
</div>
<div class="col-6">
<input class="custom-input text" type="text" placeholder="{{localize "Midgard6.Zauber.stufe"}}" name="system.eigenschaften.stufe" value="{{item.system.eigenschaften.stufe}}" />
</div>
<div class="col-6">
<select
class="text right"
style="text-align: right"
name="system.eigenschaften.ursprung"
id="ursprung"
placeholder="Kleiner Zauber/ Zaubersalz"
/>
{{#each bonuses as |bonus|}}
<option {{#ifeq bonus.name ../system.eigenschaften.ursprung}}selected{{/ifeq}} value="{{bonus.name}}">
{{bonus.name}}
</option>
{{/each}}
<option {{#ifeq system.eigenschaften.ursprung "Kleiner Zauber"}}selected{{/ifeq}} value="Kleiner Zauber">Kleiner Zauber</option>
<option {{#ifeq system.eigenschaften.ursprung "Zaubersalz"}}selected{{/ifeq}} value="Zaubersalz">Zaubersalz</option>
</select>
</div>
<img
class="profile-img"
style="z-index:1"
src="{{item.img}}"
alt="{{item.name}}"
{{#if editable}}
data-action="editImage"
data-edit="img"
{{/if}}
data-tooltip="{{item.name}}"
height="100" width="100"
>
</div>
</div>
</header>
-17
View File
@@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM"],
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["fvtt-types"],
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"isolatedModules": true
},
"include": ["src"]
}
+1 -1
View File
@@ -15,7 +15,7 @@ export default defineConfig({
outDir: "dist", outDir: "dist",
emptyOutDir: true, emptyOutDir: true,
lib: { lib: {
entry: "src/system.ts", entry: "src/system.mjs",
formats: ["es"], formats: ["es"],
fileName: () => "system.mjs" fileName: () => "system.mjs"
}, },