- Force number of dice to be 2 - 9 if manually typed in

This commit is contained in:
Simon Brooke
2026-02-05 10:37:04 +00:00
parent a3b756ce19
commit bf2f72ecf6
+20
View File
@@ -1007,5 +1007,25 @@
setAttrs({lastroll: ""});
});
/*
*
*/
on("change:num_dice", function(e) {
console.log("change:num_dice: " + JSON.stringify(e));
let attrs;
if(+e.newValue < 2) {
attrs = {num_dice: 2};
}
if(+e.newValue > 9) {
attrs = {num_dice: 9};
}
if(attrs) {
setAttrs(attrs);
}
});
</script>
</div>