fix: aligner les jets et la boîte de dialogue avec les règles

This commit is contained in:
2026-08-01 21:33:38 +02:00
parent 6ce51ed8cf
commit c87b25fbaf
5 changed files with 24 additions and 82 deletions
+11
View File
@@ -388,4 +388,15 @@ export const registerHandlebarsHelpers = function () {
Handlebars.registerHelper("setVar", function (varName, varValue, options) {
options.data.root[varName] = varValue;
});
// assign local variables in the current context (used by roll-message.hbs)
Handlebars.registerHelper("set", function (options) {
const ctx = (this && typeof this === "object") ? this : options.contexts?.[0];
if ( ctx && typeof ctx === "object" ) {
for ( const [key, value] of Object.entries(options.hash) ) {
ctx[key] = value;
}
}
return "";
});
}