Begin working on Aspect items

This commit is contained in:
Oliver-Akins 2023-11-29 22:41:43 -07:00
parent 58facf1490
commit 25e3fa1bb8
14 changed files with 204 additions and 80 deletions

36
module/handlebars.mjs Normal file
View file

@ -0,0 +1,36 @@
export const partials = [
`actors/char-sheet-mvp/partials/dice_choice.hbs`,
`actors/char-sheet-mvp/partials/stat.hbs`,
`actors/char-sheet-mvp/partials/skill.hbs`,
`actors/char-sheet-mvp/partials/panel.hbs`,
`actors/char-sheet-mvp/partials/panels/skills.hbs`,
`items/aspect.hbs`,
];
export async function registerHandlebarsHelpers() {
Handlebars.registerHelper({
"dotdungeon-array": createArray
});
};
export async function preloadHandlebarsTemplates() {
console.groupCollapsed(`.dungeon | Handlebars template loading`)
const pathPrefix = `systems/dotdungeon/templates/`;
const paths = {};
for ( const partial of partials ) {
console.debug(`Loading partial: ${partial}`);
const path = `${pathPrefix}${partial}`;
paths[`dotdungeon.${partial.split(`/`).pop().replace(`.hbs`, ``)}`] = path;
}
console.debug(`Loaded ${partials.length} partials`);
console.groupEnd();
return loadTemplates(paths);
};
function createArray(...args) {
return args.slice(0, -1);
};