better vbox touches
This commit is contained in:
parent
db377ff7b2
commit
60d9ea5198
@ -192,6 +192,7 @@ function Vbox(args) {
|
|||||||
|
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setCombiner([]);
|
||||||
if (selected) return clearVboxSelected();
|
if (selected) return clearVboxSelected();
|
||||||
return setVboxSelected([group, index]);
|
return setVboxSelected([group, index]);
|
||||||
}
|
}
|
||||||
@ -204,6 +205,7 @@ function Vbox(args) {
|
|||||||
class={classes}
|
class={classes}
|
||||||
onMouseOver={e => vboxHover(e, v)}
|
onMouseOver={e => vboxHover(e, v)}
|
||||||
onMouseDown={onClick}
|
onMouseDown={onClick}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onDblClick={onDblClick} >
|
onDblClick={onDblClick} >
|
||||||
{shapes[v]()}
|
{shapes[v]()}
|
||||||
</button>
|
</button>
|
||||||
@ -214,6 +216,7 @@ function Vbox(args) {
|
|||||||
<button
|
<button
|
||||||
class={classes}
|
class={classes}
|
||||||
onMouseDown={onClick}
|
onMouseDown={onClick}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onDblClick={onDblClick}
|
onDblClick={onDblClick}
|
||||||
onMouseOver={e => vboxHover(e, v)}>
|
onMouseOver={e => vboxHover(e, v)}>
|
||||||
{v}
|
{v}
|
||||||
@ -226,6 +229,7 @@ function Vbox(args) {
|
|||||||
return (
|
return (
|
||||||
<div class='vbox-vbox'
|
<div class='vbox-vbox'
|
||||||
onMouseDown={() => setReclaiming(false)}
|
onMouseDown={() => setReclaiming(false)}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseOver={e => hoverInfo(e, 'vbox')}>
|
onMouseOver={e => hoverInfo(e, 'vbox')}>
|
||||||
<div class="vbox-hdr">
|
<div class="vbox-hdr">
|
||||||
<h3 onTouchStart={e => e.target.scrollIntoView(true)}>VBOX</h3>
|
<h3 onTouchStart={e => e.target.scrollIntoView(true)}>VBOX</h3>
|
||||||
@ -241,6 +245,7 @@ function Vbox(args) {
|
|||||||
<button
|
<button
|
||||||
class='vbox-btn'
|
class='vbox-btn'
|
||||||
onMouseOver={e => hoverInfo(e, 'refill')}
|
onMouseOver={e => hoverInfo(e, 'refill')}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={() => sendVboxDiscard()}>
|
onMouseDown={() => sendVboxDiscard()}>
|
||||||
refill - 2b
|
refill - 2b
|
||||||
</button>
|
</button>
|
||||||
@ -251,32 +256,6 @@ function Vbox(args) {
|
|||||||
//
|
//
|
||||||
// INVENTORY
|
// INVENTORY
|
||||||
//
|
//
|
||||||
|
|
||||||
// const boundTds = range(0, 9).map(i => {
|
|
||||||
// const value = vbox.bound[i];
|
|
||||||
// if (combiner.indexOf(i) > -1) {
|
|
||||||
// return (
|
|
||||||
// <td
|
|
||||||
// key={i}>
|
|
||||||
//
|
|
||||||
// </td>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const highlighted = value && vboxHighlight.includes(value);
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <td
|
|
||||||
// key={i}
|
|
||||||
// class={`${highlighted ? 'highlight' : ''}`}
|
|
||||||
// onMouseOver={(e) => vboxHover(e, value)}
|
|
||||||
// onMouseDown={e => boundClick(e, i, highlighted) }>
|
|
||||||
// {convertItem(value)}
|
|
||||||
// </td>
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
function reclaimClick(e) {
|
function reclaimClick(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return setReclaiming(!reclaiming);
|
return setReclaiming(!reclaiming);
|
||||||
@ -292,6 +271,7 @@ function Vbox(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
|
if (vboxSelecting) clearVboxSelected();
|
||||||
if (reclaiming) return sendVboxReclaim(i);
|
if (reclaiming) return sendVboxReclaim(i);
|
||||||
|
|
||||||
const combinerIndex = combiner.indexOf(i);
|
const combinerIndex = combiner.indexOf(i);
|
||||||
@ -310,6 +290,7 @@ function Vbox(args) {
|
|||||||
<button
|
<button
|
||||||
class={classes}
|
class={classes}
|
||||||
onMouseOver={e => vboxHover(e, v)}
|
onMouseOver={e => vboxHover(e, v)}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={onClick}>
|
onMouseDown={onClick}>
|
||||||
{shapes[v]()}
|
{shapes[v]()}
|
||||||
</button>
|
</button>
|
||||||
@ -320,6 +301,7 @@ function Vbox(args) {
|
|||||||
<button
|
<button
|
||||||
class={classes}
|
class={classes}
|
||||||
onMouseDown={onClick}
|
onMouseDown={onClick}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseOver={e => vboxHover(e, v)}>
|
onMouseOver={e => vboxHover(e, v)}>
|
||||||
{v}
|
{v}
|
||||||
</button>
|
</button>
|
||||||
@ -346,6 +328,7 @@ function Vbox(args) {
|
|||||||
class='vbox-btn'
|
class='vbox-btn'
|
||||||
disabled={combiner.length !== 3}
|
disabled={combiner.length !== 3}
|
||||||
onMouseOver={e => hoverInfo(e, 'refine')}
|
onMouseOver={e => hoverInfo(e, 'refine')}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={() => sendVboxCombine()}>
|
onMouseDown={() => sendVboxCombine()}>
|
||||||
{text}
|
{text}
|
||||||
</button>
|
</button>
|
||||||
@ -364,6 +347,7 @@ function Vbox(args) {
|
|||||||
return (
|
return (
|
||||||
<div class={inventoryClass}
|
<div class={inventoryClass}
|
||||||
onMouseDown={inventoryClick}
|
onMouseDown={inventoryClick}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
style={vboxSelecting || itemUnequip.length ? { cursor: 'pointer' } : null}
|
style={vboxSelecting || itemUnequip.length ? { cursor: 'pointer' } : null}
|
||||||
onMouseOver={e => hoverInfo(e, 'inventory')}>
|
onMouseOver={e => hoverInfo(e, 'inventory')}>
|
||||||
<div class="vbox-hdr">
|
<div class="vbox-hdr">
|
||||||
@ -371,6 +355,7 @@ function Vbox(args) {
|
|||||||
<button
|
<button
|
||||||
class='vbox-btn reclaim'
|
class='vbox-btn reclaim'
|
||||||
onMouseOver={e => hoverInfo(e, 'reclaim')}
|
onMouseOver={e => hoverInfo(e, 'reclaim')}
|
||||||
|
onClick={e => e.stopPropagation()}
|
||||||
onMouseDown={reclaimClick}>
|
onMouseDown={reclaimClick}>
|
||||||
reclaim
|
reclaim
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user