Squashed commit of the following:

commit 2225a98e6b
Author: Byroks <byroks@gmail.com>
Date:   Sat Oct 17 16:14:40 2026 +0200

    A lot of stuff

commit f7627e3e46
Author: Byroks <byroks@gmail.com>
Date:   Fri Oct 16 22:04:36 2026 +0200

    not sure what happend

commit 0d21ad3031
Author: Byroks <byroks@gmail.com>
Date:   Fri Oct 16 18:10:38 2026 +0200

    mark active tab

commit 19da492843
Author: Byroks <byroks@gmail.com>
Date:   Fri Oct 16 18:05:58 2026 +0200

    shit is visible
This commit is contained in:
Byroks committed 2026-10-17 16:16:14 +02:00
1 parent 2fa131d2c5
commit ba31eea229
21 files changed
+3069 -377

No files matched your search

+23 -17
View File
@@ -32,23 +32,29 @@ function defineSchema() {
})
})
}),
resistenzen: new fields.SchemaField({
reflexe: new fields.NumberField({
required: true,
min: 0,
initial: 4
}),
willenskraft: new fields.NumberField({
required: true,
min: 0,
initial: 4
}),
zähigkeit: new fields.NumberField({
required: true,
min: 0,
initial: 4
})
}),
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(
{
+57 -33
View File
@@ -36,13 +36,16 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
primary: {
tabs: [
{
id: "properties"
id: "properties",
icon: "fa-feather-pointed"
},
{
id: "items"
id: "items",
icon: "fa-suitcase"
},
{
id: "effects"
id: "effects",
icon: "fa-bolt"
}
],
initial: "properties",
@@ -54,15 +57,12 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
/** @inheritdoc */
static PARTS = {
tabs: {
template: systemPath("templates/actor/tabs.hbs")
},
header: {
template: systemPath("templates/actor/header.hbs")
},
stats: {
template: systemPath("templates/actor/stats.hbs")
},
tabs: {
template: "templates/generic/tab-navigation.hbs"
},
properties: {
template: systemPath("templates/shared/properties.hbs"),
scrollable: [""]
@@ -112,16 +112,17 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
/** @inheritdoc */
async _preparePartContext(partId, context) {
switch (partId) {
case "stats":
context.fields = await this._getResources();
context.tab = context.tabs[partId];
break;
// case "stats":
// context.fields = await this._getResources();
// context.tab = context.tabs[partId];
// break;
case "effects":
context.effects = prepareActiveEffectCategories(this.actor.allApplicableEffects());
context.tab = context.tabs[partId];
break;
case "properties":
context.fields = await this._getSkills();
context.skills = await this._getSkills();
context.resistenzen = await this._getResistenzen();
context.tab = context.tabs[partId];
break;
case "items":
@@ -178,6 +179,27 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
return fieldSets;
}
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
});
}
console.warn(fieldset);
return fieldset;
}
async _getResources() {
const doc = this.actor;
const source = doc._source;
@@ -198,7 +220,6 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
console.warn(fieldSets);
return fieldSets;
}
@@ -343,10 +364,10 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
let die = "";
console.warn(dialogResult);
switch (dialogResult.vorteil) {
case "-1":
case -1:
die = "2d20kl";
break;
case "1":
case 1:
die = "2d20kh";
break;
default:
@@ -378,7 +399,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
// 1. Define the path to .hbs template
const templatePath = systemPath("templates/dialog/roll-dialog.hbs");
const templateData = {
classes: ["roll"],
classes: ["dialog"],
skill,
vorteil,
customRoll
@@ -400,22 +421,25 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
render: (_event, dialog) => {
const dialogHTML = dialog.element;
const slider = dialogHTML.querySelector("#vorteilSlider");
const display = dialogHTML.querySelector("#rollDisplay");
slider.addEventListener("input", (e) => {
const vorteilWert = parseInt(e.target.value);
switch (vorteilWert) {
case 1:
display.placeholder = `2d20kh + ${skill} (Vorteil)`;
break;
case -1:
display.placeholder = `2d20kl + ${skill} (Nachteil)`;
break;
default:
display.placeholder = `1d20 + ${skill}`;
break;
}
// Variable bei jeder Änderung aktualisieren
document.querySelectorAll('input[name="vorteil-segment"]').forEach((radio) => {
radio.addEventListener("change", (e) => {
vorteil = parseInt(e.target.value);
console.log(vorteil);
switch (vorteil) {
case 1:
display.placeholder = `2d20kh + ${skill} (Vorteil)`;
break;
case -1:
display.placeholder = `2d20kl + ${skill} (Nachteil)`;
break;
default:
display.placeholder = `1d20 + ${skill}`;
break;
}
});
});
},
buttons: [
@@ -433,7 +457,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
callback: (event, button, dialog) => {
const rollData = {
customRoll: button.form.elements.customRoll.value,
vorteil: button.form.elements.vorteil.value
vorteil
};
return rollData;
}
+522
View File
@@ -0,0 +1,522 @@
import { systemPath } from "../constants.mjs";
import { prepareActiveEffectCategories } from "../helpers/utils.mjs";
const { api, sheets } = foundry.applications;
/**
* Extend the basic ActorSheet with some very simple modifications.
*/
export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheetV2) {
/** @inheritdoc */
static DEFAULT_OPTIONS = {
classes: ["M6", "item"],
window: {
icon: "fa-solid fa-suitcase",
resizable: true
},
position: {
width: 800,
height: 400
},
form: {
submitOnChange: true
}
};
/* -------------------------------------------------- */
static TABS = {
primary: {
tabs: [
{
id: "properties",
icon: "fa-feather-pointed"
},
{
id: "items",
icon: "fa-suitcase"
},
{
id: "effects",
icon: "fa-bolt"
}
],
initial: "properties",
labelPrefix: "Midgard6.Sheets.Tabs"
}
};
/* -------------------------------------------------- */
/** @inheritdoc */
static PARTS = {
tabs: {
template: systemPath("templates/actor/tabs.hbs")
},
header: {
template: systemPath("templates/actor/header.hbs")
},
properties: {
template: systemPath("templates/shared/properties.hbs"),
scrollable: [""]
},
items: {
template: systemPath("templates/actor/items.hbs"),
scrollable: [""]
},
effects: {
template: systemPath("templates/shared/effects.hbs"),
scrollable: [""]
}
};
/* -------------------------------------------------- */
/** @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
});
return context;
}
/* -------------------------------------------------- */
/** @inheritdoc */
async _preparePartContext(partId, context) {
switch (partId) {
// case "stats":
// context.fields = await this._getResources();
// context.tab = context.tabs[partId];
// break;
case "effects":
context.effects = prepareActiveEffectCategories(this.actor.allApplicableEffects());
context.tab = context.tabs[partId];
break;
case "properties":
context.skills = await this._getSkills();
context.resistenzen = await this._getResistenzen();
context.tab = context.tabs[partId];
break;
case "items":
context.itemTypes = this._getItems();
context.tab = context.tabs[partId];
break;
}
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.#addSystemFields(fieldset, field.fields, source, path);
fieldSets.push(fieldset);
} else {
fieldSets.push({ outer: { field, value: foundry.utils.getProperty(source, path) } });
}
}
return fieldSets;
}
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
});
}
console.warn(fieldset);
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;
}
/* -------------------------------------------------- */
/**
* 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.name
});
}
}
}
/* -------------------------------------------------- */
/**
* 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);
}
// Only show Base if it's actually being used
if (types.base.items.length === 0) delete types.base;
return types;
}
/* -------------------------------------------------- */
/**
* 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 */
/* -------------------------------------------------- */
/**
* 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 });
}
static async #rollSkill(event, target) {
const dataset = target.dataset;
const actor = this.actor;
const dialogResult = await this.rollDialog({
dataset,
actor
});
if (dialogResult.noRoll) {
return;
}
// Construct the Roll instance
const skillValue = dataset.value;
let die = "";
console.warn(dialogResult);
switch (dialogResult.vorteil) {
case "-1":
die = "2d20kl";
break;
case "1":
die = "2d20kh";
break;
default:
die = "1d20";
break;
}
let roll = new Roll("@die + @skill", { die: die, skill: skillValue }, { flavor: dataset.name });
// The parsed terms of the roll formula
console.log("Roll:", roll); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm]
// Execute the roll
await roll.evaluate();
roll.toMessage();
roll.toAnchor();
// let message = new Message(roll);
// console.warn(message);
}
async rollDialog(rollDialogRequest) {
// Assamble dialog depending on roll type
let label = rollDialogRequest.dataset.name;
let skill = rollDialogRequest.dataset.value;
let vorteil = 0;
let customRoll = "";
// 1. Define the path to .hbs template
const templatePath = systemPath("templates/dialog/roll-dialog.hbs");
const templateData = {
classes: ["roll"],
skill,
vorteil,
customRoll
};
// 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
},
content,
actions: {},
render: (_event, dialog) => {
const dialogHTML = dialog.element;
const slider = dialogHTML.querySelector("#vorteilSlider");
const display = dialogHTML.querySelector("#rollDisplay");
slider.addEventListener("input", (e) => {
const vorteilWert = parseInt(e.target.value);
switch (vorteilWert) {
case 1:
display.placeholder = `2d20kh + ${skill} (Vorteil)`;
break;
case -1:
display.placeholder = `2d20kl + ${skill} (Nachteil)`;
break;
default:
display.placeholder = `1d20 + ${skill}`;
break;
}
});
},
buttons: [
{
action: "abort",
label: "Midgard6.Dialog.abbrechen",
callback: (event, button, dialog) => {
return { noRoll: true };
}
},
{
action: "roll",
label: "Midgard6.Dialog.würfeln",
default: true,
callback: (event, button, dialog) => {
const rollData = {
customRoll: button.form.elements.customRoll.value,
vorteil: button.form.elements.vorteil.value
};
return rollData;
}
}
]
// submit: (rollData) => {
// if (noRoll) {
// resolve({ noRoll: true });
// } else {
// resolve(rollData);
// }
// }
});
}
/* -------------------------------------------------- */
/* 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("li[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 inpM6 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;
}
}
}
+153
View File
@@ -0,0 +1,153 @@
@import url("flex/bootstrap-grid.css");
@import url("./header.scss");
@import url("./tabs.scss");
@import url("./resistenzen.scss");
@import url("./dialog.scss");
:root {
--M6-background-grey: #d3d7d7;
--M6-background-brown: #eedecd;
--M6-background-white: #fdfeff;
--M6-text-grey: #595d5f;
--M6-text-brown: #be7742;
}
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);
}
.application {
overflow: visible;
}
i {
font-size: 18px;
text-shadow: 0 0 10px var(--M6-background-white);
}
i:hover {
text-shadow: 0 0 10px var(--M6-background-brown);
}
.application.sheet.M6 {
background-color: var(--M6-background-white);
color: var(--M6-text-grey);
input {
background-color: var(--M6-background-white);
color: black;
border-radius: 0;
&.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 {
&.right {
text-align: end;
}
}
}
input:focus {
outline: none;
}
p {
&.center {
text-align: center;
}
&.right {
text-align: end;
}
}
.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[data-tab="items"] {
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;
}
}
}
+99
View File
@@ -0,0 +1,99 @@
.application.dialog {
background-color: var(--M6-background-white);
color: var(--M6-text-grey);
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;
}
}
+1976
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 */
+21
View File
@@ -0,0 +1,21 @@
.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);
}
}
+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.actor.character {
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;
}
}
}
}
+6 -4
View File
@@ -1,7 +1,9 @@
import { CharacterData } from "./data/character-data.mjs";
import { ItemData } from "./data/item-data.mjs";
import { M6ActorSheet } from "./sheets/character-sheet.mjs";
import { M6ItemSheet } from "./sheets/item-sheet.mjs";
import { loadHelpers } from "./helpers/handlebar-helpers.mjs";
import "./styles/M6.scss";
Hooks.once("init", () => {
CONFIG.Actor.dataModels.character = CharacterData;
@@ -21,10 +23,10 @@ Hooks.once("init", () => {
types: ["character"],
makeDefault: true
});
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ItemSheet, {
types: ["item"],
makeDefault: true
});
loadHelpers();
// foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", ItemSheet, {
// types: ["item"],
// makeDefault: true
// });
});
+26 -21
View File
@@ -1,23 +1,28 @@
<header class="sheet-header flexrow">
<div class="flexcolumn">
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.name"}}" name="name" value="{{actor.name}}" />
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.spezies"}}" name="system.biography.spezies" value="{{system.biography.spezies}}" />
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.kultur"}}" name="system.biography.kultur" value="{{system.biography.kultur}}" />
</div>
<img
class="profile-img"
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="flexcolumn">
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biography.abenteuertyp"}}" name="system.biography.abenteuertyp" value="{{system.biography.abenteuertyp}}" />
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biography.glaube"}}" name="system.biography.glaube" value="{{system.biography.glaube}}" />
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biography.mondgestalt"}}" name="system.biography.mondgestalt" value="{{system.biography.mondgestalt}}" />
<header class="sheet-header">
<div class="container">
<div class="row">
<div class="col-6">
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.name"}}" name="name" value="{{actor.name}}" />
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.spezies"}}" name="system.biography.spezies" value="{{system.biography.spezies}}" />
<input class="text" type="text" placeholder="{{localize "Midgard6.Biography.kultur"}}" name="system.biography.kultur" value="{{system.biography.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 class="text right" type="text" placeholder="{{localize "Midgard6.Biography.abenteuertyp"}}" name="system.biography.abenteuertyp" value="{{system.biography.abenteuertyp}}" />
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biography.glaube"}}" name="system.biography.glaube" value="{{system.biography.glaube}}" />
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biography.mondgestalt"}}" name="system.biography.mondgestalt" value="{{system.biography.mondgestalt}}" />
</div>
</div>
</div>
</header>
-67
View File
@@ -1,67 +0,0 @@
<section class="standard-form" style="margin-bottom: 1rem">
<div class="flexrow">
<fieldset>
<legend>LP</legend>
<div class="flexrow">
<input
class="attribut"
type="number"
name="system.resources.leben.value"
value="{{system.resources.leben.value}}"
/>
<p class="center">/</p>
<input
class="attribut"
type="number"
name="system.resources.leben.max"
value="{{system.resources.leben.max}}"
/>
</div>
</fieldset>
<fieldset>
<legend>AP</legend>
<div class="flexrow">
<input
class="attribut"
type="number"
name="system.resources.ausdauer.value"
value="{{system.resources.leben.value}}"
/>
<p class="center">/</p>
<input
class="attribut"
type="number"
name="system.resources.ausdauer.max"
value="{{system.resources.leben.max}}"
/>
</div>
</fieldset>
<fieldset>
<legend>{{localize "Midgard6.Resistenzen.reflexe"}}</legend>
<input
class="attribut"
type="number"
name="system.resistenzen.reflexe"
value="{{system.resistenzen.reflexe}}"
/>
</fieldset>
<fieldset>
<legend>{{localize "Midgard6.Resistenzen.willenskraft"}}</legend>
<input
class="attribut"
type="number"
name="system.resistenzen.willenskraft"
value="{{system.resistenzen.reflexe}}"
/>
</fieldset>
<fieldset>
<legend>{{localize "Midgard6.Resistenzen.zähigkeit"}}</legend>
<input
class="attribut"
type="number"
name="system.resistenzen.zähigkeit"
value="{{system.resistenzen.zähigkeit}}"
/>
</fieldset>
</div>
</section>
+19
View File
@@ -0,0 +1,19 @@
<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}}
</nav>
+39 -25
View File
@@ -1,33 +1,47 @@
<section class="standard-form" style="margin-bottom: 1rem">
<fieldset>
<legend>Modifikation</legend>
<div class="flexrow">
<i class="flex0 fa-solid fa-dice-d20"></i>
{{#ifeq vorteil 1}}
<i class="flex0 fa-solid fa-dice-d20"></i>
{{/ifeq}}
<input
type="text"
style="margin-left: 8px; max-width:10rem"
name="customRoll"
id="rollDisplay"
placeholder="1d20 + {{skill}}"
value="{{customRoll}}"
/>
<div class="flexrow" style="padding-left: 8px">
<i class="flex0 fa-solid fa-dice-d20" style="color:red"></i>
<div class="">
<div class="d-flex align-items-center">
<i class="icon fa-solid fa-dice-d20"></i>
<input
class="flex1"
style="max-width:30px"
type="range"
id="vorteilSlider"
value="{{vorteil}}"
name="vorteil"
min="-1"
max="1"
type="text"
style="margin-left: 8px; max-width:10rem"
name="customRoll"
id="rollDisplay"
placeholder="1d20 + {{skill}}"
value="{{customRoll}}"
/>
<i class="flex0 fa-solid fa-dice-d20" style="color:blue"></i>
<div class="flexrow" 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>
</fieldset>
+120 -24
View File
@@ -3,29 +3,125 @@
data-group="primary"
data-tab="properties"
>
{{#each fields}}
{{#if fieldset}}
<fieldset>
<legend>{{localize legend}}</legend>
{{#each fields}}
<div class="flexrow" style="max-width: 10rem;">
<a
class="flexrow"
data-action="rollSkill"
data-name="{{localize localizationName}}"
data-value="{{value}}"
>
<i class="flex0 fa-solid fa-dice-d20"></i>
<p class="flex1" style="margin-left: 4px; max-width:7rem">{{localize
localizationName
}}</p>
</a>
<input class="skill" type="number" name="{{field.fieldPath}}" value="{{value}}" />
</div>
<div class="container">
<div class="row">
<div class="col-7">
{{#each skills}}
{{#if fieldset}}
<fieldset>
<legend>{{localize legend}}</legend>
{{#each fields}}
<div class="flexrow" style="max-width: 16rem;">
<a
class="flexrow"
data-action="rollSkill"
data-name="{{field.fieldPath}}"
data-value="{{value}}"
>
<p class="flex1" style="margin-left: 4px; max-width:7rem">{{localize
localizationName
}}</p>
</a>
<input class="skill" type="number" name="{{field.fieldPath}}" value="{{value}}" />
<a
class=""
data-action="rollSkill"
data-name="{{localize localizationName}}"
data-value="{{value}}"
>
<i
class="flex0 fa-solid fa-dice-d20"
style="padding:2px 0; border-radius:40%; background-color:var(--M6-background-grey); margin-left:-7px; font-size:18px"
></i>
</a>
</div>
{{/each}}
</fieldset>
{{/if}}
{{/each}}
</fieldset>
{{else}}
{{formGroup outer.field value=outer.value localize=true}}
{{/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-value="{{value}}"
>
<i class="fa-solid fa-dice-d20" style=""></i>
</a>
<input
class="resistenzenAttribut"
type="number"
name="{{field.fieldPath}}"
value="{{value}}"
/>
</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>
<input
class="attribut"
type="number"
name="system.resources.leben.value"
value="{{system.resources.leben.value}}"
/>
</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}}"
/>
</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}}"
/>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</section>