diff --git a/client/src/actions.jsx b/client/src/actions.jsx index 00b32e31..f6745548 100644 --- a/client/src/actions.jsx +++ b/client/src/actions.jsx @@ -49,7 +49,7 @@ export const setTeamSelect = value => ({ type: 'SET_TEAM_SELECT', value: Array.f export const setTutorial = value => ({ type: 'SET_TUTORIAL', value }); export const setTutorialGame = value => ({ type: 'SET_TUTORIAL_GAME', value }); -export const setVboxSelected = value => ({ type: 'SET_VBOX_SELECTED', value }); +export const setVboxSelected = value => ({ type: 'SET_VBOX_SELECTED', value: Object.create(value) }); export const setVboxCombiner = value => ({ type: 'SET_VBOX_COMBINER', value }); export const setVboxHighlight = value => ({ type: 'SET_VBOX_HIGHLIGHT', value }); export const setVboxInfo = value => ({ type: 'SET_VBOX_INFO', value }); diff --git a/client/src/components/vbox.utils.jsx b/client/src/components/vbox.utils.jsx index e40a0b2e..030d308e 100644 --- a/client/src/components/vbox.utils.jsx +++ b/client/src/components/vbox.utils.jsx @@ -21,7 +21,7 @@ function setVboxState(dispatch, vboxSelected, state) { let vboxCombiner = false; let vboxHighlight = false; - if (!(storeSelect.length === 0 && stashSelect.length === 0)) { + if (storeSelect.length || stashSelect.length) { vboxHighlight = []; const stashItems = stashSelect.map(j => vbox.stash[j]); const shopItems = storeSelect.map(j => vbox.store[j[0]][j[1]]); @@ -66,7 +66,7 @@ function setVboxState(dispatch, vboxSelected, state) { dispatch(actions.setVboxInfo(vboxInfo())); dispatch(actions.setVboxCombiner(vboxCombiner)); - dispatch(actions.setVboxHighlight(vboxHighlight)); + dispatch(actions.setVboxHighlight(vboxHighlight.length ? vboxHighlight : null)); } function genItemInfo(item, itemInfo, player) { @@ -124,5 +124,10 @@ function genItemInfo(item, itemInfo, player) { ); } +function cost(group) { + if (group === 'Colours') return 1; + if (group === 'Skills') return 2; + if (group === 'Specs') return 3; +}; -module.exports = { setVboxState, genItemInfo }; +module.exports = { setVboxState, genItemInfo, cost }; diff --git a/client/src/keyboard.jsx b/client/src/keyboard.jsx index 43d7343b..cca738f9 100644 --- a/client/src/keyboard.jsx +++ b/client/src/keyboard.jsx @@ -10,6 +10,7 @@ function setupKeys(store) { key('esc', () => store.dispatch(actions.setInfo(null))); key('esc', () => store.dispatch(actions.setItemUnequip([]))); key('esc', () => store.dispatch(actions.setVboxSelected({ storeSelect: [], stashSelect: [] }))); + key('esc', () => store.dispatch(actions.setVboxHighlight(null))); key('esc', () => store.dispatch(actions.setMtxActive(null))); }