Skip to content

Commit

Permalink
feat(handlebars): added the IfInequals helper for inequals comparatio…
Browse files Browse the repository at this point in the history
…ns and fix the abilityTypeHelp

abilityTypeHelper now considers an argument like 3 a result for paranormal type
  • Loading branch information
SouOWendel committed Oct 27, 2023
1 parent 1fcb796 commit edc0780
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion module/ordemparanormal_fvtt.mjs
Expand Up @@ -138,10 +138,15 @@ Handlebars.registerHelper('ifEquals', function(arg1, arg2, options) {
return (arg1 == arg2) ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('ifInequals', function(arg1, arg2, options) {
// eslint-disable-next-line no-invalid-this
return (arg1 != arg2) ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('abilityTypeHelper', function(arg) {
if (arg == 1) return 'ability';
else if (arg == 2) return 'class';
return 'paranormal';
else if (arg == 3) return 'paranormal';
});

Handlebars.registerHelper('inputValid', function(arg1, arg2) {
Expand Down

0 comments on commit edc0780

Please sign in to comment.