shift-click on STOP button to stop all scenes

snap8
Jens Mönig 2022-03-03 20:51:45 +01:00
rodzic cebe370de0
commit 9be2b5f7a0
5 zmienionych plików z 24 dodań i 10 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
* **New Features:**
* variadic commutative infix reporters
* shift-click on STOP button to stop all scenes
* **Notable Changes:**
* SciSnap2 extension update (FFT), thanks, Eckart!
* removed now redundant variadic reporters from the variadic reporters library
@ -15,6 +16,7 @@
### 2022-03-03
* SciSnap2 extension update (FFT), thanks, Eckart!
* threads: removed experimental code
* scenes, gui: shift-click on STOP button to stop all scenes
### 2022-03-02
* gui: never close a dev-warning

Wyświetl plik

@ -19,8 +19,8 @@
<script src="src/blocks.js?version=2022-03-01"></script>
<script src="src/threads.js?version=2022-03-03"></script>
<script src="src/objects.js?version=2022-03-01"></script>
<script src="src/scenes.js?version=2021-11-24"></script>
<script src="src/gui.js?version=2022-03-02"></script>
<script src="src/scenes.js?version=2022-03-03"></script>
<script src="src/gui.js?version=2022-03-03"></script>
<script src="src/paint.js?version=2021-07-05"></script>
<script src="src/lists.js?version=2022-02-07"></script>
<script src="src/byob.js?version=2022-02-17"></script>

Wyświetl plik

@ -86,7 +86,7 @@ BlockVisibilityDialogMorph, ThreadManager*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2022-March-02';
modules.gui = '2022-March-03';
// Declarations
@ -2830,11 +2830,10 @@ IDE_Morph.prototype.isPaused = function () {
};
IDE_Morph.prototype.stopAllScripts = function () {
if (this.stage.enableCustomHatBlocks) {
this.stage.threads.pauseCustomHatBlocks =
!this.stage.threads.pauseCustomHatBlocks;
if (this.world().currentKey === 16) { // shiftClicked
this.scenes.map(scn => scn.stop());
} else {
this.stage.threads.pauseCustomHatBlocks = false;
this.scene.stop();
}
this.controlBar.stopButton.refresh();
this.stage.fireStopAllEvent();

Wyświetl plik

@ -8768,7 +8768,7 @@ StageMorph.prototype.fireGreenFlagEvent = function () {
return procs;
};
StageMorph.prototype.fireStopAllEvent = function () {
StageMorph.prototype.fireStopAllEvent = function () { // +++
var ide = this.parentThatIsA(IDE_Morph);
this.threads.resumeAll(this.stage);

Wyświetl plik

@ -7,7 +7,7 @@
written by Jens Mönig
jens@moenig.org
Copyright (C) 2021 by Jens Mönig
Copyright (C) 2022 by Jens Mönig
This file is part of Snap!.
@ -53,7 +53,7 @@ normalizeCanvas, SnapSerializer, Costume, ThreadManager*/
// Global stuff ////////////////////////////////////////////////////////
modules.scenes = '2021-November-24';
modules.scenes = '2022-March-03';
// Projecct /////////////////////////////////////////////////////////
@ -184,6 +184,8 @@ Scene.prototype.addDefaultSprite = function () {
return sprite;
};
// Scene - capturing global state locally:
Scene.prototype.captureGlobalSettings = function () {
this.hiddenPrimitives = StageMorph.prototype.hiddenPrimitives;
this.codeMappings = StageMorph.prototype.codeMappings;
@ -217,6 +219,17 @@ Scene.prototype.applyGlobalSettings = function () {
SpriteMorph.prototype.penColorModel = this.penColorModel;
};
// Scene ops:
Scene.prototype.updateTrash = function () {
this.trash = this.trash.filter(sprite => sprite.isCorpse);
};
Scene.prototype.stop = function () {
if (this.stage.enableCustomHatBlocks) {
this.stage.threads.pauseCustomHatBlocks =
!this.stage.threads.pauseCustomHatBlocks;
} else {
this.stage.threads.pauseCustomHatBlocks = false;
}
};