lil fixes

This commit is contained in:
ntr 2019-05-06 21:12:55 +10:00
parent bedd6814a7
commit cc82c3811c
4 changed files with 17 additions and 5 deletions

View File

@ -78,6 +78,7 @@ function InfoCryp(args) {
e.stopPropagation();
setActiveCryp(cryp);
setInfo('highlight', 'spec');
setVboxHidden(true);
}
if (!s) {

View File

@ -21,6 +21,7 @@ function Vbox(args) {
setCombiner,
setInfo,
setReclaiming,
showTeam,
vboxHidden,
vboxInfo,
} = args;
@ -97,8 +98,10 @@ function Vbox(args) {
//
function boundClick(e, i, highlight) {
if (reclaiming && vbox.bound[i]) sendVboxReclaim(i);
else if (highlight && activeCryp) sendVboxApply(i);
else if (vbox.bound[i]) {
else if (highlight && activeCryp) {
sendVboxApply(i);
showTeam();
} else if (vbox.bound[i]) {
const insert = combiner.findIndex(j => j === null);
if (insert === -1) return setCombiner([i, null, null]);
combiner[insert] = i;

View File

@ -70,15 +70,22 @@ const addState = connect(
return dispatch(actions.setInfo([type, info]));
}
function setActiveVar(v) {
return dispatch(actions.setActiveVar(v));
function setActiveCryp(v) {
return dispatch(actions.setActiveCryp(v));
}
function showTeam() {
dispatch(actions.setInfo([null, null]));
dispatch(actions.setVboxHidden(true));
return true;
}
return {
setCombiner,
setReclaiming,
setInfo,
setActiveVar,
setActiveCryp,
showTeam,
};
}

View File

@ -133,6 +133,7 @@ function registerEvents(store) {
const player = v.players.find(p => p.id === account.id);
if (player) store.dispatch(actions.setPlayer(player));
if (v) ws.startInstanceStateTimeout(v.id);
if (v.phase === 'Lobby') store.dispatch(actions.setVboxHidden(true));
return store.dispatch(actions.setInstance(v));
}