tutorial disable check, info formatting

This commit is contained in:
Mashy
2019-10-28 20:58:44 +10:00
parent cfc1c1ea81
commit a6cd2a3e0a
2 changed files with 26 additions and 25 deletions
+5 -5
View File
@@ -104,11 +104,10 @@ class Vbox extends preact.Component {
if (newProps.reclaiming !== this.props.reclaiming) return true;
if (newProps.navInstance !== this.props.navInstance) return true;
if (newProps.tutorial !== this.props.tutorial) return true;
// Don't bother if info changes during tutorial
if (!newProps.tutorial && newProps.info !== this.props.info) return true;
// JSON or Array objects
if (newProps.info !== this.props.info) return true;
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
if (newProps.player !== this.props.player) return true;
if (newProps.instance !== this.props.instance) return true;
return false;
}
@@ -123,6 +122,7 @@ class Vbox extends preact.Component {
navInstance,
info,
vboxSelected,
instance,
// Static
itemInfo,
@@ -269,7 +269,7 @@ class Vbox extends preact.Component {
<button
class='vbox-btn'
onMouseOver={e => hoverInfo(e, 'refill')}
disabled={tutorial && tutorial < 7}
disabled={tutorial && tutorial < 7 && instance.time_control === 'Practice' && instance.rounds.length === 1}
onClick={e => e.stopPropagation()}
onMouseDown={() => sendVboxDiscard()}>
refill - 2b
@@ -419,7 +419,7 @@ class Vbox extends preact.Component {
onMouseOver={e => hoverInfo(e, 'inventory')}> INVENTORY
</h3>
<button
disabled={tutorial && tutorial < 8}
disabled={tutorial && tutorial < 8 && instance.time_control === 'Practice' && instance.rounds.length === 1}
class='vbox-btn reclaim'
onMouseOver={e => hoverInfo(e, 'reclaim')}
onClick={e => e.stopPropagation()}