blaheah
This commit is contained in:
parent
9abbc26308
commit
70f3796d14
@ -10,14 +10,12 @@ const InfoCryp = require('./info.cryp');
|
||||
function Info(args) {
|
||||
const {
|
||||
activeCryp,
|
||||
setActiveCryp,
|
||||
info,
|
||||
combiner,
|
||||
sendUnequip,
|
||||
instance,
|
||||
player,
|
||||
setInfo,
|
||||
vboxInfo,
|
||||
setVboxHidden,
|
||||
vboxHidden,
|
||||
} = args;
|
||||
|
||||
@ -160,6 +158,27 @@ function Info(args) {
|
||||
function Combos() {
|
||||
if (!info[0]) return false;
|
||||
if (activeCryp) return false;
|
||||
if (!player) return false;
|
||||
|
||||
if (combiner[0] !== null) {
|
||||
|
||||
const filteredCombos = vboxInfo.combos
|
||||
.filter(combo => combiner.every(u => u === null || combo.units.includes(player.vbox.bound[u])));
|
||||
|
||||
return (
|
||||
<table>
|
||||
<tbody>
|
||||
{filteredCombos.map((c, i) =>
|
||||
<tr key={i} >
|
||||
<td className="highlight" >{convertVar(c.var)}</td>
|
||||
{c.units.map(u => <td>{convertVar(u)}</td>)}
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<table>
|
||||
<tbody>
|
||||
@ -183,8 +202,8 @@ function Info(args) {
|
||||
return (
|
||||
<div className={classes} >
|
||||
<InfoCryp />
|
||||
<Combos />
|
||||
<CrypVar />
|
||||
<Combos />
|
||||
<ScoreBoard />
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -7,6 +7,7 @@ const addState = connect(
|
||||
function receiveState(state) {
|
||||
const {
|
||||
activeCryp,
|
||||
combiner,
|
||||
info,
|
||||
ws,
|
||||
instance,
|
||||
@ -22,6 +23,7 @@ const addState = connect(
|
||||
return {
|
||||
activeCryp,
|
||||
info,
|
||||
combiner,
|
||||
sendUnequip,
|
||||
instance,
|
||||
player,
|
||||
@ -29,27 +31,6 @@ const addState = connect(
|
||||
vboxHidden,
|
||||
};
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setInfo(item, value) {
|
||||
dispatch(actions.setInfo([item, value]));
|
||||
}
|
||||
|
||||
function setActiveCryp(value) {
|
||||
dispatch(actions.setActiveCryp(value));
|
||||
}
|
||||
|
||||
function setVboxHidden(value) {
|
||||
dispatch(actions.setVboxHidden(value));
|
||||
}
|
||||
|
||||
return {
|
||||
setInfo,
|
||||
setVboxHidden,
|
||||
setActiveCryp,
|
||||
};
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
module.exports = addState(Info);
|
||||
|
||||
@ -106,14 +106,17 @@ function Vbox(args) {
|
||||
// INVENTORY
|
||||
//
|
||||
function boundClick(e, i, highlight) {
|
||||
if (reclaiming && vbox.bound[i]) sendVboxReclaim(i);
|
||||
const value = vbox.bound[i];
|
||||
if (reclaiming && value) sendVboxReclaim(i);
|
||||
else if (highlight && activeCryp) {
|
||||
sendVboxApply(i);
|
||||
showTeam();
|
||||
} else if (vbox.bound[i]) {
|
||||
} else if (value) {
|
||||
const insert = combiner.findIndex(j => j === null);
|
||||
if (insert === -1) return setCombiner([i, null, null]);
|
||||
combiner[insert] = i;
|
||||
setInfo('item', value);
|
||||
setActiveCryp(null);
|
||||
return setCombiner(combiner);
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -96,6 +96,7 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
function clearCombiner() {
|
||||
store.dispatch(actions.setInfo(null));
|
||||
store.dispatch(actions.setCombiner([null, null, null]));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user