preview combo when you've selected 3 items
This commit is contained in:
parent
4e627fa34b
commit
6c0457f8fd
@ -22,7 +22,7 @@ class InfoComponent extends preact.Component {
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
// Catch case where mouse events don't properly clear state and info changed
|
||||
if (prevProps.info !== this.props.info) this.setState({ comboItem: null });
|
||||
if (prevProps.info !== this.props.info && this.state.comboItem) this.setState({ comboItem: null });
|
||||
}
|
||||
|
||||
render(args) {
|
||||
|
||||
@ -287,7 +287,7 @@ class Vbox extends preact.Component {
|
||||
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||
const combinerCount = countBy(combinerItems, co => co);
|
||||
|
||||
const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => {
|
||||
const comboItem = itemInfo.combos.find(combo => {
|
||||
if (combo.components.includes(v)) {
|
||||
return combinerItems.every(c => {
|
||||
if (!combo.components.includes(c)) return false;
|
||||
@ -297,7 +297,8 @@ class Vbox extends preact.Component {
|
||||
return true;
|
||||
});
|
||||
} return false;
|
||||
}) ? 'combo-border' : '';
|
||||
});
|
||||
const comboHighlight = combinerItems.length > 0 && comboItem ? 'combo-border' : '';
|
||||
|
||||
function onClick(type) {
|
||||
if (vboxSelecting) clearVboxSelected();
|
||||
@ -323,6 +324,7 @@ class Vbox extends preact.Component {
|
||||
}
|
||||
|
||||
combiner.push(i);
|
||||
if (combiner.length === 3) setInfo(comboItem.item);
|
||||
return combinerChange(combiner);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user