disable tutorial via localstorage"
This commit is contained in:
parent
0ce19240f7
commit
38177f84e9
@ -2,6 +2,7 @@ const preact = require('preact');
|
|||||||
const actions = require('./actions');
|
const actions = require('./actions');
|
||||||
|
|
||||||
function tutorialConstructDisplay(player, instance, tutorial, navInstance, i) {
|
function tutorialConstructDisplay(player, instance, tutorial, navInstance, i) {
|
||||||
|
if (localStorage.getItem('tutorial-complete')) return false;
|
||||||
if (instance.time_control === 'Practice' && instance.rounds.length === 1 && tutorial && tutorial < 6) {
|
if (instance.time_control === 'Practice' && instance.rounds.length === 1 && tutorial && tutorial < 6) {
|
||||||
if (tutorial <= 2 || (tutorial > 2 && i > 0)) {
|
if (tutorial <= 2 || (tutorial > 2 && i > 0)) {
|
||||||
const mobileVisible = navInstance === i + 1;
|
const mobileVisible = navInstance === i + 1;
|
||||||
@ -13,12 +14,14 @@ function tutorialConstructDisplay(player, instance, tutorial, navInstance, i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tutorialShouldDisableEquip(tutorial, iter, instance, construct) {
|
function tutorialShouldDisableEquip(tutorial, iter, instance, construct) {
|
||||||
|
if (localStorage.getItem('tutorial-complete')) return false;
|
||||||
return tutorial && tutorial === 6 && iter === 0 && construct.skills.length !== 0
|
return tutorial && tutorial === 6 && iter === 0 && construct.skills.length !== 0
|
||||||
&& instance.time_control === 'Practice' && instance.rounds.length === 1;
|
&& instance.time_control === 'Practice' && instance.rounds.length === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function tutorialVbox(player, store, tutorial) {
|
function tutorialVbox(player, store, tutorial) {
|
||||||
|
if (localStorage.getItem('tutorial-complete')) return false;
|
||||||
let stage = tutorial;
|
let stage = tutorial;
|
||||||
const { vbox } = player;
|
const { vbox } = player;
|
||||||
if (stage === 1) {
|
if (stage === 1) {
|
||||||
@ -99,11 +102,15 @@ function tutorialVbox(player, store, tutorial) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
function tutorialStage(tutorial, ws, clearTutorial, instance) {
|
||||||
|
if (localStorage.getItem('tutorial-complete')) return false;
|
||||||
if (!(instance.time_control === 'Practice' && instance.rounds.length === 1)) return false;
|
if (!(instance.time_control === 'Practice' && instance.rounds.length === 1)) return false;
|
||||||
|
|
||||||
const exit = () => {
|
const exit = () => {
|
||||||
clearTutorial();
|
clearTutorial();
|
||||||
|
localStorage.setItem('tutorial-complete', true);
|
||||||
ws.sendInstanceState(instance.id);
|
ws.sendInstanceState(instance.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const tutorialText = () => {
|
const tutorialText = () => {
|
||||||
if (tutorial === 1) {
|
if (tutorial === 1) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user