better prompt text
This commit is contained in:
parent
b3b5716b21
commit
37a491b21a
@ -45,7 +45,6 @@ export const setTeamPage = value => ({ type: 'SET_TEAM_PAGE', value });
|
||||
export const setTeamSelect = value => ({ type: 'SET_TEAM_SELECT', value: Array.from(value) });
|
||||
|
||||
export const setTutorial = value => ({ type: 'SET_TUTORIAL', value });
|
||||
export const setTutorialGame = value => ({ type: 'SET_TUTORIAL_GAME', value });
|
||||
|
||||
export const setVboxSelected = value => ({ type: 'SET_VBOX_SELECTED', value: value });
|
||||
export const setVboxCombiner = value => ({ type: 'SET_VBOX_COMBINER', value });
|
||||
|
||||
@ -50,12 +50,11 @@ function Play(args) {
|
||||
);
|
||||
|
||||
const list = () => {
|
||||
|
||||
if (promptRegister) {
|
||||
return (
|
||||
<div class='block-text'>
|
||||
<p><b>You just won your first round of MNML.</b></p>
|
||||
<p>Register below to play a real Bo5 against other players, play a practice round, customise your team & more...</p>
|
||||
<p>Register below to play a real Bo5 against other players,<br/> play a practice round against a tougher AI opponent,<br/> customise your team & more...</p>
|
||||
<p>glhf</p>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -9,8 +9,8 @@ const shapes = require('./shapes');
|
||||
const { effectInfo } = require('../utils');
|
||||
|
||||
const addState = connect(
|
||||
({ game, account, animating, itemInfo, gameEffectInfo, tutorialGame }) =>
|
||||
({ game, account, animating, itemInfo, gameEffectInfo, tutorialGame })
|
||||
({ game, account, animating, itemInfo, gameEffectInfo, authenticated }) =>
|
||||
({ game, account, animating, itemInfo, gameEffectInfo, authenticated })
|
||||
);
|
||||
|
||||
class TargetSvg extends Component {
|
||||
@ -32,7 +32,6 @@ class TargetSvg extends Component {
|
||||
if (newProps.account !== this.props.account) return true;
|
||||
if (newProps.animating !== this.props.animating) return true;
|
||||
if (newProps.gameEffectInfo !== this.props.gameEffectInfo) return true;
|
||||
if (newProps.tutorialGame !== this.props.tutorialGame) return true;
|
||||
if (newState.width !== this.state.width) return true;
|
||||
if (newState.height !== this.state.height) return true;
|
||||
return false;
|
||||
@ -45,7 +44,7 @@ class TargetSvg extends Component {
|
||||
animating,
|
||||
game,
|
||||
gameEffectInfo,
|
||||
tutorialGame,
|
||||
authenticated,
|
||||
} = props;
|
||||
const { width, height } = state;
|
||||
|
||||
@ -53,10 +52,10 @@ class TargetSvg extends Component {
|
||||
if (game.phase === 'Finished') return false; // Clear everything if its over (in case of abandon)
|
||||
|
||||
// First time joining game phase
|
||||
if (tutorialGame) {
|
||||
if (!authenticated && game.stack.length === 0) {
|
||||
return (
|
||||
<div class="resolving-skill">
|
||||
<h2>Select your skills, click on targets and then hit <b>READY</b>.</h2>
|
||||
<h2><b>Select a skill</b> from each construct, <b>click a target</b> for that skill and then click <b>READY</b>.</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -30,10 +30,6 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
|
||||
function clearTutorialGame() {
|
||||
store.dispatch(actions.setTutorialGame(null));
|
||||
}
|
||||
|
||||
function setPing(ping) {
|
||||
store.dispatch(actions.setPing(ping));
|
||||
}
|
||||
@ -231,7 +227,6 @@ function registerEvents(store) {
|
||||
clearInstance,
|
||||
clearMtxActive,
|
||||
clearTutorial,
|
||||
clearTutorialGame,
|
||||
setAccount,
|
||||
setAuthenticated,
|
||||
setAccountInstances,
|
||||
|
||||
@ -54,7 +54,6 @@ module.exports = {
|
||||
teamSelect: createReducer([null, null, null], 'SET_TEAM_SELECT'),
|
||||
|
||||
tutorial: createReducer(1, 'SET_TUTORIAL'),
|
||||
tutorialGame: createReducer(1, 'SET_TUTORIAL_GAME'),
|
||||
|
||||
vboxSelected: createReducer({ storeSelect: [], stashSelect: [] }, 'SET_VBOX_SELECTED'),
|
||||
vboxCombiner: createReducer(null, 'SET_VBOX_COMBINER'),
|
||||
|
||||
@ -129,7 +129,6 @@ function createSocket(events) {
|
||||
{ game_id: gameId, construct_id: constructId, target_construct_id: targetConstructId, skill },
|
||||
]);
|
||||
events.setActiveSkill(null);
|
||||
events.clearTutorialGame();
|
||||
}
|
||||
|
||||
function sendGameSkillClear(gameId) {
|
||||
|
||||
@ -141,24 +141,6 @@ struct Connection {
|
||||
events: CbSender<Event>,
|
||||
}
|
||||
|
||||
impl Connection {
|
||||
// this is where last minute processing happens
|
||||
// use it to modify outgoing messages, update subs, serialize in some way...
|
||||
fn send(&self, msg: RpcMessage) -> Result<(), Error> {
|
||||
let msg = match msg {
|
||||
RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)),
|
||||
RpcMessage::AccountInstances(v) =>
|
||||
RpcMessage::AccountInstances(v.into_iter().map(|i| i.redact(self.id)).collect()),
|
||||
RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)),
|
||||
_ => msg,
|
||||
};
|
||||
|
||||
self.ws.send(msg).unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// we unwrap everything in here cause really
|
||||
// we don't care if this panics
|
||||
// it's run in a thread so it's supposed to bail
|
||||
@ -178,7 +160,7 @@ impl Handler for Connection {
|
||||
},
|
||||
Err(e) => {
|
||||
warn!("{:?}", e);
|
||||
self.send(RpcMessage::Error(e.to_string())).unwrap();
|
||||
self.ws.send(RpcMessage::Error(e.to_string())).unwrap();
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@ -50,6 +50,16 @@ impl User for Anonymous {
|
||||
_ => (),
|
||||
};
|
||||
|
||||
// last minute redactions and processing
|
||||
// this happens after the state setting as we need to keep
|
||||
// all the skills to prevent forfeiting
|
||||
let msg = match msg {
|
||||
RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)),
|
||||
RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)),
|
||||
_ => msg,
|
||||
};
|
||||
|
||||
|
||||
self.ws.send(msg)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@ -79,6 +79,15 @@ impl User for Authenticated {
|
||||
_ => (),
|
||||
};
|
||||
|
||||
// last minute processing
|
||||
let msg = match msg {
|
||||
RpcMessage::InstanceState(v) => RpcMessage::InstanceState(v.redact(self.id)),
|
||||
RpcMessage::AccountInstances(v) =>
|
||||
RpcMessage::AccountInstances(v.into_iter().map(|i| i.redact(self.id)).collect()),
|
||||
RpcMessage::GameState(v) => RpcMessage::GameState(v.redact(self.id)),
|
||||
_ => msg,
|
||||
};
|
||||
|
||||
self.ws.send(msg)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user