+
-
{account.name}
-
-
- spawn new construct
-
-
-
-
-
+ {subInfo()}
@@ -216,7 +206,16 @@ class AccountStatus extends Component {
- {subInfo()}
+
+
+ spawn new construct
+
+
+
+
+
);
diff --git a/client/src/components/collection.jsx b/client/src/components/collection.jsx
new file mode 100644
index 00000000..c6441803
--- /dev/null
+++ b/client/src/components/collection.jsx
@@ -0,0 +1,89 @@
+const preact = require('preact');
+const { connect } = require('preact-redux');
+
+const actions = require('./../actions');
+const { COLOURS } = require('./../utils');
+const { ConstructAvatar } = require('./construct');
+
+const addState = connect(
+ function receiveState(state) {
+ const { ws, constructs, teamPage, teamSelect } = state;
+
+ function sendConstructSpawn(name) {
+ return ws.sendMtxConstructSpawn(name);
+ }
+
+ return {
+ constructs,
+ teamPage,
+ teamSelect,
+ };
+ },
+ function receiveDispatch(dispatch) {
+ function setTeam(constructIds) {
+ dispatch(actions.setTeamSelect(constructIds));
+ }
+
+ return {
+ setTeam,
+ };
+ }
+);
+
+function Collection(args) {
+ const {
+ constructs,
+ teamPage,
+ teamSelect,
+ setTeam,
+ } = args;
+
+ if (!constructs) return ;
+
+ // redux limitation + suggested workaround
+ // so much for dumb components
+ function selectConstruct(id) {
+ // remove
+ const i = teamSelect.findIndex(sid => sid === id);
+ if (i > -1) {
+ teamSelect[i] = null;
+ return setTeam(teamSelect);
+ }
+
+ // window insert
+ const insert = teamSelect.findIndex(j => j === null);
+ if (insert === -1) return setTeam([id, null, null]);
+ teamSelect[insert] = id;
+ return setTeam(teamSelect);
+ }
+ console.log(constructs.length);
+ const dispConstructs = constructs.length >= ((teamPage + 1) * 6)
+ ? constructs.slice(teamPage * 6, (teamPage + 1) * 6)
+ : constructs.slice(teamPage * 6, constructs.length);
+
+ const constructPanels = dispConstructs.map(construct => {
+ const colour = teamSelect.indexOf(construct.id);
+ const selected = colour > -1;
+
+ const borderColour = selected ? COLOURS[colour] : '#000000';
+
+ return (
+ selectConstruct(construct.id)} >
+
+
{construct.name}
+
+ );
+ });
+
+ return (
+
+ );
+}
+
+module.exports = addState(Collection);
diff --git a/client/src/components/game.ctrl.jsx b/client/src/components/game.ctrl.jsx
index a27e4e06..4bf517d6 100644
--- a/client/src/components/game.ctrl.jsx
+++ b/client/src/components/game.ctrl.jsx
@@ -125,9 +125,11 @@ function Controls(args) {
return (
);
}
diff --git a/client/src/components/header.jsx b/client/src/components/header.jsx
index 5562502b..7c776ff8 100644
--- a/client/src/components/header.jsx
+++ b/client/src/components/header.jsx
@@ -1,40 +1,96 @@
-// eslint-disable-next-line
-const preact = require('preact');
const { connect } = require('preact-redux');
+const preact = require('preact');
-const { saw } = require('./shapes');
-const actions = require('./../actions');
-
-function pingColour(ping) {
- if (ping < 100) return 'forestgreen';
- if (ping < 200) return 'yellow';
- return 'red';
-}
+const actions = require('../actions');
const addState = connect(
- ({ account, ping, showNav }) => {
- return { account, ping };
+ function receiveState(state) {
+ const {
+ ws,
+ account,
+ nav,
+ } = state;
+
+ function sendInstanceState(instance) {
+ return ws.sendInstanceState(instance.id);
+ }
+
+ function sendAccountStates() {
+ ws.sendEmailState();
+ ws.sendSubscriptionState();
+ }
+
+ return {
+ account,
+ nav,
+
+ sendInstanceState,
+ sendAccountStates,
+ };
},
+ function receiveDispatch(dispatch) {
+ function setNav(place) {
+ dispatch(actions.setGame(null));
+ dispatch(actions.setInstance(null));
+ dispatch(actions.setCombiner([]));
+ dispatch(actions.setReclaiming(false));
+ dispatch(actions.setActiveSkill(null));
+ dispatch(actions.setActiveConstruct(null));
+ dispatch(actions.setInfo(null));
+ dispatch(actions.setItemEquip(null));
+ dispatch(actions.setItemUnequip([]));
+ dispatch(actions.setVboxHighlight([]));
+
+ return dispatch(actions.setNav(place));
+ }
+
+ return {
+ setNav,
+ };
+ }
);
-function renderHeader(args) {
- const { account, ping } = args;
+function Header(args) {
+ const {
+ account,
+ nav,
- const accountStatus = account
- ? ()
- : '';
+ sendAccountStates,
+ setNav,
+ } = args;
+
+ if (!account) return false;
+
+ function navTo(p) {
+ return setNav(p);
+ }
+
+ function accountClick() {
+ sendAccountStates();
+ navTo('account');
+ }
return (
);
}
-
-module.exports = addState(renderHeader);
+module.exports = addState(Header);
\ No newline at end of file
diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx
index 2696cadf..36fc19b5 100644
--- a/client/src/components/info.component.jsx
+++ b/client/src/components/info.component.jsx
@@ -18,7 +18,19 @@ function InfoComponent(args) {
// const { info } = args;
function Info() {
- if (!info) return false;
+ if (!info) {
+ return (
+
+
VBOX phase
+
double clicking items in the VBOX will purchase and move them to your INVENTORY.
+
+ hover over an item to see its effects and combinations.
+ click an item and then click a construct to equip that item to it.
+
+
click the READY button on the right to progress to the GAME PHASE.
+
+ );
+ }
const fullInfo = itemInfo.items.find(i => i.item === info) || INFO[info];
if (!fullInfo) return false;
const isSkill = fullInfo.skill;
diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx
index 1761b656..1eecfd6e 100644
--- a/client/src/components/instance.constructs.jsx
+++ b/client/src/components/instance.constructs.jsx
@@ -98,7 +98,7 @@ function Construct(props) {
const skill = construct.skills[i];
const s = skill
? skill.skill
- : (+);
+ : (SKILL);
function skillClick(e) {
if (!skill) return false;
diff --git a/client/src/components/instance.ctrl.jsx b/client/src/components/instance.ctrl.jsx
index 129bb80c..a431f1d4 100644
--- a/client/src/components/instance.ctrl.jsx
+++ b/client/src/components/instance.ctrl.jsx
@@ -93,11 +93,13 @@ function Controls(args) {
);
return (
-