mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-20 15:32:57 +01:00
17 lines
No EOL
606 B
JavaScript
17 lines
No EOL
606 B
JavaScript
export function checkForSelectedFaces(amount) {
|
|
return (state, app) => {
|
|
state.enabled = app.viewer.selectionMgr.selection.length >= amount;
|
|
if (!state.enabled) {
|
|
state.hint = amount == 1 ? 'requires a face to be selected' : 'requires ' + amount + ' faces to be selected';
|
|
}
|
|
}
|
|
}
|
|
|
|
export function checkForSelectedSolids(amount) {
|
|
return (state, app) => {
|
|
state.enabled = app.viewer.selectionMgr.selection.length >= amount;
|
|
if (!state.enabled) {
|
|
state.hint = amount == 1 ? 'requires a solid to be selected' : 'requires ' + amount + ' solids to be selected';
|
|
}
|
|
}
|
|
} |