Register everything on init

This commit is contained in:
Oliver-Akins 2025-06-29 00:47:56 -06:00
parent e224f819a3
commit 72ce47cdd1
2 changed files with 32 additions and 0 deletions

31
module/hooks/init.mjs Normal file
View file

@ -0,0 +1,31 @@
// Apps
import { PlayerSheet } from "../apps/PlayerSheet.mjs";
// Data Models
import { PlayerData } from "../data/Player.mjs";
// Documents
import { TAFActor } from "../documents/Actor.mjs";
import { TAFTokenDocument } from "../documents/Token.mjs";
// Utils
import { __ID__ } from "../consts.mjs";
import { Logger } from "../utils/Logger.mjs";
Hooks.on(`init`, () => {
Logger.debug(`Initializing`);
CONFIG.Token.documentClass = TAFTokenDocument;
CONFIG.Actor.documentClass = TAFActor;
CONFIG.Actor.dataModels.player = PlayerData;
foundry.documents.collections.Actors.registerSheet(
__ID__,
PlayerSheet,
{
makeDefault: true,
label: `taf.sheet-names.PlayerSheet`,
},
);
});