Initial release for FoundryVTT
This commit is contained in:
37
modules/applications/sheets/donjon-et-cie-employe-sheet.mjs
Normal file
37
modules/applications/sheets/donjon-et-cie-employe-sheet.mjs
Normal 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)
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user