diff --git a/Blades in the Dark/Source/sheetworkers.js b/Blades in the Dark/Source/sheetworkers.js index 77ad8f6d2b..ea38f33807 100644 --- a/Blades in the Dark/Source/sheetworkers.js +++ b/Blades in the Dark/Source/sheetworkers.js @@ -1538,9 +1538,9 @@ const crewAttributes = [...new Set([].concat(...Object.keys(crewData).map(x => O /* EVENT HANDLERS */ /* Set default fields when setting crew type or playbook */ on('change:crew_type change:playbook', event => { - getAttrs(['changed_attributes', 'setting_autofill', ...watchedAttributes], v => { + getAttrs(['playbook', 'crew_type', 'changed_attributes', 'setting_autofill', ...watchedAttributes], v => { const changedAttributes = (v.changed_attributes || '').split(','), - sourceName = event.newValue.toLowerCase(), + sourceName = (event.sourceAttribute === 'crew_type' ? v.crew_type : v.playbook).toLowerCase(), fillBaseData = (data, defaultAttrNames) => { if (data) { const finalSettings = defaultAttrNames.filter(name => !changedAttributes.includes(name)) @@ -1558,7 +1558,7 @@ on('change:crew_type change:playbook', event => { mySetAttrs(finalSettings); } }; - if (event.newValue) { + if (sourceName) { setAttr('show_playbook_reminder', '0'); } if (v.setting_autofill !== '1') return; @@ -1733,9 +1733,12 @@ on('change:setting_consequence_query sheet:opened', () => { /* Trim whitespace in auto-expand fields */ autoExpandFields.forEach(name => { on(`change:${name}`, event => { - if (event.newValue.trim() !== event.newValue && event.sourceType === 'player') { - setAttr(name.replace(':', '_'), event.newValue.trim()); - } + const attrName = name.replace(':', '_'); + getAttrs([attrName], v => { + if (v[attrName].trim() !== v[attrName] && event.sourceType === 'player') { + setAttr(attrName, v[attrName].trim()); + } + }); }); }); /* INITIALISATION AND UPGRADES */ diff --git a/Blades in the Dark/blades.html b/Blades in the Dark/blades.html index 3c6117c0d3..8b64b56c7c 100644 --- a/Blades in the Dark/blades.html +++ b/Blades in the Dark/blades.html @@ -1,5 +1,5 @@































{{/title-insight}}{{#title-prowess}}
{{/title-prowess}}{{#title-resolve}}
{{/title-resolve}}{{#title-hunt}}
{{/title-hunt}}{{#title-study}}
{{/title-study}}{{#title-survey}}
{{/title-survey}}{{#title-tinker}}
{{/title-tinker}}{{#title-finesse}}
{{/title-finesse}}{{#title-prowl}}
{{/title-prowl}}{{#title-skirmish}}
{{/title-skirmish}}{{#title-wreck}}
{{/title-wreck}}{{#title-attune}}
{{/title-attune}}{{#title-command}}
{{/title-command}}{{#title-consort}}
{{/title-consort}}{{#title-sway}}
{{/title-sway}}{{#title-fortune}}
{{/title-fortune}}{{#title-vice}}
{{/title-vice}}{{#title-crew_tier}}
{{/title-crew_tier}}{{#title-entanglement}}
{{/title-entanglement}}{{#title-cohort_quality}}
{{/title-cohort_quality}}{{#title-lifestyle}}
{{/title-lifestyle}}{{#title-recovery}}
{{/title-recovery}}{{#title-engagement}}
{{/title-engagement}}{{/title-text}}
{{/title-text}}| 3 | {{#harm3}} {{harm3}} {{/harm3}} | Need help |
| 2 | {{#harm2_1}} {{harm2_1}} {{/harm2_1}}{{#harm2_2}}{{harm2_2}} {{/harm2_2}} | -1D |
| 1 | {{#harm1_1}} {{harm1_1}} {{/harm1_1}}{{#harm1_2}}{{harm1_2}} {{/harm1_2}} | Less Effect |