vbox selected more wip
This commit is contained in:
parent
33152e54d5
commit
604a604c01
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user