info stuff

This commit is contained in:
ntr 2019-04-03 23:59:00 +11:00
parent 13cd21c925
commit 6ca0ed86f4
5 changed files with 20 additions and 21 deletions

View File

@ -29,7 +29,7 @@ export const SET_ACTIVE_SKILL = 'SET_ACTIVE_SKILL';
export const setActiveSkill = (crypId, skill) => ({ type: SET_ACTIVE_SKILL, value: crypId ? { crypId, skill } : null });
export const SET_INFO = 'SET_INFO';
export const setInfo = value => ({ type: SET_INFO, value: Array.from(value) });
export const setInfo = value => ({ type: SET_INFO, value });
export const SET_RECLAIMING = 'SET_RECLAIMING';
export const setReclaiming = value => ({ type: SET_RECLAIMING, value });

View File

@ -44,27 +44,26 @@ function Info(args) {
<div className="info-specs">
{specs}
</div>
</div>
);
}
/*if (item) {
if (SKILLS[item]) {
itemDetails = SKILLS[item];
} else if (SPECS[item]) {
itemDetails = SPECS[item];
} else if (COLOURS[item]) {
itemDetails = COLOURS[item];
if (type === 'item') {
let itemDetails;
if (SKILLS[value]) {
itemDetails = SKILLS[value];
} else if (SPECS[value]) {
itemDetails = SPECS[value];
} else if (COLOURS[value]) {
itemDetails = COLOURS[value];
}
}*/
/* const unequip = (itemDetails && cryp)
? <button onClick={() => sendUnequip(cryp.id, item)}> unequip </button>
: null;
*/
return (
<div className="instance-info">
{itemDetails}
</div>
);
}
}
module.exports = Info;

View File

@ -45,7 +45,7 @@ const addState = connect(
}
function setInfo(type, info) {
return dispatch(actions.setInfo(type, info));
return dispatch(actions.setInfo([type, info]));
}

View File

@ -32,8 +32,8 @@ function registerEvents(store) {
store.dispatch(actions.setActiveSkill(skill));
}
function setInfo(info) {
store.dispatch(actions.setInfo(info));
function clearInfo(info) {
store.dispatch(actions.setInfo([]));
console.log('event clear item');
}
@ -204,7 +204,7 @@ function registerEvents(store) {
setCryps,
setCrypList,
setGame,
setInfo,
clearInfo,
setMenu,
setPlayer,
setInstanceList,

View File

@ -95,7 +95,7 @@ function createSocket(events) {
function sendVboxUnequip(instanceId, crypId, target) {
send({ method: 'player_vbox_unequip', params: { instance_id: instanceId, cryp_id: crypId, target } });
events.setInfo([]);
events.clearInfo();
}
function sendVboxDiscard(instanceId) {