keep info as vbox selected if base item

This commit is contained in:
Mashy 2019-10-28 13:06:09 +10:00
parent 5e137af159
commit 5e41d92e15

View File

@ -161,9 +161,10 @@ class Vbox extends preact.Component {
function vboxHover(e, v) {
if (v) {
e.stopPropagation();
if (vboxSelected[0]) return true; // There is a base skill or spec selected in the vbox
if (combiner.length !== 0) {
const base = combiner.find(c => !['Red', 'Blue', 'Green'].includes(vbox.bound[c]));
if (base || base === 0) return setInfo(vbox.bound[base]);
if (base || base === 0) return true;
}
if (info !== v) setInfo(v);
}
@ -199,6 +200,7 @@ class Vbox extends preact.Component {
setCombiner([]);
if (selected) return clearVboxSelected();
setInfo(vbox.free[group][index]);
return setVboxSelected([group, index]);
}