diff --git a/Pathfinder_EZ/pug/core/abilityScores.pug b/Pathfinder_EZ/pug/core/abilityScores.pug
index e8c3f2b553..828764d782 100644
--- a/Pathfinder_EZ/pug/core/abilityScores.pug
+++ b/Pathfinder_EZ/pug/core/abilityScores.pug
@@ -24,4 +24,3 @@ table.abilityScores
+abilityScoreRow('Intelligence', 'int')
+abilityScoreRow('Wisdom', 'wis')
+abilityScoreRow('Charisma', 'cha')
-// +labelledAbove('Ability Score Notes')(style='width: 100%;'): +textarea('appearance')(style='height: 0.6in;')
diff --git a/Pathfinder_EZ/pug/core/baseAttack.pug b/Pathfinder_EZ/pug/core/baseAttack.pug
index 9b6109b4cb..34a555f195 100644
--- a/Pathfinder_EZ/pug/core/baseAttack.pug
+++ b/Pathfinder_EZ/pug/core/baseAttack.pug
@@ -14,7 +14,7 @@
td: .mathOperator +
td: +readOnlyBox(abilityShortName + '_mod')(style='width: 0.25in;')
td: .mathOperator +
- td: +readOnlyBox('attack_size')(style='width: 0.25in;')
+ td: +readOnlyBox('size')(style='width: 0.25in;')
td: .mathOperator +
td: +fieldBox('number', attackName + '_equipment')
td: .mathOperator +
diff --git a/Pathfinder_EZ/pug/core/sizeSelect.pug b/Pathfinder_EZ/pug/core/sizeSelect.pug
index 24e04411fa..efd2f2e1da 100644
--- a/Pathfinder_EZ/pug/core/sizeSelect.pug
+++ b/Pathfinder_EZ/pug/core/sizeSelect.pug
@@ -1,10 +1,10 @@
+labelledUnderlined('Size')(style='width: 1.2in;'): +select('size')
- option(value=4) Colossal
- option(value=3) Gargantuan
- option(value=2) Huge
- option(value=1) Large
+ option(value=-8) Colossal
+ option(value=-4) Gargantuan
+ option(value=-2) Huge
+ option(value=-1) Large
option(value=0, selected=true) Medium
- option(value=-1) Small
- option(value=-2) Tiny
- option(value=-3) Diminuitive
- option(value=-4) Fine
+ option(value=1) Small
+ option(value=2) Tiny
+ option(value=4) Diminuitive
+ option(value=8) Fine
diff --git a/Pathfinder_EZ/pug/fields.pug b/Pathfinder_EZ/pug/fields.pug
index 0960e599b5..8b5eb83531 100644
--- a/Pathfinder_EZ/pug/fields.pug
+++ b/Pathfinder_EZ/pug/fields.pug
@@ -2,7 +2,7 @@ mixin fieldBox(type, name, label)
.fieldBox(style=attributes.style)
if(label)
label= label
- .inner: input(type=type, name='attr_' + name)
+ .inner: input(type=type, name='attr_' + name, value=attributes.value)
mixin fraction(name)
.fraction
@@ -11,7 +11,7 @@ mixin fraction(name)
input(type='number', name='attr_' + name + '_max')
mixin input(type, name)
- input(type=type, name='attr_' + name, placeholder=attributes.placeholder, style=attributes.style)
+ input(type=type, name='attr_' + name, placeholder=attributes.placeholder, style=attributes.style, value=attributes.value)
mixin labelledAbove(label)
.labelledAbove(style=attributes.style)
@@ -41,7 +41,8 @@ mixin option(view, value)
option(value=value)= view
mixin readOnlyBox(name)
- .readOnlyBox(style=attributes.style): span(name='attr_' + name) 0
+ .readOnlyBox(style=attributes.style): span(name='attr_' + name)
+ +input('number', name)(value='0', style='display:none;')
mixin repeating(name)
fieldset(class='repeating_' + name)
diff --git a/Pathfinder_EZ/pug/index.pug b/Pathfinder_EZ/pug/index.pug
index 83a9ec30fb..a1bbd710d3 100644
--- a/Pathfinder_EZ/pug/index.pug
+++ b/Pathfinder_EZ/pug/index.pug
@@ -1,6 +1,8 @@
include fields.pug
include tabs.pug
++input('text', 'debug')(value=' ', style='display: none;')
+
.top
.pfLogo
.topStats(style='margin-bottom: 1em;')
@@ -27,4 +29,7 @@ include tabs.pug
+tab('Magic', 'mainTabs')
include magic/index.pug
+tab('Notes', 'mainTabs')
- .test Notes
+ include notes/index.pug
+
+script(type='text/worker')
+ include ../worker_test.js
diff --git a/Pathfinder_EZ/pug/notes/index.pug b/Pathfinder_EZ/pug/notes/index.pug
new file mode 100644
index 0000000000..1097e9d696
--- /dev/null
+++ b/Pathfinder_EZ/pug/notes/index.pug
@@ -0,0 +1,2 @@
+.notesTab
+ +textarea('notes')(style='height: 6in;')
diff --git a/Pathfinder_EZ/sheet.html b/Pathfinder_EZ/sheet.html
index b9419dcd75..5583ed4e08 100644
--- a/Pathfinder_EZ/sheet.html
+++ b/Pathfinder_EZ/sheet.html
@@ -1,4 +1,5 @@
+
@@ -93,7 +94,8 @@
- 0
+
+
|
@@ -116,7 +118,8 @@
|
- 0
+
+
|
@@ -139,7 +142,8 @@
|
- 0
+
+
|
@@ -162,7 +166,8 @@
|
- 0
+
+
|
@@ -185,7 +190,8 @@
|
- 0
+
+
|
@@ -208,12 +214,12 @@
|
- 0
+
+
|
-
@@ -245,15 +251,15 @@
@@ -326,14 +332,16 @@
= 10 +
+
@@ -378,7 +386,8 @@
= 10 +
@@ -392,14 +401,16 @@
+
+
@@ -432,7 +443,8 @@
@@ -440,7 +452,8 @@
@@ -508,7 +521,8 @@
Constitution
- 0
+
+
|
=
@@ -524,7 +538,8 @@
+
|
- 0
+
+
|
+
@@ -571,7 +586,8 @@
Dexterity
|
- 0
+
+
|
=
@@ -587,7 +603,8 @@
+
|
- 0
+
+
|
+
@@ -634,7 +651,8 @@
Wisdom
|
- 0
+
+
|
=
@@ -650,7 +668,8 @@
+
|
- 0
+
+
|
+
@@ -733,25 +752,29 @@
Strength
|
- 0
+
+
|
=
|
- 0
+
+
|
+
|
- 0
+
+
|
+
|
- 0
+
+
|
+
@@ -798,25 +821,29 @@
Dexterity
|
- 0
+
+
|
=
|
- 0
+
+
|
+
|
- 0
+
+
|
+
|
- 0
+
+
|
+
@@ -870,28 +897,32 @@
=
+
+
+
@@ -923,35 +954,40 @@
= 10 +
+
+
+
+
@@ -1004,7 +1040,8 @@
=
@@ -1013,7 +1050,8 @@
+
@@ -1053,7 +1091,8 @@
=
@@ -1062,7 +1101,8 @@
+
@@ -1102,7 +1142,8 @@
=
@@ -1111,7 +1152,8 @@
+
@@ -1151,7 +1193,8 @@
=
@@ -1160,7 +1203,8 @@
+
@@ -1206,7 +1250,8 @@
=
@@ -1215,7 +1260,8 @@
+
@@ -1261,7 +1307,8 @@
=
@@ -1270,7 +1317,8 @@
+
@@ -1316,7 +1364,8 @@
=
@@ -1325,7 +1374,8 @@
+
@@ -1371,7 +1421,8 @@
=
@@ -1380,7 +1431,8 @@
+
@@ -1426,7 +1478,8 @@
=
@@ -1435,7 +1488,8 @@
+
@@ -1475,7 +1529,8 @@
=
@@ -1484,7 +1539,8 @@
+
@@ -1524,7 +1580,8 @@
=
@@ -1533,7 +1590,8 @@
+
@@ -1573,7 +1631,8 @@
=
@@ -1582,7 +1641,8 @@
+
@@ -1622,7 +1682,8 @@
=
@@ -1631,7 +1692,8 @@
+
@@ -1671,7 +1733,8 @@
=
@@ -1680,7 +1743,8 @@
+
@@ -1720,7 +1784,8 @@
=
@@ -1729,7 +1794,8 @@
+
@@ -1769,7 +1835,8 @@
=
@@ -1778,7 +1845,8 @@
+
@@ -1818,7 +1886,8 @@
=
@@ -1827,7 +1896,8 @@
+
@@ -1867,7 +1937,8 @@
=
@@ -1876,7 +1947,8 @@
+
@@ -1916,7 +1988,8 @@
=
@@ -1925,7 +1998,8 @@
+
@@ -1965,7 +2039,8 @@
=
@@ -1974,7 +2049,8 @@
+
@@ -2014,7 +2090,8 @@
=
@@ -2023,7 +2100,8 @@
+
@@ -2063,7 +2141,8 @@
=
@@ -2072,7 +2151,8 @@
+
@@ -2112,7 +2192,8 @@
=
@@ -2121,7 +2202,8 @@
+
@@ -2161,7 +2243,8 @@
=
@@ -2170,7 +2253,8 @@
+
@@ -2210,7 +2294,8 @@
=
@@ -2219,7 +2304,8 @@
+
@@ -2259,7 +2345,8 @@
=
@@ -2268,7 +2355,8 @@
+
@@ -2308,7 +2396,8 @@
=
@@ -2317,7 +2406,8 @@
+
@@ -2357,7 +2447,8 @@
=
@@ -2366,7 +2457,8 @@
+
@@ -2406,7 +2498,8 @@
=
@@ -2415,7 +2508,8 @@
+
@@ -2461,7 +2555,8 @@
=
@@ -2470,7 +2565,8 @@
+
@@ -2516,7 +2612,8 @@
=
@@ -2525,7 +2622,8 @@
+
@@ -2571,7 +2669,8 @@
=
@@ -2580,7 +2679,8 @@
+
@@ -2626,7 +2726,8 @@
=
@@ -2635,7 +2736,8 @@
+
@@ -2681,7 +2783,8 @@
=
@@ -2690,7 +2793,8 @@
+
@@ -2736,7 +2840,8 @@
=
@@ -2745,7 +2850,8 @@
+
@@ -2791,7 +2897,8 @@
=
@@ -2800,7 +2907,8 @@
+
@@ -2846,7 +2954,8 @@
=
@@ -2855,7 +2964,8 @@
+
@@ -2901,7 +3011,8 @@
=
@@ -2910,7 +3021,8 @@
+
@@ -2956,7 +3068,8 @@
=
@@ -2965,7 +3078,8 @@
+
@@ -3005,7 +3119,8 @@
=
@@ -3014,7 +3129,8 @@
+
@@ -3054,7 +3170,8 @@
=
@@ -3063,7 +3180,8 @@
+
@@ -3103,7 +3221,8 @@
=
@@ -3112,7 +3231,8 @@
+
@@ -3152,7 +3272,8 @@
=
@@ -3161,7 +3282,8 @@
+
@@ -3201,7 +3323,8 @@
=
@@ -3210,7 +3333,8 @@
+
@@ -3250,7 +3374,8 @@
=
@@ -3259,7 +3384,8 @@
+
@@ -3299,7 +3425,8 @@
=
@@ -3308,7 +3435,8 @@
+
@@ -3348,7 +3476,8 @@
=
@@ -3357,7 +3486,8 @@
+
@@ -3648,14 +3778,16 @@
= 10 +
+
@@ -3695,7 +3827,8 @@
@@ -3727,7 +3860,8 @@
@@ -3759,7 +3893,8 @@
@@ -3791,7 +3926,8 @@
@@ -3823,7 +3959,8 @@
@@ -3857,7 +3994,8 @@
@@ -3889,7 +4027,8 @@
@@ -3921,7 +4060,8 @@
@@ -3953,7 +4093,8 @@
@@ -3985,7 +4126,8 @@
@@ -4021,7 +4163,50 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/Pathfinder_EZ/worker.js b/Pathfinder_EZ/worker.js
new file mode 100644
index 0000000000..530f0dd702
--- /dev/null
+++ b/Pathfinder_EZ/worker.js
@@ -0,0 +1,113 @@
+(() => {
+ 'use strict';
+
+ function _debug(msg) {
+ return _setAttrs({
+ debug: msg
+ });
+ }
+
+ /**
+ * Promise-wrapped getAttrs.
+ */
+ function _getAttrs(attrs) {
+ return new Promise((resolve, reject) => {
+ getAttrs(attrs, resolve);
+ });
+ }
+
+ /**
+ * Promise-wrapped getSectionIDs.
+ */
+ function _getSectionIds(sectionName) {
+ return new Promise((resolve, reject) => {
+ getSectionIDs(sectionName, resolve);
+ });
+ }
+
+ function _onChange(attrNames, cb) {
+ let list = _.chain(attrNames)
+ .map(name => {
+ return 'change:' + name
+ })
+ .value();
+
+ on(list.join(' '), cb);
+ }
+
+ /**
+ * Promise-wrapped setAttrs.
+ */
+ function _setAttrs(values) {
+ return new Promise((resolve, reject) => {
+ log(values);
+ setAttrs(values, undefined, resolve);
+ });
+ }
+
+ function updateAbilityMod(abilityName) {
+ return _getAttrs([abilityName, abilityName + '_temp'])
+ .then(values => {
+ let base = values[abilityName];
+ let temp = values[abilityName + '_temp'];
+ return _setAttrs({
+ [abilityName] + '_mod': Math.floor((base + temp - 10)/2)
+ }});
+ });
+ }
+
+ function updateChaMod() {
+ return updateAbilityMod('cha');
+ }
+
+ function updateConMod() {
+ return updateAbilityMod('con');
+ }
+
+ function updateDexMod() {
+ return updateAbilityMod('dex');
+ }
+
+ function updateIntMod() {
+ return updateAbilityMod('int');
+ }
+
+ function updateStrMod() {
+ return updateAbilityMod('str');
+ }
+
+ function updateWisMod() {
+ return updateAbilityMod('wis');
+ }
+
+
+
+ _onChange(['cha', 'cha_temp'], () => {
+ return updateChaMod();
+ });
+
+ _onChange(['con', 'con_temp'], () => {
+ return updateConMod();
+ });
+
+ _onChange(['dex', 'dex_temp'], () => {
+ return updateDexMod();
+ });
+
+ _onChange(['int', 'int_temp'], () => {
+ return updateIntMod();
+ });
+
+ _onChange(['str', 'str_temp'], () => {
+ return updateStrMod();
+ });
+
+ _onChange(['wis', 'wis_temp'], () => {
+ return updateWisMod();
+ });
+
+
+ on('sheet:opened', () => {
+ updateAll();
+ });
+})();
diff --git a/Pathfinder_EZ/worker_test.js b/Pathfinder_EZ/worker_test.js
new file mode 100644
index 0000000000..2d40531e94
--- /dev/null
+++ b/Pathfinder_EZ/worker_test.js
@@ -0,0 +1,39 @@
+(() => {
+ 'use strict';
+
+ /**
+ * Promise-wrapped getAttrs.
+ */
+ function _getAttrs(attrs) {
+ return new Promise((resolve, reject) => {
+ getAttrs(attrs, resolve);
+ });
+ }
+
+ /**
+ * Promise-wrapped setAttrs.
+ */
+ function _setAttrs(values) {
+ return new Promise(resolve, reject => {
+ setAttrs(values, undefined, () => {
+ resolve();
+ });
+ });
+ }
+
+ on('sheet:opened', () => {
+ (new Promise((resolve, reject) => {
+ resolve(42);
+ }))
+ .then(value => {
+ return _setAttrs({
+ debug: value
+ });
+ })
+ .then(() => {
+ setAttrs({
+ debug: 11
+ });
+ });
+ });
+})();
|