sheeeeeeeeeeeeeeeeeeeeeeeeeeit

This commit is contained in:
ntr
2019-07-30 00:48:40 +10:00
parent fd518ba4e2
commit c94b6f134c
12 changed files with 357 additions and 324 deletions
+1 -4
View File
@@ -64,7 +64,6 @@ const addState = connect(
function List(args) {
const {
team,
constructs,
constructRename,
clearMtxRename,
setConstructRename,
@@ -73,9 +72,7 @@ function List(args) {
sendConstructAvatarReroll,
} = args;
const constructPanels = constructs
.filter(c => team.includes(c.id))
.sort(idSort)
const constructPanels = team
.map(construct => {
const constructName = constructRename === construct.id
? <input id='renameInput' type="text" style="text-align: center" placeholder="enter a new name"></input>
+1 -6
View File
@@ -10,7 +10,6 @@ function registerEvents(store) {
}
function setTeam(team) {
localStorage.setItem('team', JSON.stringify(team));
store.dispatch(actions.setTeam(team));
}
@@ -179,11 +178,6 @@ function registerEvents(store) {
return store.dispatch(actions.setItemInfo(v));
}
const team = JSON.parse(localStorage.getItem('team'));
if (team && team.every(t => t)) {
store.dispatch(actions.setTeam(team));
}
// events.on('SET_PLAYER', setInstance);
// events.on('SEND_SKILL', function skillActive(gameId, constructId, targetConstructId, skill) {
@@ -234,6 +228,7 @@ function registerEvents(store) {
setItemInfo,
setPing,
setShop,
setTeam,
setWs,
};
}
+10 -2
View File
@@ -113,10 +113,9 @@ function createSocket(events) {
}
function sendInstanceQueue() {
send(['InstancePractice', {}]);
send(['InstanceQueue', {}]);
}
function sendInstanceReady(instanceId) {
send(['InstanceReady', { instance_id: instanceId }]);
}
@@ -155,6 +154,10 @@ function createSocket(events) {
events.setConstructList(constructs);
}
function onAccountTeam(constructs) {
events.setTeam(constructs);
}
function onConstructSpawn(construct) {
events.setNewConstruct(construct);
}
@@ -186,6 +189,7 @@ function createSocket(events) {
const handlers = {
AccountState: onAccount,
AccountConstructs: onAccountConstructs,
AccountTeam: onAccountTeam,
AccountInstances: onAccountInstances,
AccountShop: onAccountShop,
ConstructSpawn: onConstructSpawn,
@@ -193,6 +197,10 @@ function createSocket(events) {
InstanceState: onInstanceState,
ItemInfo: onItemInfo,
Pong: onPong,
QueueRequested: () => console.log('pvp queue request received'),
QueueJoined: () => console.log('you have joined the pvp queue'),
Error: errHandler,
};