Initialization

This commit is contained in:
Sebastian Fischlmayr 2022-09-14 12:16:36 +02:00
commit 3458f39973
Signed by: Maverick
GPG key ID: 6379E413924A4E77
28 changed files with 6780 additions and 0 deletions

View file

@ -0,0 +1,2 @@
include ./tabToggler.js
include ./extraTogglers.js

27
workers/extraTogglers.js Normal file
View file

@ -0,0 +1,27 @@
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
});
});
});

9
workers/tabToggler.js Normal file
View file

@ -0,0 +1,9 @@
const srTabs = ['main', 'skills', 'magic', 'enhancements', 'matrix', 'vehicles', 'equipment', 'character']
srTabs.forEach(tab => {
on(`clicked:${tab}`, () => {
setAttrs({
'sheetTab': tab
})
})
})