Functoning weapons
This commit is contained in:
1 parent
747bd3eb8e
commit
2291c5d1e6
24 files changed
+1090
-166
No files matched your search
@@ -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 |
+20
-2
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"Midgard6": {
|
"Midgard6": {
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
|
"Angriff": "Angriff",
|
||||||
|
"Schaden": "Schaden",
|
||||||
"Biography": {
|
"Biography": {
|
||||||
"spezies": "Spezies",
|
"spezies": "Spezies",
|
||||||
"kultur": "Kultur",
|
"kultur": "Kultur",
|
||||||
@@ -75,7 +77,22 @@
|
|||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"Quantity": "Anzahl",
|
"Quantity": "Anzahl",
|
||||||
"Description": "Beschreibung"
|
"Description": "Beschreibung",
|
||||||
|
"Eigenschaften": "Eigenschaften",
|
||||||
|
"type": {
|
||||||
|
"item": {
|
||||||
|
"singular": "Gegenstand",
|
||||||
|
"plural": "Gegenstände"
|
||||||
|
},
|
||||||
|
"weapon": {
|
||||||
|
"singular": "Waffe",
|
||||||
|
"plural": "Waffen"
|
||||||
|
},
|
||||||
|
"armor": {
|
||||||
|
"singular": "Rüstung",
|
||||||
|
"plural": "Rüstungen"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TYPES": {
|
"TYPES": {
|
||||||
@@ -84,7 +101,8 @@
|
|||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"item": "Gegenstand",
|
"item": "Gegenstand",
|
||||||
"spezialisierung": "Spezialisierung"
|
"weapon": "Waffe",
|
||||||
|
"armor": "Rüstung"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,3 +6,6 @@ export const systemID = "midgard6-lvd";
|
|||||||
* @returns {string} The path relative to the Foundry data folder.
|
* @returns {string} The path relative to the Foundry data folder.
|
||||||
*/
|
*/
|
||||||
export const systemPath = (path) => `systems/${systemID}/src/${path}`;
|
export const systemPath = (path) => `systems/${systemID}/src/${path}`;
|
||||||
|
export const assetPath = (path) => `systems/${systemID}/assets/${path}`;
|
||||||
|
|
||||||
|
export const swordSVG = "systems/midgard6-lvd/assets/sword.svg";
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { ItemData } from "./item-data.mjs";
|
||||||
|
|
||||||
|
function defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
const baseData = ItemData.defineSchema();
|
||||||
|
const extendData = {
|
||||||
|
rüstung: new fields.NumberField({
|
||||||
|
required: true,
|
||||||
|
nullable: false,
|
||||||
|
integer: true,
|
||||||
|
initial: 1,
|
||||||
|
min: 0
|
||||||
|
}),
|
||||||
|
equipped: new fields.BooleanField({ inital: false })
|
||||||
|
};
|
||||||
|
|
||||||
|
return Object.assign(baseData, extendData);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ArmorData extends ItemData {
|
||||||
|
static defineSchema = defineSchema;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -2,4 +2,17 @@ export const loadHelpers = async function () {
|
|||||||
Handlebars.registerHelper("ifeq", function (arg1, arg2, options) {
|
Handlebars.registerHelper("ifeq", function (arg1, arg2, options) {
|
||||||
return arg1 == arg2 ? options.fn(this) : options.inverse(this);
|
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;
|
||||||
|
}
|
||||||
|
console.warn(actor, arg);
|
||||||
|
return foundry.utils.getProperty(actor, arg);
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper("isdefined", function (value) {
|
||||||
|
return value !== undefined;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static #cycleEquip() {
|
||||||
|
this.item.update({
|
||||||
|
system: {
|
||||||
|
equipped: !this.item.system.equipped
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+405
-13
@@ -24,12 +24,15 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
deleteDoc: this.#deleteDoc,
|
deleteDoc: this.#deleteDoc,
|
||||||
toggleEffect: this.#toggleEffect,
|
toggleEffect: this.#toggleEffect,
|
||||||
rollSkill: this.#rollSkill,
|
rollSkill: this.#rollSkill,
|
||||||
|
rollWeapon: this.#rollWeapon,
|
||||||
|
cycleEquip: this.#cycleEquip,
|
||||||
addSpezialisierung: addSpezialisierung,
|
addSpezialisierung: addSpezialisierung,
|
||||||
editSepzialisierung: editSepzialisierung
|
editSepzialisierung: editSepzialisierung
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
submitOnChange: true
|
submitOnChange: true
|
||||||
}
|
},
|
||||||
|
dragDrop: [{ dragSelector: ".draggable", dropSelector: null }]
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
@@ -39,12 +42,16 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
tabs: [
|
tabs: [
|
||||||
{
|
{
|
||||||
id: "properties",
|
id: "properties",
|
||||||
icon: "fa-feather-pointed"
|
icon: "fa-shield-halved"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "items",
|
id: "items",
|
||||||
icon: "fa-suitcase"
|
icon: "fa-suitcase"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "biographie",
|
||||||
|
icon: "fa-feather"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "effects",
|
id: "effects",
|
||||||
icon: "fa-bolt"
|
icon: "fa-bolt"
|
||||||
@@ -73,6 +80,10 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
template: systemPath("templates/actor/items.hbs"),
|
template: systemPath("templates/actor/items.hbs"),
|
||||||
scrollable: [""]
|
scrollable: [""]
|
||||||
},
|
},
|
||||||
|
// biographie: {
|
||||||
|
// template: systemPath("templates/items/description.hbs"),
|
||||||
|
// scrollable: [""]
|
||||||
|
// },
|
||||||
effects: {
|
effects: {
|
||||||
template: systemPath("templates/shared/effects.hbs"),
|
template: systemPath("templates/shared/effects.hbs"),
|
||||||
scrollable: [""]
|
scrollable: [""]
|
||||||
@@ -125,10 +136,11 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
case "properties":
|
case "properties":
|
||||||
context.skills = await this._getSkills();
|
context.skills = await this._getSkills();
|
||||||
context.resistenzen = await this._getResistenzen();
|
context.resistenzen = await this._getResistenzen();
|
||||||
|
context.equippedWeapons = await this._prepWeapons();
|
||||||
context.tab = context.tabs[partId];
|
context.tab = context.tabs[partId];
|
||||||
break;
|
break;
|
||||||
case "items":
|
case "items":
|
||||||
context.itemTypes = this._getItems();
|
context.itemTypes = await this._getItems();
|
||||||
context.gewicht = this._clacWeight();
|
context.gewicht = this._clacWeight();
|
||||||
context.tab = context.tabs[partId];
|
context.tab = context.tabs[partId];
|
||||||
break;
|
break;
|
||||||
@@ -245,6 +257,35 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
return fieldSets;
|
return fieldSets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _prepWeapons() {
|
||||||
|
const weaponItems = this.actor.items.filter((x) => x.type === "weapon" && x.system.equipped);
|
||||||
|
const weapons = [];
|
||||||
|
weaponItems.forEach((weapon) => {
|
||||||
|
const skill = foundry.utils.getProperty(this.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #cycleEquip(event, target) {
|
||||||
|
const item = this.actor.items.get(target.dataset.itemId);
|
||||||
|
item.update({
|
||||||
|
system: {
|
||||||
|
equipped: !item.system.equipped
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,17 +320,18 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
for (const item of this.actor.items) {
|
for (const item of this.actor.items) {
|
||||||
types[item.type].items.push(item);
|
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
|
// Only show Base if it's actually being used
|
||||||
if (types.base.items.length === 0) delete types.base;
|
if (types.base.items.length === 0) delete types.base;
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
_clacWeight() {
|
_clacWeight() {
|
||||||
const items = this._getItems();
|
const items = this.actor.items.filter((x) => x.system.gewicht);
|
||||||
let gewicht = items.item.items.reduce(
|
let gewicht = items.reduce((accumulator, item) => accumulator + item.system.gewicht, 0);
|
||||||
(accumulator, item) => accumulator + item.system.gewicht,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
let traglast = Math.max(this.actor.system.skills.körper.athletik.value, 10);
|
let traglast = Math.max(this.actor.system.skills.körper.athletik.value, 10);
|
||||||
return {
|
return {
|
||||||
@@ -394,8 +436,8 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
skill,
|
skill,
|
||||||
actor
|
actor
|
||||||
});
|
});
|
||||||
console.warn(dialogResult);
|
console.log("Dialog Result", dialogResult);
|
||||||
if (dialogResult.noRoll) {
|
if (!dialogResult) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Construct the Roll instance
|
// Construct the Roll instance
|
||||||
@@ -441,11 +483,83 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
roll.toMessage();
|
roll.toMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async #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 this.rollDialog({
|
||||||
|
name: weapon.name,
|
||||||
|
skill,
|
||||||
|
damageRoll: weapon.system.schaden,
|
||||||
|
preSelectedSpez: weapon.system.spezialisierung,
|
||||||
|
actor
|
||||||
|
});
|
||||||
|
console.log("Dialog Result", dialogResult);
|
||||||
|
if (!dialogResult) {
|
||||||
|
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).evaluate();
|
||||||
|
} else {
|
||||||
|
attackRoll = await new Roll(
|
||||||
|
rollTerm,
|
||||||
|
{ die: die, skill: skillValue, spezBonus: dialogResult.spezLevel + 1 },
|
||||||
|
{ flavor: rollFlavor }
|
||||||
|
).evaluate();
|
||||||
|
}
|
||||||
|
|
||||||
|
damageRoll = await new Roll(
|
||||||
|
"@die",
|
||||||
|
{ die: weapon.system.schaden },
|
||||||
|
{ flavor: game.i18n.localize("Midgard6.Schaden") }
|
||||||
|
).evaluate();
|
||||||
|
|
||||||
|
// The parsed terms of the roll formula
|
||||||
|
|
||||||
|
const chatData = {
|
||||||
|
user: game.user.id,
|
||||||
|
rolls: [attackRoll, damageRoll] // Übergibt beide Rolls an die Nachricht
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("Roll:", chatData.rolls);
|
||||||
|
|
||||||
|
await ChatMessage.create(chatData);
|
||||||
|
}
|
||||||
|
|
||||||
async rollDialog(rollDialogRequest) {
|
async rollDialog(rollDialogRequest) {
|
||||||
// Assamble dialog depending on roll type
|
// Assamble dialog depending on roll type
|
||||||
let label = rollDialogRequest.name;
|
let label = rollDialogRequest.name;
|
||||||
let skillValue = rollDialogRequest.skill.value || rollDialogRequest.skill;
|
let skillValue = rollDialogRequest.skill.value || rollDialogRequest.skill;
|
||||||
let bonuses = rollDialogRequest.skill.bonuses || [];
|
let bonuses = rollDialogRequest.skill.bonuses || [];
|
||||||
|
let damageRoll = rollDialogRequest.damageRoll || "";
|
||||||
|
let preSelectedSpez = rollDialogRequest.preSelectedSpez || "";
|
||||||
let vorteil = 0;
|
let vorteil = 0;
|
||||||
let customRoll = "";
|
let customRoll = "";
|
||||||
let spezLevel;
|
let spezLevel;
|
||||||
@@ -453,10 +567,11 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
// 1. Define the path to .hbs template
|
// 1. Define the path to .hbs template
|
||||||
const templatePath = systemPath("templates/dialog/roll-dialog.hbs");
|
const templatePath = systemPath("templates/dialog/roll-dialog.hbs");
|
||||||
const templateData = {
|
const templateData = {
|
||||||
classes: ["M6", "dialog"],
|
|
||||||
skillValue,
|
skillValue,
|
||||||
bonuses,
|
bonuses,
|
||||||
vorteil,
|
vorteil,
|
||||||
|
damageRoll,
|
||||||
|
preSelectedSpez,
|
||||||
customRoll
|
customRoll
|
||||||
};
|
};
|
||||||
// 2. Render the Handlebars template into an HTML string
|
// 2. Render the Handlebars template into an HTML string
|
||||||
@@ -471,6 +586,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
position: {
|
position: {
|
||||||
width: 600
|
width: 600
|
||||||
},
|
},
|
||||||
|
classes: ["M6", "dialog"],
|
||||||
content,
|
content,
|
||||||
actions: {},
|
actions: {},
|
||||||
render: (_event, dialog) => {
|
render: (_event, dialog) => {
|
||||||
@@ -499,9 +615,13 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
|
|
||||||
document.querySelectorAll('input[name="spezialisierung-segment"]').forEach((radio) => {
|
document.querySelectorAll('input[name="spezialisierung-segment"]').forEach((radio) => {
|
||||||
radio.addEventListener("change", (e) => {
|
radio.addEventListener("change", (e) => {
|
||||||
|
console.log(e.target.dataset.name);
|
||||||
spezLevel = parseInt(e.target.value);
|
spezLevel = parseInt(e.target.value);
|
||||||
spezName = e.target.dataset.name;
|
spezName = e.target.dataset.name;
|
||||||
});
|
});
|
||||||
|
if (radio.dataset.name === preSelectedSpez) {
|
||||||
|
radio.click();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -509,7 +629,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
action: "abort",
|
action: "abort",
|
||||||
label: "Midgard6.Dialog.abbrechen",
|
label: "Midgard6.Dialog.abbrechen",
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button, dialog) => {
|
||||||
return { noRoll: true };
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -519,6 +639,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
callback: (event, button, dialog) => {
|
callback: (event, button, dialog) => {
|
||||||
const rollData = {
|
const rollData = {
|
||||||
customRoll: button.form.elements.customRoll.value,
|
customRoll: button.form.elements.customRoll.value,
|
||||||
|
customDamageRoll: button.form.elements.customDamageRoll?.value || "",
|
||||||
vorteil,
|
vorteil,
|
||||||
spezLevel,
|
spezLevel,
|
||||||
spezName
|
spezName
|
||||||
@@ -577,7 +698,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables inpM6 subject to active effects.
|
* Disables inputs subject to active effects.
|
||||||
*/
|
*/
|
||||||
#disableOverrides() {
|
#disableOverrides() {
|
||||||
const flatOverrides = foundry.utils.flattenObject(this.actor.overrides);
|
const flatOverrides = foundry.utils.flattenObject(this.actor.overrides);
|
||||||
@@ -586,4 +707,275 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
if (input) input.disabled = true;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
// Prüfen, ob das Item von diesem Actor stammt und Shift NICHT gedrückt ist
|
||||||
|
// Sortieren, nicht kopieren/verschieben
|
||||||
|
return this._onSortItem(event, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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));
|
||||||
|
}
|
||||||
|
// item = items.get(item.itemId);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ const { api, sheets } = foundry.applications;
|
|||||||
*/
|
*/
|
||||||
export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet) {
|
export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet) {
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
|
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
window: {
|
window: {
|
||||||
resizable: true
|
resizable: true
|
||||||
@@ -35,7 +36,7 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
primary: {
|
primary: {
|
||||||
tabs: [
|
tabs: [
|
||||||
{
|
{
|
||||||
id: "description",
|
id: "beschreibung",
|
||||||
icon: "fa-feather-pointed"
|
icon: "fa-feather-pointed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -43,8 +44,8 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
icon: "fa-bolt"
|
icon: "fa-bolt"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
initial: "description",
|
initial: "beschreibung",
|
||||||
labelPrefix: "M6.Sheets.Tabs"
|
labelPrefix: "Midgard6.Sheets.Tabs"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
tabs: {
|
tabs: {
|
||||||
template: systemPath("templates/actor/tabs.hbs")
|
template: systemPath("templates/actor/tabs.hbs")
|
||||||
},
|
},
|
||||||
description: {
|
beschreibung: {
|
||||||
template: systemPath("templates/item/description.hbs"),
|
template: systemPath("templates/item/description.hbs"),
|
||||||
scrollable: [""]
|
scrollable: [""]
|
||||||
},
|
},
|
||||||
@@ -109,7 +110,7 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
context.effects = prepareActiveEffectCategories(this.item.effects);
|
context.effects = prepareActiveEffectCategories(this.item.effects);
|
||||||
context.tab = context.tabs[partId];
|
context.tab = context.tabs[partId];
|
||||||
break;
|
break;
|
||||||
case "description":
|
case "beschreibung":
|
||||||
context.fields = await this._getFields();
|
context.fields = await this._getFields();
|
||||||
context.enrichedBeschreibung =
|
context.enrichedBeschreibung =
|
||||||
await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||||
@@ -125,6 +126,9 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
);
|
);
|
||||||
context.tab = context.tabs[partId];
|
context.tab = context.tabs[partId];
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
await this._addSpecifics(context);
|
||||||
|
context.tab = context.tabs[partId];
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
@@ -338,8 +342,10 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
async _onDrop(event) {
|
async _onDrop(event) {
|
||||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||||
const item = this.item;
|
const item = this.item;
|
||||||
|
console.warn(data.type);
|
||||||
|
|
||||||
const allowed = Hooks.call("dropItemSheetData", item, this, data);
|
const allowed = Hooks.call("dropItemSheetData", item, this, data);
|
||||||
if (allowed === false) return;
|
// if (allowed === false) return;
|
||||||
|
|
||||||
// Handle different data types
|
// Handle different data types
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
@@ -436,6 +442,55 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
*/
|
*/
|
||||||
async _onDropItem(event, data) {
|
async _onDropItem(event, data) {
|
||||||
if (!this.item.isOwner) return false;
|
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;
|
||||||
|
console.warn(isSameActor);
|
||||||
|
|
||||||
|
if (isSameActor) {
|
||||||
|
console.warn("here");
|
||||||
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
@@ -490,4 +545,8 @@ export class M6ItemSheet extends api.HandlebarsApplicationMixin(sheets.ItemSheet
|
|||||||
return new foundry.applications.ux.DragDrop(d);
|
return new foundry.applications.ux.DragDrop(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _addSpecifics(context) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
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 // 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"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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/actor/tabs.hbs")
|
||||||
|
},
|
||||||
|
eigenschaften: {
|
||||||
|
template: systemPath("templates/item/eigenschaften.hbs"),
|
||||||
|
scrollable: [""]
|
||||||
|
},
|
||||||
|
beschreibung: {
|
||||||
|
template: systemPath("templates/item/description.hbs"),
|
||||||
|
scrollable: [""]
|
||||||
|
},
|
||||||
|
effects: {
|
||||||
|
template: systemPath("templates/shared/effects.hbs"),
|
||||||
|
scrollable: [""]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
-1
@@ -4,6 +4,7 @@
|
|||||||
@import url("./resistenzen.scss");
|
@import url("./resistenzen.scss");
|
||||||
@import url("./dialog.scss");
|
@import url("./dialog.scss");
|
||||||
@import url("./items-page.scss");
|
@import url("./items-page.scss");
|
||||||
|
@import url("./icons.scss");
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--M6-background-grey: #d3d7d7;
|
--M6-background-grey: #d3d7d7;
|
||||||
@@ -43,7 +44,7 @@
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.application.sheet.M6 {
|
.M6 {
|
||||||
background-color: var(--M6-background-white);
|
background-color: var(--M6-background-white);
|
||||||
color: var(--M6-text-grey);
|
color: var(--M6-text-grey);
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@
|
|||||||
background-color: var(--M6-background-white);
|
background-color: var(--M6-background-white);
|
||||||
color: black;
|
color: black;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
transition: none;
|
||||||
&.skill {
|
&.skill {
|
||||||
max-width: 2rem;
|
max-width: 2rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -63,6 +65,9 @@
|
|||||||
margin: 0 0.5rem;
|
margin: 0 0.5rem;
|
||||||
}
|
}
|
||||||
&.text {
|
&.text {
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
&.right {
|
&.right {
|
||||||
text-align: end;
|
text-align: end;
|
||||||
}
|
}
|
||||||
@@ -71,6 +76,17 @@
|
|||||||
input:focus {
|
input:focus {
|
||||||
outline: none;
|
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 {
|
p {
|
||||||
&.center {
|
&.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
+57
-56
@@ -1,4 +1,4 @@
|
|||||||
.application.dialog {
|
.application.dialog.M6 {
|
||||||
background-color: var(--M6-background-white);
|
background-color: var(--M6-background-white);
|
||||||
color: var(--M6-text-grey);
|
color: var(--M6-text-grey);
|
||||||
|
|
||||||
@@ -57,66 +57,67 @@
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Container für die gesamte Reihe */
|
}
|
||||||
.segmented-button-row {
|
|
||||||
display: inline-flex;
|
|
||||||
overflow: hidden;
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Einzelnes Segment */
|
/* Container für die gesamte Reihe */
|
||||||
.segmented-button {
|
.segmented-button-row {
|
||||||
position: relative;
|
display: inline-flex;
|
||||||
cursor: pointer;
|
overflow: hidden;
|
||||||
display: flex;
|
height: 32px;
|
||||||
align-items: center;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Versteckt den echten Radio-Button, behält aber die Tastatur-Navigation */
|
/* Einzelnes Segment */
|
||||||
.segmented-button input[type="radio"] {
|
.segmented-button {
|
||||||
position: absolute;
|
position: relative;
|
||||||
opacity: 0;
|
cursor: pointer;
|
||||||
width: 0;
|
display: flex;
|
||||||
height: 0;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inhalt des Segments (Layout & Abstände) */
|
/* Versteckt den echten Radio-Button, behält aber die Tastatur-Navigation */
|
||||||
.segmented-button__content {
|
.segmented-button input[type="radio"] {
|
||||||
display: flex;
|
position: absolute;
|
||||||
align-items: center;
|
opacity: 0;
|
||||||
justify-content: center;
|
width: 0;
|
||||||
padding: 0 8px;
|
height: 0;
|
||||||
height: 100%;
|
}
|
||||||
transition:
|
|
||||||
background-color 0.2s,
|
|
||||||
color 0.2s;
|
|
||||||
background-color: transparent;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- ZUSTÄNDE --- */
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
/* Selektiert (Selected State) */
|
/* --- ZUSTÄNDE --- */
|
||||||
.segmented-button input[type="radio"]:checked + .segmented-button__content {
|
|
||||||
// background-color: #e8def8; /* M3 Secondary Container Color */
|
/* 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;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ html {
|
|||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.application.sheet.M6 {
|
.M6 {
|
||||||
.container {
|
.container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding-right: 15px;
|
/* padding-right: 15px;
|
||||||
|
|||||||
@@ -45,4 +45,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-checked {
|
||||||
|
background-color: var(--M6-text-brown);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.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);
|
||||||
|
}
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
import { CharacterData } from "./data/character-data.mjs";
|
import { CharacterData } from "./data/character-data.mjs";
|
||||||
|
import { WeaponData } from "./data/weapon-data.mjs";
|
||||||
import { ItemData } from "./data/item-data.mjs";
|
import { ItemData } from "./data/item-data.mjs";
|
||||||
|
import { ArmorData } from "./data/armor-data.mjs";
|
||||||
import { M6ActorSheet } from "./sheets/character-sheet.mjs";
|
import { M6ActorSheet } from "./sheets/character-sheet.mjs";
|
||||||
import { M6ItemSheet } from "./sheets/item-sheet.mjs";
|
import { M6ItemSheet } from "./sheets/item-sheet.mjs";
|
||||||
|
import { M6WeaponSheet } from "./sheets/weapon-sheet.mjs";
|
||||||
|
import { M6ArmorSheet } from "./sheets/armor-sheet.mjs";
|
||||||
import { loadHelpers } from "./helpers/handlebar-helpers.mjs";
|
import { loadHelpers } from "./helpers/handlebar-helpers.mjs";
|
||||||
import "./styles/M6.scss";
|
import "./styles/M6.scss";
|
||||||
|
|
||||||
@@ -18,6 +22,8 @@ Hooks.once("init", () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
CONFIG.Item.dataModels.item = ItemData;
|
CONFIG.Item.dataModels.item = ItemData;
|
||||||
|
CONFIG.Item.dataModels.weapon = WeaponData;
|
||||||
|
CONFIG.Item.dataModels.armor = ArmorData;
|
||||||
|
|
||||||
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "midgard6-lvd", M6ActorSheet, {
|
foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "midgard6-lvd", M6ActorSheet, {
|
||||||
types: ["character"],
|
types: ["character"],
|
||||||
@@ -27,6 +33,12 @@ Hooks.once("init", () => {
|
|||||||
types: ["item"],
|
types: ["item"],
|
||||||
makeDefault: true
|
makeDefault: true
|
||||||
});
|
});
|
||||||
|
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6WeaponSheet, {
|
||||||
|
types: ["weapon"]
|
||||||
|
});
|
||||||
|
foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "midgard6-lvd", M6ArmorSheet, {
|
||||||
|
types: ["armor"]
|
||||||
|
});
|
||||||
|
|
||||||
loadHelpers();
|
loadHelpers();
|
||||||
});
|
});
|
||||||
+160
-49
@@ -1,53 +1,164 @@
|
|||||||
{{! Items Tab }}
|
{{! Items Tab }}
|
||||||
<section class="tab scrollable {{tab.cssClass}}" data-group="primary" data-tab="items">
|
<section class="standard-form tab scrollable {{tab.cssClass}}" data-group="primary" data-tab="items">
|
||||||
<ul class="itemTypes">
|
<div class="container">
|
||||||
{{#each itemTypes as |group type|}}
|
<div class="row">
|
||||||
<li class="itemHeader flexrow">
|
<div class="col-6">
|
||||||
<div class="type-label">
|
<fieldset >
|
||||||
{{group.label}}
|
<legend>{{localize "Midgard6.Item.type.item.plural" }}</legend>
|
||||||
</div>
|
<ul class="itemTypes">
|
||||||
<div class="document-controls">
|
{{#with itemTypes.item}}
|
||||||
{{#if @root.editable}}
|
<li class="itemHeader">
|
||||||
<a
|
<div class="document-controls">
|
||||||
class="item-control item-create"
|
{{#if @root.editable}}
|
||||||
title="{{localize 'DOCUMENT.Create' type=group.label}}"
|
<a
|
||||||
data-action="createDoc"
|
class="item-control item-create"
|
||||||
data-document-class="Item"
|
title="{{localize 'DOCUMENT.Create' type=this.label}}"
|
||||||
data-type="{{type}}"
|
data-action="createDoc"
|
||||||
>
|
data-document-class="Item"
|
||||||
<i class="fas fa-plus"></i>
|
data-type="item"
|
||||||
{{localize "DOCUMENT.New" type=group.label}}
|
>
|
||||||
</a>
|
<i class="fas fa-plus"></i>
|
||||||
{{/if}}
|
{{localize "DOCUMENT.Create" type=this.label}}
|
||||||
</div>
|
</a>
|
||||||
</li>
|
{{/if}}
|
||||||
<ul class="items">
|
</div>
|
||||||
{{#each group.items as |item|}}
|
</li>
|
||||||
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-document-class="Item">
|
<ul class="items">
|
||||||
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
{{#each this.items as |item|}}
|
||||||
<div class="item-name">{{item.name}}</div>
|
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
|
||||||
<div class="document-controls">
|
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
||||||
<a
|
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||||
class="item-control item-edit"
|
<div class="document-controls">
|
||||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
<a
|
||||||
data-action="viewDoc"
|
class="item-control item-edit"
|
||||||
>
|
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||||
<i class="fas fa-edit"></i>
|
data-action="viewDoc"
|
||||||
</a>
|
>
|
||||||
{{#if @root.editable}}
|
<i class="fas fa-edit"></i>
|
||||||
<a
|
</a>
|
||||||
class="item-control item-delete"
|
{{#if @root.editable}}
|
||||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
<a
|
||||||
data-action="deleteDoc"
|
class="item-control item-delete"
|
||||||
>
|
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||||
<i class="fas fa-trash"></i>
|
data-action="deleteDoc"
|
||||||
</a>
|
>
|
||||||
{{/if}}
|
<i class="fas fa-trash"></i>
|
||||||
</div>
|
</a>
|
||||||
</li>
|
{{/if}}
|
||||||
{{/each}}
|
</div>
|
||||||
</ul>
|
</li>
|
||||||
{{/each}}
|
{{/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">
|
||||||
|
<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=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>
|
||||||
|
<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>
|
||||||
|
{{#if @root.editable}}
|
||||||
|
<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>
|
</ul>
|
||||||
<div class="sticky-progress-container">
|
<div class="sticky-progress-container">
|
||||||
<div class="progress-background">
|
<div class="progress-background">
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
<section class="standard-form" style="margin-bottom: 1rem">
|
<section class="standard-form" style="margin-bottom: 1rem">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Modifikation</legend>
|
<legend>Modifikation</legend>
|
||||||
<div class="">
|
<div class="container">
|
||||||
<div class="d-flex align-items-center">
|
<div class="row">
|
||||||
<i class="icon fa-solid fa-dice-d20"></i>
|
{{! <div class="d-flex align-items-center"> }}
|
||||||
<input
|
<div class="col-6">
|
||||||
type="text"
|
<input
|
||||||
style="margin-left: 8px; max-width:10rem"
|
type="text"
|
||||||
name="customRoll"
|
style="margin-left: 8px;"
|
||||||
id="rollDisplay"
|
name="customRoll"
|
||||||
placeholder="1d20 + {{skillValue}}"
|
id="rollDisplay"
|
||||||
value="{{customRoll}}"
|
placeholder="1d20 + {{skillValue}}"
|
||||||
/>
|
value="{{customRoll}}"
|
||||||
<div class="flexrow" style="padding-left: 8px">
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex col-6" style="padding-left: 8px;">
|
||||||
<div class="segmented-button-row">
|
<div class="segmented-button-row">
|
||||||
<!-- Option 1 -->
|
<!-- Option 1 -->
|
||||||
<label class="segmented-button">
|
<label class="segmented-button">
|
||||||
@@ -42,27 +44,41 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{! </div> }}
|
||||||
<div class="d-flex">
|
<div class="col-12 d-flex">
|
||||||
<div class="flexrow" style="padding-left: 8px">
|
<div class="flexrow" style="padding-left: 8px">
|
||||||
<div class="segmented-button-row">
|
<div class="segmented-button-row">
|
||||||
<!-- Option 1 -->
|
<!-- Option 1 -->
|
||||||
{{#each bonuses}}
|
{{#each bonuses}}
|
||||||
<label class="segmented-button">
|
<label class="segmented-button">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="spezialisierung-segment"
|
name="spezialisierung-segment"
|
||||||
value="{{level}}"
|
value="{{level}}"
|
||||||
data-name="{{name}}"
|
data-name="{{name}}"
|
||||||
/>
|
{{#ifeq name preSelectedSpez}}checked{{/ifeq}}
|
||||||
<span class="segmented-button__content">
|
/>
|
||||||
{{name}}:
|
<span class="segmented-button__content">
|
||||||
{{level}}
|
{{name}}:
|
||||||
</span>
|
{{level}}
|
||||||
</label>
|
</span>
|
||||||
{{/each}}
|
</label>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
{{! Beschreibung Allgemein Tab }}
|
{{! Beschreibung Allgemein Tab }}
|
||||||
<section class="tab {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
|
<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. }}
|
{{! Editors must receive enriched text data from getData to properly handle rolls, UUID links, etc. }}
|
||||||
<fieldset style="height:100%">
|
<fieldset style="height:100%">
|
||||||
|
<legend>{{localize "Midgard6.Item.Description"}}</legend>
|
||||||
{{#if editable}}
|
{{#if editable}}
|
||||||
<prose-mirror
|
<prose-mirror
|
||||||
style="height:100%"
|
style="height:100%"
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<section
|
||||||
|
class="standard-form tab {{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>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 class="d-flex justify-content-between">
|
||||||
|
<p>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>
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<p>Spezialisierung</p>
|
||||||
|
<select
|
||||||
|
type="text"
|
||||||
|
style="margin-left: 8px; max-width:10rem"
|
||||||
|
name="system.spezialisierung"
|
||||||
|
id="spezialisierung"
|
||||||
|
placeholder=""
|
||||||
|
/>
|
||||||
|
{{#each bonuses as |bonus|}}
|
||||||
|
<option {{#ifeq system.spezialisierung bonus.name}}selected{{/ifeq}} value="{{bonus.name}}">
|
||||||
|
{{bonus.name}}
|
||||||
|
</option>
|
||||||
|
{{/each}}
|
||||||
|
<option {{#ifeq system.spezialisierung ""}}selected{{/ifeq}} value=""></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</section>
|
||||||
@@ -1,7 +1,17 @@
|
|||||||
<header class="sheet-header" style="margin: 1px;">
|
<header class="sheet-header" style="margin: 1px;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row align-items-end" style="height: 108px" >
|
<div class="row align-items-end" style="height: 108px" >
|
||||||
<div class="col-12" style="height:36px"></div>
|
<div class="col-6" style="height:32px">
|
||||||
|
{{#if (isdefined system.equipped)}}
|
||||||
|
<div class="d-flex justify-content-center justify-items-center">
|
||||||
|
<a class="sword {{#if system.equipped}}icon-checked{{/if}}" data-action="cycleEquip" data-item-id="{{item._id}}"></a>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</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">
|
<div class="col-6">
|
||||||
<input class="custom-input left text" type="number" placeholder="{{localize "Midgard6.Gegenstand.wert"}}" name="system.wert" value="{{item.system.wert}}" />
|
<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>
|
<i class="fa-solid fa-sack-dollar input-icon left"></i>
|
||||||
@@ -16,13 +26,13 @@
|
|||||||
<img
|
<img
|
||||||
class="profile-img"
|
class="profile-img"
|
||||||
style="z-index:1"
|
style="z-index:1"
|
||||||
src="{{actor.img}}"
|
src="{{item.img}}"
|
||||||
alt="{{actor.name}}"
|
alt="{{item.name}}"
|
||||||
{{#if editable}}
|
{{#if editable}}
|
||||||
data-action="editImage"
|
data-action="editImage"
|
||||||
data-edit="img"
|
data-edit="img"
|
||||||
{{/if}}
|
{{/if}}
|
||||||
data-tooltip="{{actor.name}}"
|
data-tooltip="{{item.name}}"
|
||||||
height="100" width="100"
|
height="100" width="100"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -142,6 +142,37 @@
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</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}}"
|
||||||
|
>
|
||||||
|
<i class="fas fa-dice-d20"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { CharacterData } from "../data/character-data";
|
import { CharacterData } from "../data/character-data";
|
||||||
import { ItemData } from "../data/item-data";
|
import { ItemData } from "../data/item-data";
|
||||||
|
import { WeaponData } from "../data/weapon-data";
|
||||||
|
import { ArmorData } from "../data/armor-data";
|
||||||
|
|
||||||
declare module "fvtt-types/configuration" {
|
declare module "fvtt-types/configuration" {
|
||||||
interface DataModelConfig {
|
interface DataModelConfig {
|
||||||
Actor: { character: typeof CharacterData };
|
Actor: { character: typeof CharacterData };
|
||||||
Item: { item: typeof ItemData };
|
Item: { item: typeof ItemData, weapon: typeof WeaponData, armor: typeof ArmorData };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-1
@@ -33,7 +33,9 @@
|
|||||||
"character": {}
|
"character": {}
|
||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"item": {}
|
"item": {},
|
||||||
|
"weapon": {},
|
||||||
|
"armor": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
|
|||||||
Reference in new issue
Block a user