instance form and pve

This commit is contained in:
ntr
2019-04-25 22:21:13 +10:00
parent b5b2e95f34
commit 621676732d
7 changed files with 28 additions and 24 deletions
+5 -1
View File
@@ -160,7 +160,7 @@ svg {
flex-flow: column;
}
.cryps input {
.cryps input, .cryps select {
border-color: #444;
background-color: #333;
border-radius: 0;
@@ -286,6 +286,10 @@ header {
margin-right: 0.5em;
}
.create-form button {
display: block;
}
/*
INSTANCE
*/
+5
View File
@@ -15,6 +15,11 @@ const addState = connect(
ws.clearGameStateTimeout();
}
if (!instance) {
ws.clearInstanceStateTimeout();
}
return { game, instance, account };
}
);
+3 -10
View File
@@ -7,6 +7,8 @@ const { stringSort } = require('./../utils');
const molecule = require('./molecule');
const SpawnButton = require('./spawn.button');
const InstanceCreateForm = require('./instance.create.form');
const idSort = stringSort('id');
const COLOURS = [
@@ -24,7 +26,6 @@ function Menu(args) {
sendInstanceState,
sendPlayerMmCrypsSet,
sendInstanceJoin,
sendInstanceNew,
sendCrypSpawn,
instances,
} = args;
@@ -64,20 +65,12 @@ function Menu(args) {
Set Matchmaking Team
</button>
);
const instanceJoin = (
<button
className={`menu-instance-btn right ${instanceJoinHidden ? 'hidden' : ''}`}
disabled={instanceJoinHidden}
onClick={() => sendInstanceNew()}>
Create New Instance
</button>
);
return (
<section className="menu-instance-list" >
{instancePanels}
{mmSet}
{instanceJoin}
<InstanceCreateForm />
</section>
);
}
-8
View File
@@ -14,13 +14,6 @@ const addState = connect(
return false;
}
function sendInstanceNew() {
if (selectedCryps.length) {
return ws.sendInstanceNew(selectedCryps);
}
return false;
}
function sendPlayerMmCrypsSet() {
if (selectedCryps.length) {
return ws.sendPlayerMmCrypsSet(selectedCryps);
@@ -41,7 +34,6 @@ const addState = connect(
cryps,
selectedCryps,
sendInstanceJoin,
sendInstanceNew,
sendInstanceState,
sendCrypSpawn,
sendPlayerMmCrypsSet,
+3
View File
@@ -20,6 +20,9 @@ function registerEvents(store) {
function setGame(game) {
const { game: currentGame, ws } = store.getState();
if (!game) ws.clearGameStateTimeout();
if (game && currentGame) {
if (game.resolved.length !== currentGame.resolved.length) {
// stop fetching the game state til animations are done
+3 -2
View File
@@ -148,8 +148,8 @@ function createSocket(events) {
send({ method: 'instance_join', params: { instance_id: instanceId, cryp_ids: cryps } });
}
function sendInstanceNew(cryps) {
send({ method: 'instance_new', params: { cryp_ids: cryps, name: 'dota pros onli', players: 2 } });
function sendInstanceNew(cryps, name, players) {
send({ method: 'instance_new', params: { cryp_ids: cryps, name, players } });
}
function sendInstanceReady(instanceId) {
@@ -323,6 +323,7 @@ function createSocket(events) {
return {
clearGameStateTimeout,
clearInstanceStateTimeout,
sendAccountLogin,
sendAccountCreate,
sendAccountDemo,