init
This commit is contained in:
parent
0e23c890ef
commit
4906eb3e39
20
WORKLOG.md
20
WORKLOG.md
@ -1,9 +1,15 @@
|
|||||||
# WORK WORK
|
# WORK WORK
|
||||||
## NOW
|
## NOW
|
||||||
*SERVER*
|
*PRODUCTION*
|
||||||
* tx middleware
|
* serde serialize privatise
|
||||||
remove tx from methods that don't need it
|
* stripe prod
|
||||||
|
* account page
|
||||||
|
* graphs n shit
|
||||||
|
* acp init
|
||||||
|
* DO postgres
|
||||||
|
|
||||||
|
## SOON
|
||||||
|
*SERVER*
|
||||||
* modules
|
* modules
|
||||||
* troll life -> dmg
|
* troll life -> dmg
|
||||||
* prince of peace
|
* prince of peace
|
||||||
@ -11,11 +17,6 @@
|
|||||||
* fuck magic
|
* fuck magic
|
||||||
* empower on ko
|
* empower on ko
|
||||||
|
|
||||||
* serde serialize privatise
|
|
||||||
|
|
||||||
## SOON
|
|
||||||
*OPS*
|
|
||||||
|
|
||||||
*$$$*
|
*$$$*
|
||||||
* chatwheel
|
* chatwheel
|
||||||
* eth adapter
|
* eth adapter
|
||||||
@ -39,9 +40,6 @@ the ready screen should totally be
|
|||||||
your constructs facing off against the other guy
|
your constructs facing off against the other guy
|
||||||
the chatwheel
|
the chatwheel
|
||||||
and a ready button
|
and a ready button
|
||||||
i'm also gonna put back in
|
|
||||||
if you click a vbox item and click inventory
|
|
||||||
it buys it
|
|
||||||
|
|
||||||
*SERVER*
|
*SERVER*
|
||||||
* vbox drops chances
|
* vbox drops chances
|
||||||
|
|||||||
@ -303,12 +303,12 @@
|
|||||||
border-top: 1px solid purple;
|
border-top: 1px solid purple;
|
||||||
}
|
}
|
||||||
|
|
||||||
.game .img {
|
.game .img, .faceoff .img {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.game .avatar {
|
.game .avatar, .faceoff .avatar {
|
||||||
grid-area: avatar;
|
grid-area: avatar;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -379,6 +379,37 @@
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.faceoff {
|
||||||
|
overflow: hidden;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: min-content 1fr 1fr min-content ;
|
||||||
|
grid-template-areas:
|
||||||
|
"oppname"
|
||||||
|
"opponent"
|
||||||
|
"player"
|
||||||
|
"playername";
|
||||||
|
|
||||||
|
.ready {
|
||||||
|
background: black;
|
||||||
|
color: @green;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.opponent-name {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
grid-area: oppname;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-name {
|
||||||
|
margin-top: 1em;
|
||||||
|
grid-area: playername;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Mobile Nav*/
|
/* Mobile Nav*/
|
||||||
.instance-nav { display: none; }
|
.instance-nav { display: none; }
|
||||||
|
|
||||||
|
|||||||
82
client/src/components/faceoff.jsx
Normal file
82
client/src/components/faceoff.jsx
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
const preact = require('preact');
|
||||||
|
const { connect } = require('preact-redux');
|
||||||
|
|
||||||
|
const actions = require('../actions');
|
||||||
|
|
||||||
|
const { ConstructAvatar } = require('./construct');
|
||||||
|
|
||||||
|
const addState = connect(
|
||||||
|
function receiveState(state) {
|
||||||
|
const {
|
||||||
|
instance,
|
||||||
|
account,
|
||||||
|
} = state;
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
instance,
|
||||||
|
account,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
function FaceoffConstruct(args) {
|
||||||
|
const {
|
||||||
|
construct
|
||||||
|
} = args;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div class='game-construct'>
|
||||||
|
<h3 class="name"> {construct.name} </h3>
|
||||||
|
<ConstructAvatar construct={construct} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Faceoff(props) {
|
||||||
|
const {
|
||||||
|
instance,
|
||||||
|
account,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
if (!instance) return <div>...</div>;
|
||||||
|
|
||||||
|
const otherTeam = instance.players.find(t => t.id !== account.id);
|
||||||
|
const playerTeam = instance.players.find(t => t.id === account.id);
|
||||||
|
|
||||||
|
function PlayerTeam(team) {
|
||||||
|
const constructs = team.constructs.map((c, i) =>
|
||||||
|
<FaceoffConstruct key={c.id} construct={c}/>);
|
||||||
|
|
||||||
|
const classes = `team player ${team.ready ? 'ready' : ''}`
|
||||||
|
return (
|
||||||
|
<div class={classes}>
|
||||||
|
{constructs}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OpponentTeam(team) {
|
||||||
|
const constructs = team.constructs.map((c, i) =>
|
||||||
|
<FaceoffConstruct key={c.id} construct={c}/>);
|
||||||
|
|
||||||
|
const classes = `team opponent ${team.ready ? 'ready' : ''}`
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div class={classes}>
|
||||||
|
{constructs}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<main class="faceoff">
|
||||||
|
<h1 class={`opponent-name ${otherTeam.ready ? 'ready' : ''}`}>{otherTeam.name}</h1>
|
||||||
|
{OpponentTeam(otherTeam)}
|
||||||
|
{PlayerTeam(playerTeam)}
|
||||||
|
<h1 class={`player-name ${playerTeam.ready ? 'ready' : ''}`}>{playerTeam.name}</h1>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = addState(Faceoff);
|
||||||
@ -6,6 +6,7 @@ const InfoContainer = require('./info.container');
|
|||||||
const InstanceConstructsContainer = require('./instance.constructs');
|
const InstanceConstructsContainer = require('./instance.constructs');
|
||||||
// const EquipmentContainer = require('./instance.equip');
|
// const EquipmentContainer = require('./instance.equip');
|
||||||
const ScoreBoard = require('./scoreboard');
|
const ScoreBoard = require('./scoreboard');
|
||||||
|
const Faceoff = require('./faceoff');
|
||||||
|
|
||||||
const actions = require('../actions');
|
const actions = require('../actions');
|
||||||
|
|
||||||
@ -49,11 +50,7 @@ function Instance(args) {
|
|||||||
if (!instance) return false;
|
if (!instance) return false;
|
||||||
|
|
||||||
if (instance.phase !== 'InProgress') {
|
if (instance.phase !== 'InProgress') {
|
||||||
return (
|
return <Faceoff />;
|
||||||
<main class="instance lobby" onMouseOver={() => setInfo(null)} >
|
|
||||||
<ScoreBoard />
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function instanceClick(e) {
|
function instanceClick(e) {
|
||||||
|
|||||||
@ -11,10 +11,6 @@ const addState = connect(
|
|||||||
function receiveState(state) {
|
function receiveState(state) {
|
||||||
const { ws, instance, player, account, itemInfo, itemEquip, activeConstruct } = state;
|
const { ws, instance, player, account, itemInfo, itemEquip, activeConstruct } = state;
|
||||||
|
|
||||||
function sendInstanceReady() {
|
|
||||||
return ws.sendInstanceReady(instance.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendVboxApply(constructId, i) {
|
function sendVboxApply(constructId, i) {
|
||||||
return ws.sendVboxApply(instance.id, constructId, i);
|
return ws.sendVboxApply(instance.id, constructId, i);
|
||||||
}
|
}
|
||||||
@ -27,7 +23,6 @@ const addState = connect(
|
|||||||
instance,
|
instance,
|
||||||
player,
|
player,
|
||||||
account,
|
account,
|
||||||
sendInstanceReady,
|
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
itemInfo,
|
itemInfo,
|
||||||
itemEquip,
|
itemEquip,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user