From dd42e5487cf3e34cd57847cdd98aabebcb8ad0f0 Mon Sep 17 00:00:00 2001 From: Joscha Maier Date: Mon, 4 Nov 2024 00:47:13 +0100 Subject: [PATCH] a --- kidsonbrooms.mjs | 8 +++----- modules/dataModel/playerCharacterModel.mjs | 1 + modules/sheets/_system.mjs | 1 + modules/sheets/actor-sheet.mjs | 9 ++++++++- templates/actor/actor-sheet-PlayerCharacter.html | 5 +++++ templates/actor/actor-sheet-pc.html | 5 ----- 6 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 templates/actor/actor-sheet-PlayerCharacter.html delete mode 100644 templates/actor/actor-sheet-pc.html diff --git a/kidsonbrooms.mjs b/kidsonbrooms.mjs index e49f9c1..18f680f 100644 --- a/kidsonbrooms.mjs +++ b/kidsonbrooms.mjs @@ -1,5 +1,5 @@ import * as models from "./modules/dataModel/_system.mjs"; - +import * as sheets from "./modules/sheets/_system.mjs"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ @@ -16,10 +16,8 @@ Hooks.once("init", async function() { game.system.CONST = SYSTEM; Actors.unregisterSheet("core", ActorSheet); - Actors.registerSheet(SYSTEM.id, "core", {types: ["PlayerCharacter"], makeDefault: true}); + Actors.registerSheet(SYSTEM.id, "{{sheets.BaseActorSheet}}", {types: ["PlayerCharacter"], makeDefault: true}); - CONFIG.Actor.dataModels = { - playercharacter: models.playerCharacterModel - }; + CONFIG.Actor.dataModels = models.playerCharacterModel; }) \ No newline at end of file diff --git a/modules/dataModel/playerCharacterModel.mjs b/modules/dataModel/playerCharacterModel.mjs index 3917513..966a2a6 100644 --- a/modules/dataModel/playerCharacterModel.mjs +++ b/modules/dataModel/playerCharacterModel.mjs @@ -22,6 +22,7 @@ export default class PlayerCharacter extends ActorGeneral } static LOCALISATION_PREFIXES = ["PlayerCharacter"]; + prepareBaseData() { super.prepareBaseData(); let effectsToApply = this.gatherEffects(); diff --git a/modules/sheets/_system.mjs b/modules/sheets/_system.mjs index e69de29..01270aa 100644 --- a/modules/sheets/_system.mjs +++ b/modules/sheets/_system.mjs @@ -0,0 +1 @@ +export * from "./actor-sheet.mjs" \ No newline at end of file diff --git a/modules/sheets/actor-sheet.mjs b/modules/sheets/actor-sheet.mjs index 4901691..3195a3c 100644 --- a/modules/sheets/actor-sheet.mjs +++ b/modules/sheets/actor-sheet.mjs @@ -1,4 +1,4 @@ -const {api, sheet} = foundry.applications; +const {api, sheets} = foundry.applications; export default class BaseActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorSheetV2) { @@ -21,4 +21,11 @@ export default class BaseActorSheet extends api.HandlebarsApplicationMixin(sheet return `systems/kidsonbrooms/templates/actor/actor-sheet-{$this.actor.type}.html`; } + async getData() + { + const context = super.getData(); + + console.log(context); + return context; + } } \ No newline at end of file diff --git a/templates/actor/actor-sheet-PlayerCharacter.html b/templates/actor/actor-sheet-PlayerCharacter.html new file mode 100644 index 0000000..a3e3bce --- /dev/null +++ b/templates/actor/actor-sheet-PlayerCharacter.html @@ -0,0 +1,5 @@ +
+
+ +
+
\ No newline at end of file diff --git a/templates/actor/actor-sheet-pc.html b/templates/actor/actor-sheet-pc.html deleted file mode 100644 index b671758..0000000 --- a/templates/actor/actor-sheet-pc.html +++ /dev/null @@ -1,5 +0,0 @@ -
-
- - - \ No newline at end of file