don't clear vbox selected on inventory click

This commit is contained in:
Mashy 2019-11-19 23:11:18 +10:00
parent 55f0ceeeec
commit 52d9367e3c

View File

@ -283,7 +283,11 @@ class Vbox extends preact.Component {
const inventoryHighlight = vboxSelecting || itemUnequip.length; const inventoryHighlight = vboxSelecting || itemUnequip.length;
if (!v && v !== 0) { if (!v && v !== 0) {
return <button key={i} disabled={!inventoryHighlight} class={inventoryHighlight ? 'receiving' : 'empty'} >&nbsp;</button>; const emptyInvClick = () => {
if (vboxSelecting) return vboxBuySelected();
return false;
};
return <button key={i} onClick={emptyInvClick} disabled={!inventoryHighlight} class={inventoryHighlight ? 'receiving' : 'empty'} >&nbsp;</button>;
} }
const combinerItems = combiner.map(j => vbox.bound[j]); const combinerItems = combiner.map(j => vbox.bound[j]);
@ -303,7 +307,6 @@ class Vbox extends preact.Component {
const comboHighlight = combinerItems.length > 0 && comboItem ? 'combo-border' : ''; const comboHighlight = combinerItems.length > 0 && comboItem ? 'combo-border' : '';
function onClick(type) { function onClick(type) {
if (vboxSelecting) clearVboxSelected();
if (reclaiming) return sendVboxReclaim(i); if (reclaiming) return sendVboxReclaim(i);
const combinerContainsIndex = combiner.indexOf(i) > -1; const combinerContainsIndex = combiner.indexOf(i) > -1;
@ -395,7 +398,6 @@ class Vbox extends preact.Component {
function inventoryElement() { function inventoryElement() {
function inventoryClick(e) { function inventoryClick(e) {
e.stopPropagation(); e.stopPropagation();
if (vboxSelecting) return vboxBuySelected();
if (itemUnequip.length) return sendItemUnequip(itemUnequip); if (itemUnequip.length) return sendItemUnequip(itemUnequip);
return true; return true;
} }