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

View file

@ -1,32 +0,0 @@
import * as hbs from "../handlebars.js";
Hooks.on(`hotReload`, async (data) => {
if (data.extension !== 'hbs') {
return true;
};
if (!hbs.partials.some(p => data.path.endsWith(p))) {
return true;
};
// Compile the new template data.
let template;
try {
template = Handlebars.compile(data.content);
} catch (err) {
return console.error(err);
};
// Re-register our new partial template & cache it.
const templateName = `dotdungeon.${data.path.split("/").pop().replace(".hbs", "")}`;
Handlebars.registerPartial(templateName, template);
_templateCache[templateName] = template;
// Re-render open windows
for (const window of ui.windows) {
window.render(true);
};
return false;
});