allow api progress overrides

This commit is contained in:
Stewart Allen 2020-07-03 15:45:59 -04:00
commit 56df053bb9

View file

@ -709,13 +709,13 @@
currentPrint = kiri.newPrint(settings, WIDGETS); currentPrint = kiri.newPrint(settings, WIDGETS);
currentPrint.setup(true, function(update, status) { currentPrint.setup(true, function(update, status) {
setProgress(update, status); API.show.progress(update, status);
}, function() { }, function() {
if (!currentPrint) { if (!currentPrint) {
return setViewMode(VIEWS.ARRANGE); return setViewMode(VIEWS.ARRANGE);
} }
setProgress(0); API.show.progress(0);
if (!isCam) setOpacity(0); if (!isCam) setOpacity(0);
currentPrint.render(); currentPrint.render();
@ -842,7 +842,7 @@
} }
// on the last exit, update ui and call the callback // on the last exit, update ui and call the callback
if (--countdown === 0 || error || errored) { if (--countdown === 0 || error || errored) {
setProgress(0); API.show.progress(0);
showSlices(preserveLayer); showSlices(preserveLayer);
SPACE.scene.active(); SPACE.scene.active();
API.event.emit('slice.end', getMode()); API.event.emit('slice.end', getMode());
@ -872,7 +872,7 @@
forAllWidgets(function(w) { forAllWidgets(function(w) {
totalProgress += (track[w.id] || 0); totalProgress += (track[w.id] || 0);
}); });
setProgress((totalProgress / WIDGETS.length), msg); API.show.progress((totalProgress / WIDGETS.length), msg);
}, true); }, true);
}); });
} }