Compare commits
12
Commits
914fe01a2c
..
v0.9.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1723a4dd6b | ||
|
|
d17cd3c9b6 | ||
|
|
113315f68f | ||
|
|
3406f2134c | ||
|
|
e8caa591c4 | ||
|
|
3448ce5a4c | ||
|
|
70bc6873d7 | ||
|
|
a4f8718bcd | ||
|
|
64b98dd379 | ||
|
|
7f9eda1c35 | ||
|
|
bde7ea7e2e | ||
|
|
e27c2a220f |
No files matched your search
+8
-1
@@ -3,5 +3,12 @@
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "none"
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.hbs",
|
||||
"options": {
|
||||
"parser": "glimmer"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8,20 +8,5 @@ export default tseslint.config(
|
||||
{ ignores: ["dist/**", "node_modules/**"] },
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: ["src/**/*.{ts,tsx}"],
|
||||
plugins: { react },
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser }
|
||||
},
|
||||
rules: {
|
||||
...react.configs.recommended.rules,
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/prop-types": "off"
|
||||
},
|
||||
settings: {
|
||||
react: { version: "18.3" }
|
||||
}
|
||||
},
|
||||
prettier
|
||||
);
|
||||
@@ -7,6 +7,7 @@
|
||||
"Fertigkeit": "Fertigkeit",
|
||||
"Stufe": "Stufe",
|
||||
"Schicksalsmünzen": "Schicksalsmünzen",
|
||||
"Traglast": "Traglast",
|
||||
"Grad": {
|
||||
"grad": "Grad",
|
||||
"frei": "frei",
|
||||
@@ -98,6 +99,7 @@
|
||||
"effects": "Effekte",
|
||||
"zauber": "Zauber",
|
||||
"biographie": "Biographie",
|
||||
"beschreibung": "Beschreibung",
|
||||
"hintergrund": "Hintergrund",
|
||||
"sperre": "Sperre"
|
||||
},
|
||||
@@ -170,7 +172,14 @@
|
||||
"beschreibungChatActive": {
|
||||
"name": "Chat-Beschreibungen automatisch ausklappen",
|
||||
"hint": "Legt fest, ob Beschreibungen von Zaubern und Co. im Chat eingeklappt angezeigt werden oder vollständig."
|
||||
},
|
||||
"maxSpezialisierung": {
|
||||
"name": "Maximale Anzahl an Spezialisierungen pro Skill",
|
||||
"hint": "Legt die Maximale Anzahl der möglichen Spezialisierungen für einen Skill fest die man besitzen kann."
|
||||
}
|
||||
},
|
||||
"Warnings": {
|
||||
"maxSpezReached": "Die Maximale Anzahl erlaubter Spezialisierungen für einen Skill sind erreicht"
|
||||
}
|
||||
},
|
||||
"TYPES": {
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ const filesToInclude = [
|
||||
"system.json",
|
||||
"templates",
|
||||
"dist", // Kopiert den gesamten Inhalt deines echten Vite-Build-Ordners mit in die Zip!
|
||||
"lang"
|
||||
"lang",
|
||||
"assets"
|
||||
];
|
||||
|
||||
for (const file of filesToInclude) {
|
||||
|
||||
@@ -2,14 +2,13 @@ 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",
|
||||
scope: "client",
|
||||
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"),
|
||||
@@ -18,4 +17,71 @@ export const loadSettings = async function () {
|
||||
default: false,
|
||||
type: Boolean
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "maxSpezialisierung", {
|
||||
name: game.i18n.localize("Midgard6.Settings.maxSpezialisierung.name"),
|
||||
hint: game.i18n.localize("Midgard6.Settings.maxSpezialisierung.hint"),
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: 3,
|
||||
type: Number
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorSuccessBg", {
|
||||
name: "Erfolg: Hintergrundfarbe",
|
||||
hint: "Farbe für kritische Erfolge.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#5db68b",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorFailBg", {
|
||||
name: "Fehlschlag: Hintergrundfarbe",
|
||||
hint: "Farbe für kritische Fehlschläge.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#e3e4e5",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorCritSuccessBg", {
|
||||
name: "Kritischer Erffolg: Hintergrundfarbe",
|
||||
hint: "Farbe für überdurchschnittliche Würfe.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#9de0f0",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorCritFailureBg", {
|
||||
name: "Kritischer Erffolg: Hintergrundfarbe",
|
||||
hint: "Farbe für überdurchschnittliche Würfe.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#ea7699",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
};
|
||||
|
||||
function updateAllCssVariables() {
|
||||
const root = document.documentElement;
|
||||
|
||||
const successColor = game.settings.get("midgard6-lvd", "colorSuccessBg");
|
||||
const failColor = game.settings.get("midgard6-lvd", "colorFailBg");
|
||||
const critSuccessColor = game.settings.get("midgard6-lvd", "colorCritSuccessBg");
|
||||
const critFailColor = game.settings.get("midgard6-lvd", "colorCritFailureBg");
|
||||
|
||||
root.style.setProperty("--M6-success-color", successColor);
|
||||
root.style.setProperty("--M6-failure-color", failColor);
|
||||
root.style.setProperty("--M6-crit-success-color", critSuccessColor);
|
||||
root.style.setProperty("--M6-crit-failure-color", critFailColor);
|
||||
}
|
||||
|
||||
Hooks.once("ready", () => {
|
||||
updateAllCssVariables();
|
||||
});
|
||||
@@ -28,11 +28,11 @@ export class M6ArmorSheet extends M6ItemSheet {
|
||||
{
|
||||
id: "beschreibung",
|
||||
icon: "fa-feather-pointed"
|
||||
},
|
||||
{
|
||||
id: "effects",
|
||||
icon: "fa-bolt"
|
||||
}
|
||||
// {
|
||||
// id: "effects",
|
||||
// icon: "fa-bolt"
|
||||
// }
|
||||
],
|
||||
initial: "eigenschaften",
|
||||
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||
@@ -54,11 +54,11 @@ export class M6ArmorSheet extends M6ItemSheet {
|
||||
beschreibung: {
|
||||
template: systemPath("templates/item/description.hbs"),
|
||||
scrollable: [""]
|
||||
},
|
||||
effects: {
|
||||
template: systemPath("templates/shared/effects.hbs"),
|
||||
scrollable: [""]
|
||||
}
|
||||
// effects: {
|
||||
// template: systemPath("templates/shared/effects.hbs"),
|
||||
// scrollable: [""]
|
||||
// }
|
||||
};
|
||||
|
||||
static #cycleEquip() {
|
||||
|
||||
@@ -66,11 +66,11 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
{
|
||||
id: "biographie",
|
||||
icon: "fa-feather-pointed"
|
||||
},
|
||||
{
|
||||
id: "effects",
|
||||
icon: "fa-bolt"
|
||||
}
|
||||
// {
|
||||
// id: "effects",
|
||||
// icon: "fa-bolt"
|
||||
// }
|
||||
],
|
||||
initial: "eigenschaften",
|
||||
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||
@@ -106,11 +106,11 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
biographie: {
|
||||
template: systemPath("templates/actor/biographie.hbs"),
|
||||
scrollable: [""]
|
||||
},
|
||||
effects: {
|
||||
template: systemPath("templates/shared/effects.hbs"),
|
||||
scrollable: [""]
|
||||
}
|
||||
// effects: {
|
||||
// template: systemPath("templates/shared/effects.hbs"),
|
||||
// scrollable: [""]
|
||||
// }
|
||||
};
|
||||
|
||||
_attachPartListeners(partId, html, bubble) {
|
||||
@@ -123,11 +123,14 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
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");
|
||||
function (e) {
|
||||
e = window.event || e;
|
||||
if (this === e.target) {
|
||||
node.classList.toggle("active");
|
||||
var content = node.nextElementSibling;
|
||||
content.classList.toggle("active");
|
||||
node.getElementsByTagName("i")[0].classList.toggle("fa-compress");
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
@@ -163,7 +166,6 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
flags: this.actor.flags,
|
||||
config: CONFIG
|
||||
});
|
||||
console.warn(context);
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -475,7 +477,8 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
if (["action", "documentClass"].includes(dataKey)) continue;
|
||||
foundry.utils.setProperty(docData, dataKey, value);
|
||||
}
|
||||
docCls.create(docData, { parent: this.actor });
|
||||
const doc = await docCls.create(docData, { parent: this.actor });
|
||||
doc.sheet.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
@@ -302,32 +302,44 @@ async function rollDialog(rollDialogRequest) {
|
||||
const dialogHTML = dialog.element;
|
||||
|
||||
const display = dialogHTML.querySelector("#rollDisplay");
|
||||
|
||||
let mainRoll = `1d20 + ${skillValue}`;
|
||||
let spezText = "";
|
||||
// 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)`;
|
||||
mainRoll = `2d20kh + ${skillValue} (Vorteil)`;
|
||||
break;
|
||||
case -1:
|
||||
display.placeholder = `2d20kl + ${skillValue} (Nachteil)`;
|
||||
mainRoll = `2d20kl + ${skillValue} (Nachteil)`;
|
||||
break;
|
||||
default:
|
||||
display.placeholder = `1d20 + ${skillValue}`;
|
||||
mainRoll = `1d20 + ${skillValue}`;
|
||||
break;
|
||||
}
|
||||
display.placeholder = mainRoll + spezText;
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('input[name="spezialisierung-segment"]').forEach((radio) => {
|
||||
radio.addEventListener("change", (e) => {
|
||||
spezLevel = parseInt(e.target.value);
|
||||
spezName = e.target.dataset.name;
|
||||
radio.addEventListener("click", (e) => {
|
||||
if (spezName !== e.target.dataset.name) {
|
||||
spezLevel = parseInt(e.target.value);
|
||||
spezName = e.target.dataset.name;
|
||||
spezText = ` + ${spezLevel + 1}`;
|
||||
} else {
|
||||
spezLevel = null;
|
||||
spezName = null;
|
||||
e.target.checked = false;
|
||||
spezText = "";
|
||||
}
|
||||
display.placeholder = mainRoll + spezText;
|
||||
});
|
||||
if (radio.dataset.name === preSelectedSpez) {
|
||||
radio.click();
|
||||
display.placeholder = mainRoll + spezText;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -6,7 +6,12 @@ export async function addSpezialisierung(event, target) {
|
||||
const path = dataset.path.replace(".value", "");
|
||||
const name = dataset.name;
|
||||
const skill = foundry.utils.getProperty(this.actor, path);
|
||||
const maxSpez = game.settings.get("midgard6-lvd", "maxSpezialisierung");
|
||||
|
||||
if (skill.bonuses.length >= maxSpez) {
|
||||
ui.notifications.warn(game.i18n.localize("Midgard6.Warnings.maxSpezReached"));
|
||||
return;
|
||||
}
|
||||
let level = 1;
|
||||
|
||||
const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs");
|
||||
|
||||
@@ -22,11 +22,11 @@ export class M6HintergrundSheet extends M6ItemSheet {
|
||||
{
|
||||
id: "beschreibung",
|
||||
icon: "fa-feather-pointed"
|
||||
},
|
||||
{
|
||||
id: "effects",
|
||||
icon: "fa-bolt"
|
||||
}
|
||||
// {
|
||||
// id: "effects",
|
||||
// icon: "fa-bolt"
|
||||
// }
|
||||
],
|
||||
initial: "beschreibung",
|
||||
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||
@@ -44,11 +44,11 @@ export class M6HintergrundSheet extends M6ItemSheet {
|
||||
beschreibung: {
|
||||
template: systemPath("templates/hintergrund/description.hbs"),
|
||||
scrollable: [""]
|
||||
},
|
||||
effects: {
|
||||
template: systemPath("templates/shared/effects.hbs"),
|
||||
scrollable: [""]
|
||||
}
|
||||
// effects: {
|
||||
// template: systemPath("templates/shared/effects.hbs"),
|
||||
// scrollable: [""]
|
||||
// }
|
||||
};
|
||||
|
||||
_addSpecifics(context) {
|
||||
|
||||
@@ -38,11 +38,11 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
||||
{
|
||||
id: "beschreibung",
|
||||
icon: "fa-feather-pointed"
|
||||
},
|
||||
{
|
||||
id: "effects",
|
||||
icon: "fa-bolt"
|
||||
}
|
||||
// {
|
||||
// id: "effects",
|
||||
// icon: "fa-bolt"
|
||||
// }
|
||||
],
|
||||
initial: "beschreibung",
|
||||
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||
@@ -62,11 +62,11 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
||||
beschreibung: {
|
||||
template: systemPath("templates/item/description.hbs"),
|
||||
scrollable: [""]
|
||||
},
|
||||
effects: {
|
||||
template: systemPath("templates/shared/effects.hbs"),
|
||||
scrollable: [""]
|
||||
}
|
||||
// effects: {
|
||||
// template: systemPath("templates/shared/effects.hbs"),
|
||||
// scrollable: [""]
|
||||
// }
|
||||
};
|
||||
|
||||
_attachPartListeners(partId, html, bubble) {
|
||||
@@ -88,8 +88,9 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
||||
event.preventDefault();
|
||||
const currentInput = event.currentTarget;
|
||||
const value = currentInput.value;
|
||||
const location = currentInput.name || currentInput.id;
|
||||
console.log("Feld verlassen! Aktueller Wert:", value);
|
||||
this.item.update({ [`${currentInput.name}`]: value.split(/[\s,]+/) });
|
||||
this.item.update({ [`${location}`]: value.split(/[\s,]+/) });
|
||||
}
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
@@ -27,11 +27,11 @@ export class M6WeaponSheet extends M6ItemSheet {
|
||||
{
|
||||
id: "beschreibung",
|
||||
icon: "fa-feather-pointed"
|
||||
},
|
||||
{
|
||||
id: "effects",
|
||||
icon: "fa-bolt"
|
||||
}
|
||||
// {
|
||||
// id: "effects",
|
||||
// icon: "fa-bolt"
|
||||
// }
|
||||
],
|
||||
initial: "eigenschaften",
|
||||
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||
@@ -53,11 +53,11 @@ export class M6WeaponSheet extends M6ItemSheet {
|
||||
beschreibung: {
|
||||
template: systemPath("templates/item/description.hbs"),
|
||||
scrollable: [""]
|
||||
},
|
||||
effects: {
|
||||
template: systemPath("templates/shared/effects.hbs"),
|
||||
scrollable: [""]
|
||||
}
|
||||
// effects: {
|
||||
// template: systemPath("templates/shared/effects.hbs"),
|
||||
// scrollable: [""]
|
||||
// }
|
||||
};
|
||||
|
||||
async _addSpecifics(context) {
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
:root {
|
||||
--M6-crit-success-color: #9de0f0;
|
||||
--M6-success-color: #5db68b;
|
||||
--M6-failure-color: #e3e4e5;
|
||||
--M6-crit-failure-color: #ea7699;
|
||||
}
|
||||
|
||||
.chat-message {
|
||||
background: none;
|
||||
border-radius: 0;
|
||||
@@ -46,9 +53,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
@@ -93,4 +97,20 @@
|
||||
font-weight: 500;
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
.roll-crit-fail {
|
||||
background-color: var(--M6-crit-failure-color);
|
||||
}
|
||||
|
||||
.roll-crit-success {
|
||||
background-color: var(--M6-crit-success-color);
|
||||
}
|
||||
|
||||
.roll-success {
|
||||
background-color: var(--M6-success-color);
|
||||
}
|
||||
|
||||
.roll-failure {
|
||||
background-color: var(--M6-failure-color);
|
||||
}
|
||||
}
|
||||
+6
-16
@@ -59,22 +59,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Container für die gesamte Reihe */
|
||||
.segmented-button-row {
|
||||
display: inline-flex;
|
||||
overflow: hidden;
|
||||
overflow: visible;
|
||||
height: 32px;
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* Einzelnes Segment */
|
||||
.segmented-button {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Versteckt den echten Radio-Button, behält aber die Tastatur-Navigation */
|
||||
.segmented-button input[type="radio"] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
@@ -82,7 +82,6 @@
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* Inhalt des Segments (Layout & Abstände) */
|
||||
.segmented-button__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -96,19 +95,11 @@
|
||||
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;
|
||||
}
|
||||
background-color: var(--M6-background-brown);
|
||||
color: #1d192b;
|
||||
}
|
||||
|
||||
/* Hover-Effekt */
|
||||
.segmented-button:hover .segmented-button__content {
|
||||
background-color: rgba(73, 69, 79, 0.08);
|
||||
}
|
||||
@@ -116,7 +107,6 @@
|
||||
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;
|
||||
|
||||
+30
-14
@@ -18,37 +18,53 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999; /* Bleibt immer im Vordergrund */
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.tooltip-wrapper {
|
||||
position: relative;
|
||||
width: 90%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Der graue Hintergrund des Balkens */
|
||||
.progress-background {
|
||||
width: 90%; /* Breite des Balkens auf dem Bildschirm */
|
||||
max-width: 800px; /* Maximale Breite auf großen Bildschirmen */
|
||||
width: 100%;
|
||||
background-color: #e0e0e0;
|
||||
overflow: hidden; /* Schneidet den inneren Balken sauber ab */
|
||||
overflow: hidden;
|
||||
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;
|
||||
background-color: #808080;
|
||||
width: 100%;
|
||||
color: var(--M6-background-brown);
|
||||
}
|
||||
|
||||
progress::-moz-progress-bar {
|
||||
background: var(--M6-background-brown);
|
||||
}
|
||||
progress::-webkit-progress-value {
|
||||
background: var(--M6-background-brown);
|
||||
}
|
||||
progress {
|
||||
color: var(--M6-background-brown);
|
||||
|
||||
.tooltiptext {
|
||||
visibility: hidden;
|
||||
background-color: black;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
position: absolute;
|
||||
width: 130px;
|
||||
bottom: 120%;
|
||||
left: 50%;
|
||||
margin-left: -65px;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
.tooltip-wrapper:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
-8
@@ -17,28 +17,33 @@ 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";
|
||||
import { localizeHelper } from "./helpers/utils.mjs";
|
||||
|
||||
Hooks.once("init", () => {
|
||||
CONFIG.ChatMessage.documentClass = M6ChatMessage;
|
||||
CONFIG.ChatMessage.template = systemPath("templates/chat/message-default.hbs");
|
||||
|
||||
CONFIG.Actor.dataModels.character = CharacterData;
|
||||
CONFIG.Actor.dataModels = {
|
||||
character: CharacterData
|
||||
};
|
||||
CONFIG.Item.dataModels = {
|
||||
item: ItemData,
|
||||
geld: ItemData,
|
||||
weapon: WeaponData,
|
||||
armor: ArmorData,
|
||||
zauber: ZauberData,
|
||||
hintergrund: HintergrundData
|
||||
};
|
||||
CONFIG.Actor.trackableAttributes = {
|
||||
pc: {
|
||||
bar: ["resources.leben", "resources.ausdauer"],
|
||||
value: ["level"]
|
||||
value: ["schicksalsmünzen"]
|
||||
},
|
||||
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"],
|
||||
@@ -116,4 +121,27 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
const diceTotalElement = html.querySelector(".dice-total");
|
||||
if (!diceTotalElement) return;
|
||||
|
||||
if (!message.rolls || message.rolls.length === 0) return;
|
||||
|
||||
const mainRoll = message.rolls[0];
|
||||
const totalValue = mainRoll.total;
|
||||
|
||||
const firstDiceTerm = mainRoll.terms.find((t) => t instanceof foundry.dice.terms.DiceTerm);
|
||||
const activeResult = firstDiceTerm.results.find((x) => x.active).result;
|
||||
const maxPossible = firstDiceTerm.faces;
|
||||
diceTotalElement.classList.remove("roll-crit-fail", "roll-crit-success", "roll-high");
|
||||
|
||||
if (activeResult === 1) {
|
||||
diceTotalElement.classList.add("roll-crit-fail");
|
||||
} else if (activeResult === maxPossible || mainRoll.isCritical || totalValue >= 30) {
|
||||
diceTotalElement.classList.add("roll-crit-success");
|
||||
} else if (totalValue >= 20) {
|
||||
diceTotalElement.classList.add("roll-success");
|
||||
} else if (totalValue <= 20) {
|
||||
diceTotalElement.classList.add("roll-failure");
|
||||
}
|
||||
});
|
||||
@@ -81,6 +81,22 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{#with itemTypes.gunst}}
|
||||
<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="gunst"
|
||||
>
|
||||
<i class="fas fa-plus"></i>
|
||||
{{localize "DOCUMENT.Create" type=this.label}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{#each this.items as |gunst|}}
|
||||
<div
|
||||
class="collapsible"
|
||||
@@ -92,6 +108,13 @@
|
||||
<div>
|
||||
<i class="fas fa-expand"></i>
|
||||
{{#if @root.editable}}
|
||||
<a
|
||||
class="item-control item-edit"
|
||||
title="{{localize 'DOCUMENT.Update' type=gunst.name}}"
|
||||
data-action="viewDoc"
|
||||
>
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=gunst.name}}"
|
||||
@@ -112,6 +135,22 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{#with itemTypes.makel}}
|
||||
<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="makel"
|
||||
>
|
||||
<i class="fas fa-plus"></i>
|
||||
{{localize "DOCUMENT.Create" type=this.label}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{#each this.items as |makel|}}
|
||||
<div
|
||||
type="button"
|
||||
@@ -124,9 +163,16 @@
|
||||
<div>
|
||||
<i class="fas fa-expand"></i>
|
||||
{{#if @root.editable}}
|
||||
<a
|
||||
class="item-control item-edit"
|
||||
title="{{localize 'DOCUMENT.Update' type=makel.name}}"
|
||||
data-action="viewDoc"
|
||||
>
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=gunst.name}}"
|
||||
title="{{localize 'DOCUMENT.Delete' type=makel.name}}"
|
||||
style="z-index:9999"
|
||||
data-action="deleteDoc"
|
||||
>
|
||||
@@ -177,14 +223,15 @@
|
||||
>{{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-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=legende.name}}"
|
||||
@@ -240,6 +287,13 @@
|
||||
<div>
|
||||
<i class="fas fa-expand"></i>
|
||||
{{#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=schicksalsgabe.name}}"
|
||||
|
||||
@@ -226,6 +226,9 @@
|
||||
</div>
|
||||
</ul>
|
||||
<div class="sticky-progress-container">
|
||||
<div class="tooltip-wrapper">
|
||||
<span class="tooltiptext">{{localize "Midgard6.Traglast"}}: {{gewicht.gewicht}} / {{gewicht.traglast}}</span>
|
||||
|
||||
<div class="progress-background">
|
||||
<progress
|
||||
class="progress-bar"
|
||||
@@ -234,4 +237,5 @@
|
||||
></progress>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -29,7 +29,7 @@
|
||||
<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-1 fa-solid fa-book-open" {{#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}}
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if merkmale}}
|
||||
<div class="tags">
|
||||
{{#each merkmale as |merkmal|}}
|
||||
<div class="tag">{{merkmal}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="tags">
|
||||
{{#each merkmale as |merkmal|}}
|
||||
{{#if merkmal}}
|
||||
<div class="tag">{{merkmal}}</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{#if isRoll}}
|
||||
{{#each message.content as |roll|}}
|
||||
<fieldset>
|
||||
|
||||
@@ -3,25 +3,23 @@
|
||||
<legend>Modifikation</legend>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{{! <div class="d-flex align-items-center"> }}
|
||||
<div class="col-6">
|
||||
<div class="col-6" style="margin-bottom: 4px">
|
||||
<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="col-6" style="margin-bottom: 4px">
|
||||
<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>
|
||||
<i class="icon fa-solid fa-caret-down"></i>
|
||||
<i class="icon fa-solid fa-dice-d20"></i>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -29,7 +27,7 @@
|
||||
<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>
|
||||
<i class="icon fa-solid fa-dice-d20" ></i>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -37,55 +35,50 @@
|
||||
<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>
|
||||
<i class="icon fa-solid fa-dice-d20"></i>
|
||||
<i class="icon fa-solid fa-caret-up"></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">
|
||||
<div class="col-6" style="margin-bottom: 4px">
|
||||
{{#if damageRoll}}
|
||||
<input
|
||||
type="text"
|
||||
style="margin-left: 8px;"
|
||||
name="customRollDamage"
|
||||
id="rollDamageDisplay"
|
||||
placeholder="{{damageRoll}}"
|
||||
value="{{customDamageRoll}}"
|
||||
/>
|
||||
{{/if}}
|
||||
</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 class="col-6 d-flex" style="margin-bottom: 4px">
|
||||
<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 class="col-6" style="margin-bottom: 4px">
|
||||
<select name="rollMode" data-type="String">
|
||||
{{selectOptions rollModes selected=rollMode localize=true}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</section>
|
||||
@@ -24,21 +24,23 @@
|
||||
<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>
|
||||
{{#ifeq item.type "legende"}}
|
||||
<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="">Keine Schicksalsgabe</option>
|
||||
{{#each schicksalsgaben as |schicksalsgabe|}}
|
||||
<option {{#ifeq schicksalsgabe.id ../system.linkId}}selected{{/ifeq}} value="{{schicksalsgabe.id}}">
|
||||
{{schicksalsgabe.name}}
|
||||
</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
{{/ifeq}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</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>
|
||||
<i class="input-icon right" style="right: 26px; top: 45%">x</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}}" />
|
||||
@@ -28,7 +28,7 @@
|
||||
</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>
|
||||
<i class="fa-solid fa-weight-hanging input-icon right"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<legend>{{localize "Midgard6.Item.Eigenschaften"}}</legend>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="col-6" style="margin-bottom: 4px">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>{{localize "Midgard6.Item.rüstwert"}}</p>
|
||||
<input
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<legend>{{localize "Midgard6.Item.Eigenschaften"}}</legend>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="col-6" style="margin-bottom: 4px">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>{{localize "Midgard6.Item.schaden"}}</p>
|
||||
<input
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6"></div>
|
||||
<div class="col-6">
|
||||
<div class="col-6" style="margin-bottom: 4px">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>{{localize "Midgard6.Item.fertigkeit"}}</p>
|
||||
<select
|
||||
@@ -31,7 +31,7 @@
|
||||
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>
|
||||
@@ -50,8 +50,8 @@
|
||||
name="system.spezialisierung"
|
||||
id="system.spezialisierung"
|
||||
placeholder=""
|
||||
/>
|
||||
<option {{#ifeq system.spezialisierung ""}}selected{{/ifeq}} value=""></option>
|
||||
>
|
||||
<option {{#ifeq system.spezialisierung ""}}selected{{/ifeq}} value="">Keine Spezialisierung</option>
|
||||
{{#each bonuses as |bonus|}}
|
||||
<option {{#ifeq bonus.name ../system.spezialisierung}}selected{{/ifeq}} value="{{bonus.name}}">
|
||||
{{bonus.name}}
|
||||
@@ -63,7 +63,7 @@
|
||||
<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}}">
|
||||
<input style="margin-left: 8px;" type="text" data-action="splitIntoArray" id="system.merkmale" name="system.merkmale" value="{{splitArray system.merkmale}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user