28 lines
955 B
TypeScript
28 lines
955 B
TypeScript
import Globals from "./Globals";
|
|
|
|
const preloadTemplates = async (): Promise<
|
|
Handlebars.TemplateDelegate<any>[]
|
|
> => {
|
|
const rootPath = `${Globals.isModule ? "modules" : "systems"}/${Globals.name}/templates/`;
|
|
// Place relative paths in array below, e.g.:
|
|
// const templates = [ rootPath + "actor/actor-sheet.hbs" ]
|
|
// This would map to our local folder of /Assets/Templates/Actor/actor-sheet.hbs
|
|
const templates: Array<string> = [
|
|
"sheets/character/description.hbs",
|
|
"sheets/character/attribute.hbs",
|
|
"sheets/character/base_values.hbs",
|
|
"sheets/character/main.hbs",
|
|
"sheets/character/skills.hbs",
|
|
"sheets/character/gear.hbs",
|
|
"sheets/character/spells.hbs",
|
|
"sheets/character/combat.hbs",
|
|
"sheets/character/effects.hbs",
|
|
"sheets/partial/mod.hbs",
|
|
"sheets/item/rolls.hbs",
|
|
"chat/roll-m5.hbs",
|
|
];
|
|
return loadTemplates(templates.map((s) => rootPath + s));
|
|
};
|
|
|
|
export default preloadTemplates;
|