Files
roll20-character-sheets/Crossed-Fates/source/app/workers/scripts/pages.js
T
2021-06-01 14:47:53 -05:00

44 lines
994 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
on('change:page_button', function(eventinfo) {
setAttrs({
page: eventinfo.newValue
});
console.log({page: eventinfo.newValue});
});
on('change:act_page_button', function(eventinfo) {
setAttrs({
act_page: eventinfo.newValue
});
console.log({act_page: eventinfo.newValue});
});
on('change:mode_button', function(eventinfo) {
setAttrs({
mode: eventinfo.newValue,
modes_choice: 'off'
});
});
on('change:stat_mode_button', function(eventinfo) {
setAttrs({
stat_mode: eventinfo.newValue,
});
});
on('change:left_side change:right_side', function(eventinfo) {
setAttrs({
character_name: eventinfo.newValue,
});
});
// update character sheet name
on('sheet:opened change:left_side change:right_side', function() {
getAttrs(['left_side', 'right_side'], function(values) {
const name = values.left_side + ' × ' + values.right_side;
updateAttrs = { character_name: name };
setAttrs(updateAttrs);
console.log(updateAttrs);
});
});