From bc71b3d2cc2a27a131a4e11fcd87397ac52ab880 Mon Sep 17 00:00:00 2001 From: Joscha Maier Date: Sat, 19 Oct 2024 23:02:28 +0200 Subject: [PATCH] Giving up again --- kidsonbrooms.mjs | 12 ++++----- lang/en.json | 30 +++++++++++++++++++++- modules/dataModel/baseActorModel.mjs | 2 ++ modules/dataModel/playerCharacterModel.mjs | 1 + system.json | 2 +- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/kidsonbrooms.mjs b/kidsonbrooms.mjs index adaee1d..e49f9c1 100644 --- a/kidsonbrooms.mjs +++ b/kidsonbrooms.mjs @@ -15,11 +15,11 @@ Hooks.once("init", async function() { globalThis.kidsonbrooms = game.system; game.system.CONST = SYSTEM; - Object.assign(CONFIG.Actor.dataModels, { - PC: models.PlayerCharacter - }) + Actors.unregisterSheet("core", ActorSheet); + Actors.registerSheet(SYSTEM.id, "core", {types: ["PlayerCharacter"], makeDefault: true}); + + CONFIG.Actor.dataModels = { + playercharacter: models.playerCharacterModel + }; - CONFIG.LOCALIZATION_PREFIXES = { - kidsonbrooms: "KidsOnBrooms" - } }) \ No newline at end of file diff --git a/lang/en.json b/lang/en.json index 7a73a41..629df5a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,2 +1,30 @@ { -} \ No newline at end of file + "BaseActor": { + "FIELDS": { + "age": "Age", + "pronouns": "Pronouns", + "fear": "Fear", + "grade": "Grade", + "stats": { + "fight": "Fight", + "brains": "Brains", + "charm": "Charm", + "flight": "Flight", + "brawn": "Brawn", + "grit": "Grit" + } + } + }, + + "PlayerCharacter": { + "FIELDS": { + "description": "Description", + "broom": "Broom", + "wand": "Wand", + "animalFamiliar": "Animal Familiar", + "schoolbag": "Schoolbag", + "strengths": "Strengths", + "adversityTokens": "Adversity Tokens" + } + } +} diff --git a/modules/dataModel/baseActorModel.mjs b/modules/dataModel/baseActorModel.mjs index 30ce5cb..9da4e0e 100644 --- a/modules/dataModel/baseActorModel.mjs +++ b/modules/dataModel/baseActorModel.mjs @@ -23,6 +23,8 @@ export default class ActorGeneral extends foundry.abstract.TypeDataModel } } + static LOCALISATION_PREFIXES = ["BaseActor"]; + prepareDerivedData() { super.prepareDerivedData(); } diff --git a/modules/dataModel/playerCharacterModel.mjs b/modules/dataModel/playerCharacterModel.mjs index 5e6b05b..3917513 100644 --- a/modules/dataModel/playerCharacterModel.mjs +++ b/modules/dataModel/playerCharacterModel.mjs @@ -21,6 +21,7 @@ export default class PlayerCharacter extends ActorGeneral } } + static LOCALISATION_PREFIXES = ["PlayerCharacter"]; prepareBaseData() { super.prepareBaseData(); let effectsToApply = this.gatherEffects(); diff --git a/system.json b/system.json index 59cb1ea..469d6c9 100644 --- a/system.json +++ b/system.json @@ -10,7 +10,7 @@ "esmodules": ["kidsonbrooms.mjs"], "authors": [{ "name": "Joscha Maier", - "url": "https://github.com/josmaier" + "url": "https://gitlab.com/wintermyst" }], "documentTypes": { "Actor": {