Some check on actor types

This commit is contained in:
Vlyan
2021-10-06 19:01:17 +02:00
parent 2ca33fa104
commit 967b2c7383
7 changed files with 270 additions and 8 deletions

View File

@@ -43,21 +43,22 @@ export const RegisterHandlebars = function () {
/* ------------------------------------ */
/* Utility */
/* ------------------------------------ */
/**
* Json - Display a object in textarea (for debug)
*/
// Json - Display a object in textarea (for debug)
Handlebars.registerHelper("json", function (...objects) {
objects.pop(); // remove this function call
return new Handlebars.SafeString(objects.map((e) => `<textarea>${JSON.stringify(e)}</textarea>`));
});
/**
* Add props "checked" if a and b are equal ({{radioChecked a b}}
*/
// Add props "checked" if a and b are equal ({{radioChecked a b}}
Handlebars.registerHelper("radioChecked", function (a, b) {
return a === b ? new Handlebars.SafeString('checked="checked"') : "";
});
// Add a setter
Handlebars.registerHelper("setVar", function (varName, varValue, options) {
options.data.root[varName] = varValue;
});
/**
* Utility conditional, usable in nested expression
* {{#ifCond (ifCond advancement.type '==' 'technique') '||' (ifCond item.data.technique_type '==' 'kata')}}