Initialization
This commit is contained in:
commit
3458f39973
28 changed files with 6780 additions and 0 deletions
2
workers/_worker-bundle.pug
Normal file
2
workers/_worker-bundle.pug
Normal file
|
@ -0,0 +1,2 @@
|
|||
include ./tabToggler.js
|
||||
include ./extraTogglers.js
|
27
workers/extraTogglers.js
Normal file
27
workers/extraTogglers.js
Normal 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
9
workers/tabToggler.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
const srTabs = ['main', 'skills', 'magic', 'enhancements', 'matrix', 'vehicles', 'equipment', 'character']
|
||||
|
||||
srTabs.forEach(tab => {
|
||||
on(`clicked:${tab}`, () => {
|
||||
setAttrs({
|
||||
'sheetTab': tab
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue