Merge branch 'release/1.12.4'
This commit is contained in:
commit
350db19f46
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mnml-client",
|
||||
"version": "1.12.3",
|
||||
"version": "1.12.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mnml-client",
|
||||
"version": "1.12.3",
|
||||
"version": "1.12.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -15,7 +15,7 @@ const addState = connect(
|
||||
ws,
|
||||
game,
|
||||
|
||||
authenticated,
|
||||
instance,
|
||||
activeSkill,
|
||||
animFocus,
|
||||
resolution,
|
||||
@ -30,7 +30,7 @@ const addState = connect(
|
||||
|
||||
return {
|
||||
game,
|
||||
authenticated,
|
||||
instance,
|
||||
activeSkill,
|
||||
animFocus,
|
||||
resolution,
|
||||
@ -54,7 +54,7 @@ class GameConstruct extends preact.Component {
|
||||
render() {
|
||||
const {
|
||||
// Changing state variables
|
||||
authenticated,
|
||||
instance,
|
||||
game,
|
||||
activeSkill,
|
||||
animFocus,
|
||||
@ -81,7 +81,9 @@ class GameConstruct extends preact.Component {
|
||||
const unfocus = animFocus && !animFocus.includes(construct.id) ? 'unfocus' : '';
|
||||
|
||||
const targeted = game.stack.find(c => c.target === construct.id);
|
||||
const highlight = !authenticated && !targeted && activeSkill ? 'highlight' : '';
|
||||
|
||||
const firstRoundTutorial = instance && instance.time_control === 'Practice' && !game.resolutions.length;
|
||||
const highlight = firstRoundTutorial && !targeted && activeSkill ? 'highlight' : '';
|
||||
|
||||
const crypSkills = player
|
||||
? <div class="skills"> {range(0, 3).map(j => <SkillBtn key={j} construct={construct} i={j} />)} </div>
|
||||
|
||||
@ -10,6 +10,7 @@ const addState = connect(
|
||||
game,
|
||||
account,
|
||||
authenticated,
|
||||
instance,
|
||||
chatShow,
|
||||
animating,
|
||||
} = state;
|
||||
@ -35,6 +36,7 @@ const addState = connect(
|
||||
game,
|
||||
account,
|
||||
authenticated,
|
||||
instance,
|
||||
chatShow,
|
||||
sendAbandon,
|
||||
sendGameSkillClear,
|
||||
@ -68,6 +70,7 @@ function GameCtrlBtns(args) {
|
||||
account,
|
||||
chatShow,
|
||||
authenticated,
|
||||
instance,
|
||||
|
||||
getInstanceState,
|
||||
sendGameSkillClear,
|
||||
@ -86,7 +89,8 @@ function GameCtrlBtns(args) {
|
||||
quit();
|
||||
}
|
||||
|
||||
const noTargets = !authenticated && game.stack.length === 0;
|
||||
const firstRoundTutorial = instance && instance.time_control === 'Practice' && !game.resolutions.length;
|
||||
const noTargets = firstRoundTutorial && game.stack.length === 0;
|
||||
|
||||
const readyBtn = <button disabled={animating || noTargets} class="ready" onClick={() => sendReady()}>Ready</button>;
|
||||
const quitBtn = <button disabled={animating} class="quit" onClick={quitClick}>Back</button>;
|
||||
|
||||
@ -50,7 +50,7 @@ function InstanceCtrlBtns(args) {
|
||||
} = args;
|
||||
|
||||
const finished = instance && instance.phase === 'Finished';
|
||||
const tutorialDisable = tutorial && tutorial < 8;
|
||||
const tutorialDisable = instance.time_control === 'Practice' && tutorial && tutorial < 8;
|
||||
return (
|
||||
<div class="instance-ctrl-btns">
|
||||
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
|
||||
|
||||
@ -44,15 +44,14 @@ class TargetSvg extends Component {
|
||||
animating,
|
||||
game,
|
||||
gameEffectInfo,
|
||||
authenticated,
|
||||
} = props;
|
||||
const { width, height } = state;
|
||||
|
||||
if (!game) return false; // game will be null when battle ends
|
||||
if (game.phase === 'Finished') return false; // Clear everything if its over (in case of abandon)
|
||||
|
||||
// First time joining game phase
|
||||
if (!authenticated && game.stack.length === 0) {
|
||||
// First round of a game
|
||||
if (!game.resolutions.length && game.stack.length === 0) {
|
||||
return (
|
||||
<div class="resolving-skill">
|
||||
<h2><b>Select a skill</b> from each construct, <b>click a target</b> for that skill and then click <b>READY</b>.</h2>
|
||||
|
||||
@ -9,7 +9,7 @@ const buttons = require('./buttons');
|
||||
const { removeTier } = require('../utils');
|
||||
|
||||
const addState = connect(
|
||||
({ itemUnequip, vboxHighlight, vboxSelected, tutorial }) => ({ itemUnequip, vboxHighlight, vboxSelected, tutorial }));
|
||||
({ itemUnequip, vboxHighlight, vboxSelected, tutorial, instance }) => ({ itemUnequip, vboxHighlight, vboxSelected, tutorial, instance }));
|
||||
|
||||
class stashElement extends preact.Component {
|
||||
shouldComponentUpdate(newProps) {
|
||||
@ -41,6 +41,7 @@ class stashElement extends preact.Component {
|
||||
vboxHighlight,
|
||||
vboxSelected,
|
||||
tutorial,
|
||||
instance,
|
||||
} = props;
|
||||
|
||||
const { storeSelect, stashSelect } = vboxSelected;
|
||||
@ -97,7 +98,7 @@ class stashElement extends preact.Component {
|
||||
: `${border} ${notValidCombo ? 'fade' : ''}`;
|
||||
|
||||
const invObject = shapes[v] ? shapes[v]() : v;
|
||||
const tutorialDisable = tutorial === 1;
|
||||
const tutorialDisable = tutorial === 1 && instance.time_control === 'Practice' && instance.rounds.length === 1;
|
||||
return (
|
||||
<label
|
||||
key={i}
|
||||
|
||||
@ -14,7 +14,7 @@ const addState = connect(
|
||||
} = state;
|
||||
|
||||
return {
|
||||
promptRegister: tutorial === 99, // see events
|
||||
promptRegister: !tutorial,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
@ -38,9 +38,13 @@ function Register(args) {
|
||||
|
||||
const registerSubmit = (event) => {
|
||||
event.preventDefault();
|
||||
this.setState({ name: '', password: '', confirm: '' });
|
||||
submitRegister(name, password);
|
||||
}
|
||||
|
||||
const pwLen = () =>
|
||||
!password || password && password.length > 3;
|
||||
|
||||
const registerConfirm = () =>
|
||||
password === confirm;
|
||||
|
||||
@ -50,24 +54,30 @@ function Register(args) {
|
||||
|
||||
return (
|
||||
<div class="login">
|
||||
<label for="username">Username</label>
|
||||
<label class="login-input" for="username">Username </label>
|
||||
<input
|
||||
class="login-input"
|
||||
type="email"
|
||||
type="text"
|
||||
placeholder="username"
|
||||
value={this.state.name}
|
||||
onInput={linkState(this, 'name')}
|
||||
/>
|
||||
<label for="password">Password - min 4 chars</label>
|
||||
<label
|
||||
class={`${pwLen() ? '' : 'red'} login-input`}
|
||||
for="password">Password - min 4 chars
|
||||
</label>
|
||||
<input
|
||||
class="login-input"
|
||||
class={`${pwLen() ? '' : 'red'} login-input`}
|
||||
type="password"
|
||||
placeholder="password"
|
||||
autocomplete="new-password"
|
||||
value={this.state.password}
|
||||
onInput={linkState(this, 'password')}
|
||||
/>
|
||||
<label for="confirm">Confirm Password</label>
|
||||
<label
|
||||
class={`${registerConfirm() ? '' : 'red'} login-input`}
|
||||
for="confirm">Confirm Password
|
||||
</label>
|
||||
<input
|
||||
class={`${registerConfirm() ? '' : 'red'} login-input`}
|
||||
type="password"
|
||||
|
||||
@ -180,8 +180,8 @@ function registerEvents(store) {
|
||||
setPvp(false);
|
||||
const player = v.players.find(p => p.id === account.id);
|
||||
store.dispatch(actions.setPlayer(player));
|
||||
|
||||
if (tutorial) tutorialVbox(player, store, tutorial);
|
||||
|
||||
if (tutorial && v.rounds.length === 1 && v.time_control === 'Practice') tutorialVbox(player, store, tutorial);
|
||||
|
||||
if (v.phase === 'Finished') {
|
||||
ws.sendAccountInstances();
|
||||
@ -211,12 +211,8 @@ function registerEvents(store) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function startTutorial() {
|
||||
store.dispatch(actions.setTutorial(1));
|
||||
}
|
||||
|
||||
function promptRegister() {
|
||||
store.dispatch(actions.setTutorial(99));
|
||||
store.dispatch(actions.setTutorial(null));
|
||||
store.dispatch(actions.setInstance(null));
|
||||
}
|
||||
|
||||
@ -249,7 +245,6 @@ function registerEvents(store) {
|
||||
setSubscription,
|
||||
setWs,
|
||||
|
||||
startTutorial,
|
||||
promptRegister,
|
||||
|
||||
urlHashChange,
|
||||
|
||||
@ -299,7 +299,7 @@ function createSocket(events) {
|
||||
ChatWheel: wheel => events.setChatWheel(wheel),
|
||||
// Joining: () => events.notify('Searching for instance...'),
|
||||
|
||||
StartTutorial: () => events.startTutorial(),
|
||||
// StartTutorial: () => events.startTutorial(),
|
||||
PromptRegister: () => events.promptRegister(),
|
||||
|
||||
Processing: () => true,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mnml_core"
|
||||
version = "1.12.3"
|
||||
version = "1.12.4"
|
||||
authors = ["ntr <ntr@smokestack.io>", "mashy <mashy@mnml.gg>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mnml-ops",
|
||||
"version": "1.12.3",
|
||||
"version": "1.12.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mnml"
|
||||
version = "1.12.3"
|
||||
version = "1.12.4"
|
||||
authors = ["ntr <ntr@smokestack.io>"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -61,7 +61,6 @@ pub enum RpcMessage {
|
||||
SubscriptionState(Option<Subscription>),
|
||||
|
||||
Pong(()),
|
||||
StartTutorial(()),
|
||||
PromptRegister(()),
|
||||
|
||||
QueueRequested(()),
|
||||
|
||||
@ -69,8 +69,6 @@ impl User for Anonymous {
|
||||
info!("anonymous connection");
|
||||
|
||||
self.ws.send(RpcMessage::AccountState(self.account.clone()))?;
|
||||
self.ws.send(RpcMessage::StartTutorial(()))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mnml-studios",
|
||||
"version": "1.12.3",
|
||||
"version": "1.12.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user