2021-05-28 18:16:02 +02:00
|
|
|
// Import Modules
|
|
|
|
import { frostgraveActor } from "./actor/actor.js";
|
|
|
|
import { frostgraveActorSheet } from "./actor/actor-sheet.js";
|
|
|
|
import { frostgraveItem } from "./item/item.js";
|
|
|
|
import { frostgraveItemSheet } from "./item/item-sheet.js";
|
|
|
|
import { preloadHandlebarsTemplates } from "./templates.js";
|
|
|
|
|
|
|
|
Hooks.once("init", async function () {
|
|
|
|
game.frostgrave = {
|
|
|
|
frostgraveActor,
|
|
|
|
frostgraveItem,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set an initiative formula for the system
|
|
|
|
* @type {String}
|
|
|
|
*/
|
|
|
|
CONFIG.Combat.initiative = {
|
|
|
|
formula: "1d20",
|
|
|
|
decimals: 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Define custom Entity classes
|
2021-05-29 23:20:50 +02:00
|
|
|
CONFIG.Actor.documentClas = frostgraveActor;
|
|
|
|
CONFIG.Item.documentClas = frostgraveItem;
|
2021-05-28 18:16:02 +02:00
|
|
|
|
|
|
|
// Register sheet application classes
|
|
|
|
Actors.unregisterSheet("core", ActorSheet);
|
2021-05-29 23:20:50 +02:00
|
|
|
Actors.registerSheet("foundryvtt-frostgrave", frostgraveActorSheet, {
|
2021-05-28 18:16:02 +02:00
|
|
|
makeDefault: true,
|
|
|
|
});
|
|
|
|
Items.unregisterSheet("core", ItemSheet);
|
2021-05-29 23:20:50 +02:00
|
|
|
Items.registerSheet("foundryvtt-frostgrave", frostgraveItemSheet, {
|
2021-05-28 18:16:02 +02:00
|
|
|
types: ["item", "feature", "spell"],
|
|
|
|
makeDefault: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
// If you need to add Handlebars helpers, here are a few useful examples:
|
|
|
|
Handlebars.registerHelper("concat", function () {
|
|
|
|
var outStr = "";
|
|
|
|
for (var arg in arguments) {
|
|
|
|
if (typeof arguments[arg] != "object") {
|
|
|
|
outStr += arguments[arg];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return outStr;
|
|
|
|
});
|
|
|
|
|
|
|
|
Handlebars.registerHelper("toLowerCase", function (str) {
|
|
|
|
return str.toLowerCase();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Preload Handlebars Templates
|
|
|
|
preloadHandlebarsTemplates();
|
|
|
|
|
|
|
|
});
|