spawning constructs (no mtx yet)
This commit is contained in:
@@ -64,7 +64,7 @@ function Team(args) {
|
||||
return setTeam(team);
|
||||
}
|
||||
|
||||
const constructPanels = constructs.sort(idSort).map(construct => {
|
||||
const constructPanels = constructs.map(construct => {
|
||||
const colour = team.indexOf(construct.id);
|
||||
const selected = colour > -1;
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ function registerEvents(store) {
|
||||
setNav('list');
|
||||
}
|
||||
|
||||
function setNewConstruct(construct) {
|
||||
const { constructs } = store.getState();
|
||||
constructs.push(construct);
|
||||
store.dispatch(actions.setConstructs(constructs));
|
||||
}
|
||||
|
||||
|
||||
function setInstanceList(list) {
|
||||
store.dispatch(actions.setInstanceList(list));
|
||||
}
|
||||
@@ -226,6 +233,7 @@ function registerEvents(store) {
|
||||
setActiveItem,
|
||||
setActiveSkill,
|
||||
setConstructList,
|
||||
setNewConstruct,
|
||||
setGame,
|
||||
setInstance,
|
||||
setInstanceList,
|
||||
|
||||
@@ -46,6 +46,10 @@ function createSocket(events) {
|
||||
send(['AccountInstances', {}]);
|
||||
}
|
||||
|
||||
function sendConstructSpawn() {
|
||||
send(['MtxConstructBuy', {}]);
|
||||
}
|
||||
|
||||
function sendGameState(id) {
|
||||
send(['GameState', { id }]);
|
||||
}
|
||||
@@ -150,6 +154,10 @@ function createSocket(events) {
|
||||
events.setConstructList(constructs);
|
||||
}
|
||||
|
||||
function onConstructSpawn(construct) {
|
||||
events.setNewConstruct(construct);
|
||||
}
|
||||
|
||||
function onGameState(game) {
|
||||
events.setGame(game);
|
||||
}
|
||||
@@ -183,6 +191,7 @@ function createSocket(events) {
|
||||
AccountConstructs: onAccountConstructs,
|
||||
AccountInstances: onAccountInstances,
|
||||
AccountShop: onAccountShop,
|
||||
ConstructSpawn: onConstructSpawn,
|
||||
GameState: onGameState,
|
||||
InstanceState: onInstanceState,
|
||||
ItemInfo: onItemInfo,
|
||||
@@ -272,6 +281,7 @@ function createSocket(events) {
|
||||
return {
|
||||
sendAccountConstructs,
|
||||
sendAccountInstances,
|
||||
sendConstructSpawn,
|
||||
sendGameState,
|
||||
sendGameReady,
|
||||
sendGameSkill,
|
||||
|
||||
Reference in New Issue
Block a user