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(); e.stopPropagation();
setActiveCryp(cryp); setActiveCryp(cryp);
setInfo('highlight', 'spec'); setInfo('highlight', 'spec');
setVboxHidden(true);
} }
if (!s) { if (!s) {

View File

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

View File

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

View File

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