move item into its own mod
This commit is contained in:
@@ -15,7 +15,7 @@ function Info(args) {
|
||||
sendUnequip,
|
||||
instance,
|
||||
player,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
vboxHidden,
|
||||
} = args;
|
||||
|
||||
@@ -166,7 +166,7 @@ function Info(args) {
|
||||
if (!player) return false;
|
||||
|
||||
if (!(combiner.every(u => u === null))) {
|
||||
const filteredCombos = vboxInfo.combos
|
||||
const filteredCombos = itemInfo.combos
|
||||
.filter(combo => combiner.every(u => u === null
|
||||
|| combo.units.includes(player.vbox.bound[u])));
|
||||
if (filteredCombos.length > 6) return false;
|
||||
@@ -183,7 +183,7 @@ function Info(args) {
|
||||
</table>
|
||||
);
|
||||
}
|
||||
const vboxCombos = vboxInfo.combos.filter(c => c.units.includes(info[1]));
|
||||
const vboxCombos = itemInfo.combos.filter(c => c.units.includes(info[1]));
|
||||
if (vboxCombos.length > 6) return false;
|
||||
return (
|
||||
<table>
|
||||
|
||||
@@ -11,7 +11,7 @@ const addState = connect(
|
||||
info,
|
||||
ws,
|
||||
instance,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
vboxHidden,
|
||||
player,
|
||||
} = state;
|
||||
@@ -27,7 +27,7 @@ const addState = connect(
|
||||
sendUnequip,
|
||||
instance,
|
||||
player,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
vboxHidden,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -8,8 +8,8 @@ const shapes = require('./shapes');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { activeCryp, player, vboxInfo } = state;
|
||||
return { activeCryp, player, vboxInfo };
|
||||
const { activeCryp, player, itemInfo } = state;
|
||||
return { activeCryp, player, itemInfo };
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
@@ -38,7 +38,7 @@ function InfoCryp(args) {
|
||||
const {
|
||||
activeCryp,
|
||||
player,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
|
||||
setVboxHidden,
|
||||
setInfo,
|
||||
@@ -52,8 +52,8 @@ function InfoCryp(args) {
|
||||
if (!cryp) return false;
|
||||
|
||||
function setHighlight(type) {
|
||||
if (type === 'skill') return setVboxHighlight(vboxInfo.items.filter(v => v.skill).map(v => v.v));
|
||||
if (type === 'spec') return setVboxHighlight(vboxInfo.items.filter(v => v.spec).map(v => v.v));
|
||||
if (type === 'skill') return setVboxHighlight(itemInfo.items.filter(v => v.skill).map(v => v.v));
|
||||
if (type === 'spec') return setVboxHighlight(itemInfo.items.filter(v => v.spec).map(v => v.v));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ const actions = require('../actions');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { ws, instance, player, account, vboxHidden, vboxInfo, activeItem, activeCryp } = state;
|
||||
const { ws, instance, player, account, vboxHidden, itemInfo, activeItem, activeCryp } = state;
|
||||
|
||||
function sendInstanceReady() {
|
||||
return ws.sendInstanceReady(instance.id);
|
||||
@@ -18,7 +18,7 @@ const addState = connect(
|
||||
return ws.sendVboxApply(instance.id, crypId, i);
|
||||
}
|
||||
|
||||
return { instance, player, account, sendInstanceReady, sendVboxApply, vboxHidden, vboxInfo, activeItem, activeCryp };
|
||||
return { instance, player, account, sendInstanceReady, sendVboxApply, vboxHidden, itemInfo, activeItem, activeCryp };
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
@@ -57,12 +57,12 @@ function Cryp(props) {
|
||||
setInfo,
|
||||
setActiveCryp,
|
||||
setVboxHighlight,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
} = props;
|
||||
|
||||
function setHighlight(type) {
|
||||
if (type === 'skill') return setVboxHighlight(vboxInfo.items.filter(v => v.skill).map(v => v.v));
|
||||
if (type === 'spec') return setVboxHighlight(vboxInfo.items.filter(v => v.spec).map(v => v.v));
|
||||
if (type === 'skill') return setVboxHighlight(itemInfo.items.filter(v => v.skill).map(v => v.v));
|
||||
if (type === 'spec') return setVboxHighlight(itemInfo.items.filter(v => v.spec).map(v => v.v));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ function Cryp(props) {
|
||||
}
|
||||
|
||||
const { vbox } = player;
|
||||
const skillList = vboxInfo.items.filter(v => v.skill).map(v => v.v);
|
||||
const specList = vboxInfo.items.filter(v => v.spec).map(v => v.v);
|
||||
const skillList = itemInfo.items.filter(v => v.skill).map(v => v.v);
|
||||
const specList = itemInfo.items.filter(v => v.spec).map(v => v.v);
|
||||
|
||||
const skills = range(0, 3).map(i => {
|
||||
const skill = cryp.skills[i];
|
||||
@@ -194,7 +194,7 @@ function InstanceCryps(props) {
|
||||
|
||||
sendVboxApply,
|
||||
vboxHidden,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
setVboxHighlight,
|
||||
} = props;
|
||||
|
||||
@@ -202,7 +202,7 @@ function InstanceCryps(props) {
|
||||
if (instance.phase === 'Lobby') return false;
|
||||
|
||||
const cryps = player.cryps.map((c, i) => Cryp({
|
||||
activeCryp, activeItem, cryp: c, player, sendVboxApply, setInfo, setActiveCryp, vboxInfo, setVboxHighlight,
|
||||
activeCryp, activeItem, cryp: c, player, sendVboxApply, setInfo, setActiveCryp, itemInfo, setVboxHighlight,
|
||||
}));
|
||||
|
||||
const classes = `cryp-list ${vboxHidden ? '' : 'hidden'}`;
|
||||
|
||||
@@ -7,13 +7,13 @@ const { convertItem, SPECS } = require('./../utils');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { player, vboxInfo, info, ws, instance } = state;
|
||||
const { player, itemInfo, info, ws, instance } = state;
|
||||
|
||||
function sendUnequip(crypId, item) {
|
||||
return ws.sendVboxUnequip(instance.id, crypId, item);
|
||||
}
|
||||
|
||||
return { player, vboxInfo, info, sendUnequip };
|
||||
return { player, itemInfo, info, sendUnequip };
|
||||
},
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
@@ -38,7 +38,7 @@ function Equipment(props) {
|
||||
const {
|
||||
player,
|
||||
info,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
sendUnequip,
|
||||
setInfo,
|
||||
setActiveItem,
|
||||
@@ -70,8 +70,8 @@ function Equipment(props) {
|
||||
const specClass = infoType === 'spec' ? 'specs highlight' : 'specs';
|
||||
|
||||
// const classes = `right ${skill ? '' : 'action'}`;
|
||||
const skillList = vboxInfo.items.filter(v => v.skill).map(v => v.v);
|
||||
const specList = vboxInfo.items.filter(v => v.spec).map(v => v.v);
|
||||
const skillList = itemInfo.items.filter(v => v.skill).map(v => v.v);
|
||||
const specList = itemInfo.items.filter(v => v.spec).map(v => v.v);
|
||||
|
||||
|
||||
const skills = range(0, 9).map(i => {
|
||||
|
||||
@@ -26,7 +26,7 @@ function Vbox(args) {
|
||||
vboxHidden,
|
||||
vboxHighlight,
|
||||
setVboxHighlight,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
} = args;
|
||||
|
||||
if (!player) return false;
|
||||
@@ -39,10 +39,10 @@ function Vbox(args) {
|
||||
|
||||
const combinerValues = newCombiner.map(cv => player.vbox.bound[cv]).filter(cv => cv);
|
||||
|
||||
const filteredCombos = vboxInfo.combos
|
||||
const filteredCombos = itemInfo.combos
|
||||
.filter(combo => combinerValues.every(u => combo.units.includes(u)));
|
||||
|
||||
const comboValues = vboxInfo.items.filter(v => {
|
||||
const comboValues = itemInfo.items.filter(v => {
|
||||
if (!filteredCombos.some(c => c.units.includes(v.v))) return false;
|
||||
if (!['Red', 'Green', 'Blue'].includes(v.v) && combinerValues.includes(v.v)) return false;
|
||||
return true;
|
||||
|
||||
@@ -17,7 +17,7 @@ const addState = connect(
|
||||
info,
|
||||
vboxHidden,
|
||||
vboxHighlight,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
} = state;
|
||||
|
||||
function sendVboxApply(i) {
|
||||
@@ -48,7 +48,7 @@ const addState = connect(
|
||||
activeItem,
|
||||
activeCryp,
|
||||
info,
|
||||
vboxInfo,
|
||||
itemInfo,
|
||||
vboxHidden,
|
||||
vboxHighlight,
|
||||
sendVboxAccept,
|
||||
|
||||
Reference in New Issue
Block a user