Scum & Villainy: Revert item_0 changes

This commit is contained in:
joesinghaus
2018-02-21 09:53:23 +01:00
parent ba80b503d7
commit 4e2ea2466e
+15 -15
View File
@@ -111,7 +111,7 @@
<span>Number of stress boxes</span></div>
<div class="sheet-col50 sheet-setting-character"><input type="checkbox" name="attr_setting_extra_trauma" value="1" class="sheet-checkbox"/><span></span><span>Show an extra trauma box</span></div>
<div class="sheet-col50 sheet-setting-character sheet-setting-ship"><input type="checkbox" name="attr_setting_extra_xp" value="1" class="sheet-checkbox"/><span></span><span>Show an extra xp condition</span></div>
<div class="sheet-col100 sheet-setting-character"><input type="checkbox" class="sheet-checkbox" name="attr_setting_showitem0" value="1"/><span></span><span>Show special item with optional second box</span></div>
<div class="sheet-col100 sheet-setting-character"><input type="checkbox" class="sheet-checkbox" name="attr_setting_showitem_0" value="1"/><span></span><span>Show special item with optional second box</span></div>
<div class="sheet-col100 sheet-setting-character"><input type="checkbox" class="sheet-checkbox" name="attr_setting_specialarmor2" value="1"/><span></span><span>Show another special armor checkbox</span></div>
<div class="sheet-col100 sheet-settings-load sheet-setting-character">
<span>Resistance bonus:</span>
@@ -430,14 +430,14 @@
<div class="sheet-itemholder sheet-white-repcontrol sheet-items">
<!-- PLAYBOOK ITEMS -->
<div class="sheet-playbookitems">
<input type="checkbox" class="sheet-hidden sheet-hidediv" name="attr_setting_showitem0" value="1">
<input type="checkbox" class="sheet-hidden sheet-hidediv" name="attr_setting_showitem_0" value="1">
<div class="sheet-item sheet-itembold">
<input class="sheet-checkbox" type="checkbox" name="attr_item0_check1" value="1"/><span></span>
<input class="sheet-checkbox" type="checkbox" name="attr_item_0_check1" value="1"/><span></span>
<div class="sheet-auto-expand sheet-itemname">
<span name="attr_item0_name"></span>
<textarea spellcheck="false" name="attr_item0_name" placeholder="A fine item (or pair)"></textarea>
<span name="attr_item_0_name"></span>
<textarea spellcheck="false" name="attr_item_0_name" placeholder="A fine item (or pair)"></textarea>
</div>
<input class="sheet-checkbox" type="checkbox" name="attr_item0_check2" value="1"/><span></span>
<input class="sheet-checkbox" type="checkbox" name="attr_item_0_check2" value="1"/><span></span>
</div>
<fieldset class="repeating_playbookitem">
<input class="sheet-hidden sheet-boxes-chosen" type="checkbox" name="attr_boxes_chosen" value="1"/>
@@ -1834,9 +1834,9 @@
ability0_name: 'Serendipitous',
ability0_description: 'Your crew starts with +1 gambit when the pool resets.',
friend_adjective: '"Friends"',
item0_name: 'Fine Sidearm (or Pair)',
item_0_name: 'Fine Sidearm (or Pair)',
playbook_description: 'scrappy survivor\nwith more luck \nthan brains',
setting_showitem0: '1',
setting_showitem_0: '1',
skulk: '1',
sway: '2',
xp_condition: 'You addressed a tough challenge with charm or audacity.'
@@ -2256,7 +2256,7 @@
'repeating_upgrade:name',
'ability0_name',
'ability0_description',
'item0_name',
'item_0_name',
'heritage',
'background',
'vice_purveyor',
@@ -2389,7 +2389,7 @@
});
});
/* Left-filling checkboxes */
['repeating_playbookitem:check', 'repeating_item:check', 'item0_check', 'upgrade_5_check',
['repeating_playbookitem:check', 'repeating_item:check', 'item_0_check', 'upgrade_5_check',
'item_3_check', 'item_7_check', 'item_12_check', 'item_13_check'].forEach(name => handleBoxesFill(name));
handleBoxesFill('repeating_upgrade:check', true);
/* Resistance query */
@@ -2470,12 +2470,12 @@
// Fix defective old attribute names
if (v.sys1_mod_3check === 'on') setting.sys1_mod_3_check = '1';
if (v.sys3_mod_3check === 'on') setting.sys3_mod_3_check = '1';
// Manage old item3, new item0
// Manage old item3, new item_0
if (v[`item_3_desc`]) {
setting.item0_name = v[`item_3_desc`];
setting.showitem0 = '1';
if (v[`item_3_check`] === 'on') setting.item0_check1 = '1';
if (v[`item_3_check_b`] === 'on') setting.item0_check2 = '1';
setting.item_0_name = v[`item_3_desc`];
setting.showitem_0 = '1';
if (v[`item_3_check`] === 'on') setting.item_0_check1 = '1';
if (v[`item_3_check_b`] === 'on') setting.item_0_check2 = '1';
}
// put old data into repeating sections
const playbookitemData = [1,2, ...[...Array(14).keys()].map(x => x+4)].reduce((m, num) => {