mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-15 21:05:22 +01:00
17 lines
No EOL
586 B
JavaScript
17 lines
No EOL
586 B
JavaScript
export function checkForSelectedFaces(amount) {
|
|
return (state, app) => {
|
|
state.enabled = app.getFaceSelection().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.getFaceSelection().length >= amount;
|
|
if (!state.enabled) {
|
|
state.hint = amount === 1 ? 'requires a solid to be selected' : 'requires ' + amount + ' solids to be selected';
|
|
}
|
|
}
|
|
} |