clear selected items on new selections, reclaim doesn't turn combine red
This commit is contained in:
parent
5c0a76b9a6
commit
73b6d0f321
@ -63,10 +63,14 @@ const addState = connect(
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setCombiner(c) {
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
return dispatch(actions.setCombiner(c));
|
||||
}
|
||||
|
||||
function setReclaiming(v) {
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
dispatch(actions.setCombiner([]));
|
||||
dispatch(actions.setVboxSelected([]));
|
||||
return dispatch(actions.setReclaiming(v));
|
||||
}
|
||||
|
||||
@ -75,6 +79,7 @@ const addState = connect(
|
||||
}
|
||||
|
||||
function setVboxSelected(v) {
|
||||
dispatch(actions.setItemUnequip([]));
|
||||
return dispatch(actions.setVboxSelected(v));
|
||||
}
|
||||
|
||||
@ -237,7 +242,6 @@ class Vbox extends preact.Component {
|
||||
function vboxElement() {
|
||||
return (
|
||||
<div class='vbox-vbox'
|
||||
onMouseDown={() => setReclaiming(false)}
|
||||
onClick={e => e.stopPropagation()}>
|
||||
<div class="vbox-hdr">
|
||||
<h3
|
||||
@ -275,8 +279,6 @@ class Vbox extends preact.Component {
|
||||
return setReclaiming(!reclaiming);
|
||||
}
|
||||
|
||||
const inventoryClass = `vbox-section ${reclaiming ? 'reclaiming' : ''}`;
|
||||
|
||||
function inventoryBtn(v, i) {
|
||||
const inventoryHighlight = vboxSelecting || itemUnequip.length;
|
||||
|
||||
@ -393,21 +395,20 @@ class Vbox extends preact.Component {
|
||||
function inventoryElement() {
|
||||
function inventoryClick(e) {
|
||||
e.stopPropagation();
|
||||
setReclaiming(false);
|
||||
if (vboxSelecting) return vboxBuySelected();
|
||||
if (itemUnequip.length) return sendItemUnequip(itemUnequip);
|
||||
return true;
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={inventoryClass}
|
||||
<div
|
||||
onMouseDown={inventoryClick}
|
||||
onClick={e => e.stopPropagation()}
|
||||
style={vboxSelecting || (itemUnequip.length) ? { cursor: 'pointer' } : null}
|
||||
onDragOver={ev => ev.preventDefault()}
|
||||
onDrop={inventoryClick}
|
||||
>
|
||||
<div class="vbox-hdr">
|
||||
<div class={`vbox-hdr ${reclaiming ? 'reclaiming' : ''}`}>
|
||||
<h3
|
||||
onTouchStart={e => e.target.scrollIntoView(true)}
|
||||
onMouseOver={e => hoverInfo(e, 'inventory')}> INVENTORY
|
||||
@ -421,7 +422,8 @@ class Vbox extends preact.Component {
|
||||
reclaim
|
||||
</button>
|
||||
</div>
|
||||
<div class='vbox-items'>
|
||||
|
||||
<div class={`vbox-items ${reclaiming ? 'reclaiming' : ''}`}>
|
||||
{range(0, 9).map(i => inventoryBtn(vbox.bound[i], i))}
|
||||
</div>
|
||||
{combinerBtn()}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user