Compare commits
No commits in common. "d7ac9e834defd2a7f2ef7bb7082c504f4f498444" and "7931dffca129db838b1c975409674c490d1468ee" have entirely different histories.
d7ac9e834d
...
7931dffca1
5 changed files with 5 additions and 42 deletions
|
@ -152,11 +152,7 @@ const Artboard = function(tp, domElement = false, autoInit = true) {
|
||||||
});
|
});
|
||||||
// should we have an audio object, let's inject the buttons, etc
|
// should we have an audio object, let's inject the buttons, etc
|
||||||
if (typeof audio === 'object' && audio.hasOwnProperty('injectPanel')) {
|
if (typeof audio === 'object' && audio.hasOwnProperty('injectPanel')) {
|
||||||
const success = audio.injectPanel(this);
|
audio.injectPanel(this);
|
||||||
if (success) {
|
|
||||||
const e = new CustomEvent('injectedAll', {});
|
|
||||||
tp.getPanel().dispatchEvent(e);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('Artboard::findInjectPanel', `cannot inject audio panel for ${this.id()} for some reason.`);
|
console.log('Artboard::findInjectPanel', `cannot inject audio panel for ${this.id()} for some reason.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -807,11 +807,6 @@ const Audio = function(tp, record) {
|
||||||
addAudioButton(layer, propTitle, isActive);
|
addAudioButton(layer, propTitle, isActive);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const good = props.length > 1 && props[0] !== 'dummy';
|
|
||||||
if (good) {
|
|
||||||
this.injectedPanelAtLeastOnce = true;
|
|
||||||
}
|
|
||||||
return good;
|
|
||||||
};
|
};
|
||||||
const audioSourceCombos = {};
|
const audioSourceCombos = {};
|
||||||
const readAudioFiles = () => {
|
const readAudioFiles = () => {
|
||||||
|
|
|
@ -802,11 +802,7 @@ const Layer = function(tp, layerID, fontsAndAxes, autoInit = true) {
|
||||||
|
|
||||||
// should we have an audio object, let's inject the buttons, etc
|
// should we have an audio object, let's inject the buttons, etc
|
||||||
if (typeof audio === 'object' && typeof audio.injectPanel === 'function') {
|
if (typeof audio === 'object' && typeof audio.injectPanel === 'function') {
|
||||||
const success = audio.injectPanel(this);
|
audio.injectPanel(this);
|
||||||
if (success) {
|
|
||||||
const e = new CustomEvent('injectedAll', {});
|
|
||||||
tp.getPanel().dispatchEvent(e);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('Layer::findInjectPanel', `cannot inject audio panel for ${this.id()} for some reason.`);
|
console.log('Layer::findInjectPanel', `cannot inject audio panel for ${this.id()} for some reason.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,31 +324,8 @@ const resize = () => {
|
||||||
Module.windowResized(Math.round(width * ratio), Math.round(height * ratio));
|
Module.windowResized(Math.round(width * ratio), Math.round(height * ratio));
|
||||||
};
|
};
|
||||||
|
|
||||||
const setLoadingDoneHook = () => {
|
|
||||||
let addedListener = false;
|
|
||||||
const loadingInjectInterval = setInterval(() => {
|
|
||||||
if (!addedListener) {
|
|
||||||
const panel = tp.getPanel();
|
|
||||||
if (panel !== null) {
|
|
||||||
if (audio.injectedPanelAtLeastOnce) {
|
|
||||||
window.setLoadingDone();
|
|
||||||
} else {
|
|
||||||
addedListener = true;
|
|
||||||
const injectedAll = () => {
|
|
||||||
window.setLoadingDone();
|
|
||||||
tp.getPanel().removeEventListener('injectedAll', injectedAll);
|
|
||||||
};
|
|
||||||
tp.getPanel().addEventListener('injectedAll', injectedAll);
|
|
||||||
}
|
|
||||||
clearInterval(loadingInjectInterval);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 20);
|
|
||||||
};
|
|
||||||
|
|
||||||
const postModuleInitialized = () => {
|
const postModuleInitialized = () => {
|
||||||
window.setLoadingTask('setting up animation', 80);
|
window.setLoadingTask('setting up animation', 80);
|
||||||
setLoadingDoneHook();
|
|
||||||
moduleFS.init()
|
moduleFS.init()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
artboard = new Artboard(tp, content);
|
artboard = new Artboard(tp, content);
|
||||||
|
@ -357,13 +334,13 @@ const postModuleInitialized = () => {
|
||||||
tp.connectModuleCallbacks();
|
tp.connectModuleCallbacks();
|
||||||
exporter.init();
|
exporter.init();
|
||||||
getFontsAndAxes();
|
getFontsAndAxes();
|
||||||
window.setLoadingTask('loading project', 85);
|
|
||||||
tp.loadProject().then(() => {
|
tp.loadProject().then(() => {
|
||||||
interactor.init();
|
interactor.init();
|
||||||
resize();
|
resize();
|
||||||
adjustPanel();
|
adjustPanel();
|
||||||
window.setLoadingTask('setting up whatever else is necessary', 100);
|
window.setLoadingTask('setting up animation', 100);
|
||||||
window.isInitialized = true;
|
window.isInitialized = true;
|
||||||
|
window.setLoadingDone();
|
||||||
window.autoSaveInterval = setInterval(() => {
|
window.autoSaveInterval = setInterval(() => {
|
||||||
if (config.autoSave && window.isInitialized) {
|
if (config.autoSave && window.isInitialized) {
|
||||||
tp.saveProject();
|
tp.saveProject();
|
||||||
|
|
|
@ -702,7 +702,6 @@ const TheatrePlay = function(autoInit = false) {
|
||||||
const defaultArtboardValues = window.getArtboard().theatreObject.value;
|
const defaultArtboardValues = window.getArtboard().theatreObject.value;
|
||||||
const artboardProps = {...defaultArtboardValues, ...artboardValues};
|
const artboardProps = {...defaultArtboardValues, ...artboardValues};
|
||||||
|
|
||||||
window.setLoadingTask('setting up artboard', 90);
|
|
||||||
studio.transaction(({
|
studio.transaction(({
|
||||||
set
|
set
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -720,7 +719,6 @@ const TheatrePlay = function(autoInit = false) {
|
||||||
Object.keys(objects)
|
Object.keys(objects)
|
||||||
.filter((e) => e.indexOf('layer-') === 0)
|
.filter((e) => e.indexOf('layer-') === 0)
|
||||||
.forEach((layerId) => {
|
.forEach((layerId) => {
|
||||||
window.setLoadingTask(`setting up the shapes of ${layerId} to come`, 90);
|
|
||||||
window.project_fontsHashMap = project.fontsHashMap;
|
window.project_fontsHashMap = project.fontsHashMap;
|
||||||
layerPromises.push(window.addExistingLayer(layerId, objects[layerId]));
|
layerPromises.push(window.addExistingLayer(layerId, objects[layerId]));
|
||||||
});
|
});
|
||||||
|
@ -731,6 +729,7 @@ const TheatrePlay = function(autoInit = false) {
|
||||||
getLayers().forEach((layer) => {
|
getLayers().forEach((layer) => {
|
||||||
if (layer.id() === project.layerOrder[project.layerOrder.length - 1]) {
|
if (layer.id() === project.layerOrder[project.layerOrder.length - 1]) {
|
||||||
layer.select();
|
layer.select();
|
||||||
|
// add audio mapping?
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue