SR6_Roll20_Sheet/workers/extraTogglers.js
2022-09-14 12:16:36 +02:00

27 lines
690 B
JavaScript

on("clicked:togedge", function() {
getAttrs(["edgeroll","gmroll"], function(values) {
let currentVal = values.edgeroll ?? "";
let newVal = "";
if (currentVal === "") {
newVal = "!/";
}
console.log("Setting Edge Value to: " + newVal);
setAttrs({
"edgeroll": newVal
});
});
});
on("clicked:toggmroll", function() {
getAttrs(["gmroll","edgeroll"], function(values) {
let currentVal = values.gmroll ?? "";
let newVal = "";
if (currentVal === "") {
newVal = "/w gm ";
}
console.log("Setting GM roll Value to: " + newVal);
setAttrs({
"gmroll": newVal
});
});
});