diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index c0a0b36d..3ed752b7 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -98,7 +98,7 @@ function Construct(props) { const duplicateSkill = construct.skills.length !== 0 && construct.skills.every(sk => { if (!itemEquip && itemEquip !== 0) return false; if (!sk) return false; - return sk.skill === vbox.bound[itemEquip]; + return sk.skill === vbox.stash[itemEquip]; }); const tutorialDisableEquip = tutorialShouldDisableEquip(tutorial, iter, instance, construct); function onClick(e) { @@ -136,7 +136,7 @@ function Construct(props) { return true; } - const equipping = skillList.includes(vbox.bound[itemEquip]) && !skill + const equipping = skillList.includes(vbox.stash[itemEquip]) && !skill && !tutorialDisableEquip && !duplicateSkill && i === construct.skills.length; const border = () => { if (!skill) return ''; @@ -169,7 +169,7 @@ function Construct(props) { const s = construct.specs[i]; if (!s) { - const equipping = specList.includes(vbox.bound[itemEquip]) && i === construct.specs.length; + const equipping = specList.includes(vbox.stash[itemEquip]) && i === construct.specs.length; const classes = `${equipping ? 'equipping' : 'gray'} empty`; return ( diff --git a/client/src/components/vbox.combiner.jsx b/client/src/components/vbox.combiner.jsx index 2767b956..515db398 100644 --- a/client/src/components/vbox.combiner.jsx +++ b/client/src/components/vbox.combiner.jsx @@ -48,7 +48,7 @@ class Combiner extends preact.Component { class='combiner vbox-btn' onClick={e => e.stopPropagation()} onMouseDown={vboxBuySelected}> - {`Buy ${vbox.free[item[0]][item[1]]} ${item[0] + 1}b`} + {`Buy ${vbox.store[item[0]][item[1]]} ${item[0] + 1}b`} ); } diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index f00e9b63..9d192b9c 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -161,7 +161,7 @@ class Vbox extends preact.Component { function stashHdr() { const refund = storeSelect.length === 0 && stashSelect.length === 1 - ? itemInfo.items.find(i => i.item === vbox.bound[stashSelect[0]]).cost + ? itemInfo.items.find(i => i.item === vbox.stash[stashSelect[0]]).cost : 0; const tutorialDisabled = tutorial && tutorial < 8 && instance.time_control === 'Practice' && instance.rounds.length === 1; diff --git a/client/src/components/vbox.stash.jsx b/client/src/components/vbox.stash.jsx index 97511443..cec94686 100644 --- a/client/src/components/vbox.stash.jsx +++ b/client/src/components/vbox.stash.jsx @@ -81,7 +81,7 @@ class stashElement extends preact.Component { } if (notValidCombo) { - setInfo(vbox.bound[i]); + setInfo(vbox.stash[i]); return setVboxSelected({ storeSelect: [], stashSelect: [i] }); } @@ -123,7 +123,7 @@ class stashElement extends preact.Component { onDragOver={ev => ev.preventDefault()} onDrop={stashClick} > - {range(0, 6).map(i => stashBtn(vbox.bound[i], i))} + {range(0, 6).map(i => stashBtn(vbox.stash[i], i.toString()))} ); } diff --git a/client/src/components/vbox.store.jsx b/client/src/components/vbox.store.jsx index 9a168fc6..f4d1878c 100644 --- a/client/src/components/vbox.store.jsx +++ b/client/src/components/vbox.store.jsx @@ -32,7 +32,7 @@ class storeElement extends preact.Component { const { storeSelect, stashSelect } = vboxSelected; function availableBtn(v, group, index) { - if (!v) return ; + if (!v) return ; const selected = storeSelect.length && storeSelect.some(vs => vs[0] === group && vs[1] === index); const notValidCombo = vboxHighlight && !vboxHighlight.includes(v); @@ -63,7 +63,7 @@ class storeElement extends preact.Component { const disabled = vbox.bits <= group; return ( e.stopPropagation()}> - {range(0, 6).map(i => availableBtn(vbox.free[0][i], 0, i))} + {range(0, 6).map(i => availableBtn(vbox.store['Colours'][i], 'Colours', i.toString()))} - {range(0, 3).map(i => availableBtn(vbox.free[1][i], 1, i))} - {range(0, 3).map(i => availableBtn(vbox.free[2][i], 2, i))} + {range(0, 3).map(i => availableBtn(vbox.store['Skills'][i], 'Skills', i.toString()))} + {range(0, 3).map(i => availableBtn(vbox.store['Specs'][i], 'Specs', i.toString()))} ); diff --git a/client/src/components/vbox.utils.jsx b/client/src/components/vbox.utils.jsx index 2069d66d..e40a0b2e 100644 --- a/client/src/components/vbox.utils.jsx +++ b/client/src/components/vbox.utils.jsx @@ -23,8 +23,8 @@ function setVboxState(dispatch, vboxSelected, state) { if (!(storeSelect.length === 0 && stashSelect.length === 0)) { vboxHighlight = []; - const stashItems = stashSelect.map(j => vbox.bound[j]); - const shopItems = storeSelect.map(j => vbox.free[j[0]][j[1]]); + const stashItems = stashSelect.map(j => vbox.stash[j]); + const shopItems = storeSelect.map(j => vbox.store[j[0]][j[1]]); const selectedItems = stashItems.concat(shopItems); const itemCount = countBy(selectedItems, co => co); @@ -55,12 +55,12 @@ function setVboxState(dispatch, vboxSelected, state) { const vboxInfo = () => { if (vboxCombiner) return vboxCombiner; if (itemUnequip.length) return itemUnequip[1]; - const stashBase = stashSelect.find(i => !(['Red', 'Blue', 'Green'].includes(vbox.bound[i]))); - if (stashBase > -1) return vbox.bound[stashBase]; - const storeBase = storeSelect.find(j => !(['Red', 'Blue', 'Green'].includes(vbox.free[j[0]][j[1]]))); - if (storeBase) return vbox.free[storeBase[0]][storeBase[1]]; - if (stashSelect.length > 0) return vbox.bound[stashSelect[0]]; - if (storeSelect.length > 0) return vbox.free[storeSelect[0][0]][storeSelect[0][1]]; + const stashBase = stashSelect.find(i => !(['Red', 'Blue', 'Green'].includes(vbox.stash[i]))); + if (stashBase > -1) return vbox.stash[stashBase]; + const storeBase = storeSelect.find(j => !(['Red', 'Blue', 'Green'].includes(vbox.store[j[0]][j[1]]))); + if (storeBase) return vbox.store[storeBase[0]][storeBase[1]]; + if (stashSelect.length > 0) return vbox.stash[stashSelect[0]]; + if (storeSelect.length > 0) return vbox.store[storeSelect[0][0]][storeSelect[0][1]]; return false; }; diff --git a/client/src/tutorial.utils.jsx b/client/src/tutorial.utils.jsx index 05fedee5..e60974f4 100644 --- a/client/src/tutorial.utils.jsx +++ b/client/src/tutorial.utils.jsx @@ -24,21 +24,21 @@ function tutorialVbox(player, store, tutorial) { if (vbox.bits < 29) { stage += 1; } else { - vbox.free[0] = vbox.free[0].slice(0, 2); - vbox.free[1] = []; - vbox.free[2] = []; - vbox.bound.fill(null, 0, 3); + vbox.store[0] = vbox.store[0].slice(0, 2); + vbox.store[1] = []; + vbox.store[2] = []; + vbox.stash.fill(null, 0, 3); } } if (stage === 2) { - if (!(vbox.bound.slice(0, 3).every(i => i === 'Attack') && vbox.bound.length >= 3)) { + if (!(vbox.stash.slice(0, 3).every(i => i === 'Attack') && vbox.stash.length >= 3)) { stage += 1; } else { - vbox.free[0] = vbox.free[0].slice(0, 2); - vbox.free[1] = []; - vbox.free[2] = []; - vbox.bound.fill(null, 1, 3); + vbox.store[0] = vbox.store[0].slice(0, 2); + vbox.store[1] = []; + vbox.store[2] = []; + vbox.stash.fill(null, 1, 3); } } @@ -46,21 +46,21 @@ function tutorialVbox(player, store, tutorial) { if (player.constructs[0].skills.length !== 0) { stage += 1; } else { - vbox.free[0] = vbox.free[0].slice(0, 2); - vbox.free[1] = []; - vbox.free[2] = []; - vbox.bound.fill(null, 0, 2); + vbox.store[0] = vbox.store[0].slice(0, 2); + vbox.store[1] = []; + vbox.store[2] = []; + vbox.stash.fill(null, 0, 2); } } if (stage === 4) { - if (!vbox.free[2][0] || vbox.bits < 24) { + if (!vbox.store[2][0] || vbox.bits < 24) { stage += 1; } else { - vbox.free[0] = []; - vbox.free[1] = []; - vbox.free[2] = vbox.free[2].slice(0, 1); - vbox.bound.fill(null, 0, 2); + vbox.store[0] = []; + vbox.store[1] = []; + vbox.store[2] = vbox.store[2].slice(0, 1); + vbox.stash.fill(null, 0, 2); } } @@ -68,10 +68,10 @@ function tutorialVbox(player, store, tutorial) { if (player.constructs[0].specs.length !== 0) { stage += 1; } else { - vbox.free[0] = []; - vbox.free[1] = []; - vbox.free[2] = vbox.free[2].slice(0, 1); - vbox.bound.fill(null, 0, 2); + vbox.store[0] = []; + vbox.store[1] = []; + vbox.store[2] = vbox.store[2].slice(0, 1); + vbox.stash.fill(null, 0, 2); } } @@ -79,9 +79,9 @@ function tutorialVbox(player, store, tutorial) { if (player.constructs.every(c => c.skills.length !== 0)) { stage += 1; } else { - vbox.free[0] = []; - vbox.free[1] = []; - vbox.free[2] = []; + vbox.store[0] = []; + vbox.store[1] = []; + vbox.store[2] = []; } } @@ -89,9 +89,9 @@ function tutorialVbox(player, store, tutorial) { if (vbox.bits < 25) { stage += 1; } else { - vbox.free[0] = []; - vbox.free[1] = []; - vbox.free[2] = []; + vbox.store[0] = []; + vbox.store[1] = []; + vbox.store[2] = []; } } store.dispatch(actions.setTutorial(stage));