From 4920821ec2a6e918a7441458ea16a48fba7f9345 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 28 Nov 2019 15:48:31 +1000 Subject: [PATCH] rm free and bound --- client/src/components/instance.constructs.jsx | 6 +- client/src/components/vbox.combiner.jsx | 2 +- client/src/components/vbox.component.jsx | 2 +- client/src/components/vbox.stash.jsx | 4 +- client/src/components/vbox.store.jsx | 10 ++-- client/src/components/vbox.utils.jsx | 16 +++--- client/src/tutorial.utils.jsx | 56 +++++++++---------- 7 files changed, 48 insertions(+), 48 deletions(-) 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.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 (