working on dice picker v2

This commit is contained in:
Vlyan
2020-12-12 19:58:17 +01:00
parent 91151817cc
commit a41f074cb8
7 changed files with 233 additions and 51 deletions

View File

@@ -66,16 +66,16 @@ Hooks.once("init", async function () {
return new Handlebars.SafeString(objects.map((e) => `<textarea>${JSON.stringify(e)}</textarea>`));
});
Handlebars.registerHelper("localizeSkillCategory", function (skillName) {
const key = "l5r5e.skills." + skillName.toLowerCase() + ".title";
return game.i18n.localize(key);
});
// 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"') : "";
});
Handlebars.registerHelper("localizeSkillCategory", function (skillName) {
const key = "l5r5e.skills." + skillName.toLowerCase() + ".title";
return game.i18n.localize(key);
});
Handlebars.registerHelper("localizeSkill", function (skillCategory, skillName) {
const key = "l5r5e.skills." + skillCategory.toLowerCase() + "." + skillName.toLowerCase();
return game.i18n.localize(key);