Initial release for FoundryVTT

This commit is contained in:
2026-04-13 15:53:13 +02:00
parent f61cbf0b78
commit 1ff1425777
193 changed files with 11270 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import DonjonEtCieActorSheet from "./base-actor-sheet.mjs";
import { DonjonEtCieUtility } from "../../donjon-et-cie-utility.mjs";
export default class DonjonEtCieEmployeSheet extends DonjonEtCieActorSheet {
static DEFAULT_OPTIONS = {
...super.DEFAULT_OPTIONS,
classes: [...super.DEFAULT_OPTIONS.classes, "employe"],
position: { width: 980, height: 860 }
};
static PARTS = {
main: { template: "systems/fvtt-donjon-et-cie/templates/actors/employe-sheet.hbs" }
};
async _prepareContext() {
const context = await super._prepareContext();
const indexedSections = Object.fromEntries(context.sections.map((section) => [section.key, section]));
const getSection = (key) => indexedSections[key] ?? {
key,
label: context.config.actorSections[key]?.label ?? key,
createType: context.config.actorSections[key]?.createType ?? key,
items: []
};
return {
...context,
magicResources: DonjonEtCieUtility.getMagicResourceContext(this.document),
favorEntries: this.document.getFavorEntries(),
chaosTable: DonjonEtCieUtility.getChaosTableEntries(),
traitsSection: getSection("traits"),
combatSections: ["armes", "armures", "consommables", "equipements"].map(getSection),
spellSection: getSection("sortileges"),
capacitySection: getSection("capacites"),
profileSections: ["langues"].map(getSection)
};
}
}