fix highlighting issues

This commit is contained in:
ntr 2019-11-28 17:30:06 +10:00
parent 91c82324e2
commit 11ec807ae2
3 changed files with 10 additions and 4 deletions

View File

@ -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 });

View File

@ -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 };

View File

@ -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)));
}