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 setActiveSkill = (crypId, skill) => ({ type: SET_ACTIVE_SKILL, value: crypId ? { crypId, skill } : null });
export const SET_INFO = 'SET_INFO'; 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 SET_RECLAIMING = 'SET_RECLAIMING';
export const setReclaiming = value => ({ type: SET_RECLAIMING, value }); export const setReclaiming = value => ({ type: SET_RECLAIMING, value });

View File

@ -44,27 +44,26 @@ function Info(args) {
<div className="info-specs"> <div className="info-specs">
{specs} {specs}
</div> </div>
</div> </div>
); );
} }
/*if (item) { if (type === 'item') {
if (SKILLS[item]) { let itemDetails;
itemDetails = SKILLS[item]; if (SKILLS[value]) {
} else if (SPECS[item]) { itemDetails = SKILLS[value];
itemDetails = SPECS[item]; } else if (SPECS[value]) {
} else if (COLOURS[item]) { itemDetails = SPECS[value];
itemDetails = COLOURS[item]; } 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; module.exports = Info;

View File

@ -45,7 +45,7 @@ const addState = connect(
} }
function setInfo(type, info) { 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)); store.dispatch(actions.setActiveSkill(skill));
} }
function setInfo(info) { function clearInfo(info) {
store.dispatch(actions.setInfo(info)); store.dispatch(actions.setInfo([]));
console.log('event clear item'); console.log('event clear item');
} }
@ -204,7 +204,7 @@ function registerEvents(store) {
setCryps, setCryps,
setCrypList, setCrypList,
setGame, setGame,
setInfo, clearInfo,
setMenu, setMenu,
setPlayer, setPlayer,
setInstanceList, setInstanceList,

View File

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