From 5e137af159494b031905f4bc42798972f015d026 Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 28 Oct 2019 12:53:36 +1000 Subject: [PATCH] default general notes for vbox --- client/src/components/info.component.jsx | 18 ++++++++++++++---- client/src/components/vbox.component.jsx | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index 86b193e4..cdabfca8 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -189,12 +189,22 @@ class InfoComponent extends preact.Component { } function Combos() { - if (!player) return false; - if (!info) return false; - if (tutorial) return false; + if (tutorial && instance.time_control === 'Practice' && instance.rounds.length === 1) return false; + const generalNotes = ( +
+

General

+

+ Create combos by clicking a white item together with two colours in the inventory.
+ Reclaim can be used to sell items in the inventory.
+ Click the READY button to start the GAME PHASE. +

+
+ ); + if (!player) return generalNotes; + if (!info) return generalNotes; const vboxCombos = itemInfo.combos.filter(c => c.components.includes(info)); - if (vboxCombos.length > 6) return false; + if (vboxCombos.length > 6 || vboxCombos.length === 0) return generalNotes; return ( diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 54427f92..44d193e7 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -163,7 +163,7 @@ class Vbox extends preact.Component { e.stopPropagation(); if (combiner.length !== 0) { const base = combiner.find(c => !['Red', 'Blue', 'Green'].includes(vbox.bound[c])); - if (base) return setInfo(vbox.bound[base]); + if (base || base === 0) return setInfo(vbox.bound[base]); } if (info !== v) setInfo(v); }