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