more project loading structure refactorings

snap7
jmoenig 2021-04-21 18:21:33 +02:00
rodzic 69f7e99900
commit a558af4552
3 zmienionych plików z 14 dodań i 5 usunięć

Wyświetl plik

@ -9,7 +9,7 @@
* made scrollbars in the wardrobe and jukebox more responsive
### 2021-04-21
* store: refactored project loading structure
* store, gui: refactored project loading structure
### 2021-04-20
* scenes, store, gui: multi-scene project serialization format, first pass

Wyświetl plik

@ -12,7 +12,7 @@
<script src="src/threads.js?version=2021-04-12"></script>
<script src="src/objects.js?version=2021-04-12"></script>
<script src="src/scenes.js?version=2021-04-20"></script>
<script src="src/gui.js?version=2021-04-20"></script>
<script src="src/gui.js?version=2021-04-21"></script>
<script src="src/paint.js?version=2021-03-17"></script>
<script src="src/lists.js?version=2021-03-15"></script>
<script src="src/byob.js?version=2021-03-05"></script>

Wyświetl plik

@ -83,7 +83,7 @@ Animation, BoxMorph, BlockEditorMorph, BlockDialogMorph, Project, ZERO, BLACK*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2021-April-20';
modules.gui = '2021-April-21';
// Declarations
@ -5410,7 +5410,7 @@ IDE_Morph.prototype.rawOpenDataString = function (str, name, type) {
}
};
IDE_Morph.prototype.openProject = function (name) {
IDE_Morph.prototype.openProjectName = function (name) {
var str;
if (name) {
this.showMessage('opening project\n' + name);
@ -5421,6 +5421,15 @@ IDE_Morph.prototype.openProject = function (name) {
}
};
IDE_Morph.prototype.openProject = function (project) {
if (this.isAddingScenes) {
project.scenes.itemsArray().forEach(scene => this.scenes.add(scene));
} else {
this.scenes = project.scenes;
}
this.switchToScene(project.scenes.at(1), true); // refresh album
};
IDE_Morph.prototype.openScene = function (scene) {
if (!this.isAddingScenes) {
this.scenes = new List();
@ -7615,7 +7624,7 @@ ProjectDialogMorph.prototype.openProject = function () {
} else { // 'local'
this.ide.source = null;
this.ide.backup(() => this.ide.openProject(proj.name));
this.ide.backup(() => this.ide.openProjectName(proj.name));
this.destroy();
}
};