vbox selected more wip

This commit is contained in:
Mashy 2019-11-19 12:06:08 +10:00
parent 33152e54d5
commit 604a604c01
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -256,7 +256,9 @@ class Vbox extends preact.Component {
<button
class='vbox-btn'
onMouseOver={e => hoverInfo(e, 'refill')}
disabled={tutorial && tutorial < 7 && instance.time_control === 'Practice' && instance.rounds.length === 1}
disabled={vbox.bits < 2
|| tutorial && tutorial < 7 && instance.time_control === 'Practice' && instance.rounds.length === 1
}
onClick={e => e.stopPropagation()}
onMouseDown={() => sendVboxDiscard()}>
refill - 2b