separate init bindings

This commit is contained in:
Stewart Allen 2025-12-25 12:27:13 -05:00
commit b79c8da8e2
9 changed files with 288 additions and 241 deletions

View file

@ -105,29 +105,37 @@ function cleanup() {
api.event.on('key.esc', endIt);
api.event.on('tool.camera.focus', (fn) => {
function startFocus(fn) {
opName = 'camera focus';
onDone = fn;
startIt();
});
}
api.event.on('tool.mesh.face-up', () => {
function startFaceUp() {
opName = 'face select';
onDone = onFaceUpSelect;
startIt();
});
}
api.event.on('tool.mesh.lay-flat', () => {
function startLayFlat() {
opName = 'lay flat';
onDone = onLayFlatSelect;
startIt();
});
}
api.event.on('tool.mesh.lefty', () => {
function startLeftAlign() {
opName = 'align y axis';
onDone = onLeftySelect;
startIt();
});
}
api.event.on('tool.camera.focus', startFocus);
api.event.on('tool.mesh.face-up', startFaceUp);
api.event.on('tool.mesh.lay-flat', startLayFlat);
api.event.on('tool.mesh.lefty', startLeftAlign);
function scale() {
let cam = space.internals().camera;
@ -187,4 +195,16 @@ api.event.on('mouse.hover.up', (ev) => {
});
export { onLayFlatSelect, onFaceUpSelect, startIt, endIt, cleanup, scale, onDone };
export {
cleanup,
endIt,
onDone,
onFaceUpSelect,
onLayFlatSelect,
scale,
startFaceUp,
startFocus,
startIt,
startLeftAlign,
startLayFlat,
};