diff --git a/client/assets/styles/menu.less b/client/assets/styles/menu.less index 260a36f7..e52249d0 100644 --- a/client/assets/styles/menu.less +++ b/client/assets/styles/menu.less @@ -174,19 +174,3 @@ section { } } - -.vbox { - .login { - display: flex; - flex-flow: column; - - label { - line-height: initial; - } - - .terms { - display: inline; - margin: 0 1em; - } - } -} diff --git a/client/assets/styles/styles.mobile.less b/client/assets/styles/styles.mobile.less index 40a8de5e..27c8fa8a 100644 --- a/client/assets/styles/styles.mobile.less +++ b/client/assets/styles/styles.mobile.less @@ -164,7 +164,7 @@ // portrait menu or small size vertical in landscape -@media (max-width: 550px) and (max-height: 800px) and (orientation: portrait) { +@media (max-width: 550px) and (max-height: 800px) { #mnml { grid-template-columns: 1fr; grid-template-rows: 1fr; diff --git a/client/src/components/welcome.login.jsx b/client/src/components/welcome.login.jsx index 5aff5441..aa65f20d 100644 --- a/client/src/components/welcome.login.jsx +++ b/client/src/components/welcome.login.jsx @@ -4,7 +4,6 @@ const { Component } = require('preact') const { connect } = require('preact-redux'); const linkState = require('linkstate').default; -const actions = require('./../actions'); const { postData, errorToast } = require('../utils'); const addState = connect( @@ -27,29 +26,18 @@ const addState = connect( submitLogin, } }, - function receiveDispatch(dispatch) { - function clearInstance(user) { - dispatch(actions.setInstance(null)); - } - - return { - clearInstance, - } - } ); function Login(args) { const { submitLogin, - clearInstance, } = args; const { password, name } = this.state; const loginSubmit = (event) => { event.preventDefault(); - clearInstance(); submitLogin(name, password); this.setState({ name: '', password: '' }); }; diff --git a/client/src/events.jsx b/client/src/events.jsx index c0b935b1..fa048f29 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -27,6 +27,7 @@ function registerEvents(store) { function clearTutorial() { store.dispatch(actions.setTutorial(null)); + localStorage.setItem('tutorial-complete', true); } @@ -34,6 +35,7 @@ function registerEvents(store) { store.dispatch(actions.setTutorialGame(null)); } + function setPing(ping) { store.dispatch(actions.setPing(ping)); } @@ -177,13 +179,17 @@ function registerEvents(store) { const player = v.players.find(p => p.id === account.id); store.dispatch(actions.setPlayer(player)); - if (tutorial) tutorialVbox(player, store, tutorial); - if (v.phase === 'Finished') { ws.sendAccountInstances(); } - } + // instance.mobile.less hides info at @media 1000 + if (localStorage.getItem('tutorial-complete') || window.innerWidth <= 1100) { + store.dispatch(actions.setTutorial(null)); + } else if (v.time_control === 'Practice' && v.rounds.length === 1 && tutorial) { + tutorialVbox(player, store, tutorial); + } + } return store.dispatch(actions.setInstance(v)); } @@ -208,11 +214,6 @@ function registerEvents(store) { return true; } - function startTutorial() { - store.dispatch(actions.setTutorial(1)); - } - - window.addEventListener('hashchange', urlHashChange, false); return { @@ -242,8 +243,6 @@ function registerEvents(store) { setSubscription, setWs, - startTutorial, - urlHashChange, notify, diff --git a/client/src/socket.jsx b/client/src/socket.jsx index 0a17587d..bacf0870 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -299,8 +299,6 @@ function createSocket(events) { ChatWheel: wheel => events.setChatWheel(wheel), // Joining: () => events.notify('Searching for instance...'), - StartTutorial: () => events.startTutorial(), - Processing: () => true, Error: errHandler, }; diff --git a/client/src/tutorial.utils.jsx b/client/src/tutorial.utils.jsx index fa2f7abb..740aa867 100644 --- a/client/src/tutorial.utils.jsx +++ b/client/src/tutorial.utils.jsx @@ -1,8 +1,6 @@ const preact = require('preact'); const actions = require('./actions'); -const Login = require('./components/welcome.login'); - function tutorialConstructDisplay(player, instance, tutorial, i) { if (instance.time_control === 'Practice' && instance.rounds.length === 1 && tutorial && tutorial < 6) { if (tutorial <= 2 || (tutorial > 2 && i > 0)) { @@ -29,7 +27,6 @@ function tutorialVbox(player, store, tutorial) { for (let i = 2; i < 6; i += 1) { delete vbox.store.Colours[i]; } - vbox.store.Colours = {}; vbox.store.Skills = {}; vbox.store.Specs = {}; delete vbox.stash[0]; @@ -115,21 +112,6 @@ function tutorialStage(tutorial, clearTutorial, instance) { const exit = () => clearTutorial(); const tutorialText = () => { - if (tutorial === 1) { - return ( -
MNML is a turn-based 1v1 strategy game in an abstract setting.
-
- Build a unique team of 3 constructs from a range of skills and specialisations.
- Outplay your opponent in multiple rounds by adapting to an always shifting meta.
- Simple rules, complex interactions and unique mechanics.
-