From 604a604c012251ead12f7d7c6d0afb2d425ecf80 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 19 Nov 2019 12:06:08 +1000 Subject: [PATCH] vbox selected more wip --- client/src/components/instance.constructs.jsx | 6 +++--- client/src/components/vbox.component.jsx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index 16870b9c..e7c848a2 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -26,7 +26,7 @@ const addState = connect( } = state; function sendVboxAcceptEquip(constructId) { - return ws.sendVboxAcceptEquip(instance.id, vboxSelected[0], vboxSelected[1], constructId); + return ws.sendVboxAcceptEquip(instance.id, vboxSelected[0][0], vboxSelected[0][1], constructId); } function sendVboxApply(constructId, i) { @@ -114,7 +114,7 @@ function Construct(props) { e.preventDefault(); if (duplicateSkill || tutorialDisableEquip) return true; if (itemEquip !== null) return sendVboxApply(construct.id, itemEquip); - if (vboxSelected[0]) return sendVboxAcceptEquip(construct.id); + if (vboxSelected.length === 1) return sendVboxAcceptEquip(construct.id); if (itemUnequip.length && itemUnequip[0] !== construct.id) return sendVboxUnequipApply(construct.id); setItemEquip(null); setItemUnequip([]); @@ -123,7 +123,7 @@ function Construct(props) { function hoverInfo(e, info) { e.stopPropagation(); if (!info) return false; - if (vboxSelected[0] || itemEquip > -1) return false; + if (vboxSelected.length || itemEquip > -1) return false; return setInfo(info); } diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index f80270a6..9fa63095 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -256,7 +256,9 @@ class Vbox extends preact.Component {