/** * YggDrasill system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { YggdrasillActor } from "./yggdrasill-actor.js"; import { YggdrasillItemSheet } from "./yggdrasill-item-sheet.js"; import { YggdrasillActorSheet } from "./yggdrasill-actor-sheet.js"; import { YggdrasillFigurantSheet } from "./yggdrasill-figurant-sheet.js"; import { YggdrasillUtility } from "./yggdrasill-utility.js"; import { YggdrasillCombat } from "./yggdrasill-combat.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Yggdrasill`); /* -------------------------------------------- */ // preload handlebars templates YggdrasillUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d20", decimals: 0 }; /* -------------------------------------------- */ game.socket.on("system.fvtt-yggdrasill", data => { YggdrasillUtility.onSocketMesssage(data); }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Actor.documentClass = YggdrasillActor; CONFIG.Combat.documentClass = YggdrasillCombat; CONFIG.Yggdrasill = { } /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("fvtt-yggdrasill", YggdrasillActorSheet, { types: ["personnage"], makeDefault: true }); Actors.registerSheet("fvtt-yggdrasill", YggdrasillFigurantSheet, { types: ["figurant"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("fvtt-yggdrasill", YggdrasillItemSheet, { makeDefault: true }); // Init/registers Hooks.on('renderChatLog', (log, html, data) => { //YggdrasillUtility.registerChatCallbacks(html); }); }); /* -------------------------------------------- */ function welcomeMessage() { //ChatUtility.removeMyChatMessageContaining('