include currently dragged sprites in the MY OTHER SPRITES/CLONES lists

snap8
Jens Mönig 2022-05-06 23:29:08 +02:00
rodzic ef3a6e7b18
commit d53a74a52b
3 zmienionych plików z 23 dodań i 20 usunięć

Wyświetl plik

@ -28,6 +28,7 @@
* imported single scripts are now placed into the hand, for the user to position them in the scripting area
* moved "append", "reshape", "combinations" blocks down one group in the palette
* moved "current date" block up to "timer" group in the palette
* include currently dragged sprites in the MY OTHER SPRITES/CLONES lists
* library import dialog makeover for custom categories and hidden blocks, thanks, Michael!
* SciSnap2 extension update (ImagePad), thanks, Eckart!
* MQTT extension update, thanks, Simon!
@ -47,6 +48,9 @@
* **Translation Updates:**
* German
### 2022-05-06
* threads: include currently dragged sprites in the MY OTHER SPRITES/CLONES lists
### 2022-05-03
* threads, byob: tweaked double definition naming

Wyświetl plik

@ -16,7 +16,7 @@
<script src="src/morphic.js?version=2022-04-26"></script>
<script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-17-09"></script>
<script src="src/blocks.js?version=2022-05-02"></script>
<script src="src/blocks.js?version=2022-05-06"></script>
<script src="src/threads.js?version=2022-05-03"></script>
<script src="src/objects.js?version=2022-05-02"></script>
<script src="src/scenes.js?version=2022-03-03"></script>

Wyświetl plik

@ -65,7 +65,7 @@ StagePickerMorph, CustomBlockDefinition*/
/*jshint esversion: 11, bitwise: false, evil: true*/
modules.threads = '2022-May-03';
modules.threads = '2022-May-06';
var ThreadManager;
var Process;
@ -5885,18 +5885,24 @@ Process.prototype.reportGet = function (query) {
stage,
objName;
function allOtherSprites() {
var stage = thisObj.parentThatIsA(StageMorph),
sprites = stage.children.filter(each =>
each instanceof SpriteMorph && each !== thisObj
),
inHand = stage.world().hand.children[0];
if (inHand instanceof SpriteMorph) {
sprites.push(inHand);
}
return sprites;
}
if (thisObj) {
switch (this.inputOption(query)) {
case 'self' :
return thisObj;
case 'other sprites':
stage = thisObj.parentThatIsA(StageMorph);
return new List(
stage.children.filter(each =>
each instanceof SpriteMorph &&
each !== thisObj
)
);
return new List(allOtherSprites());
case 'parts': // shallow copy to disable side-effects
return new List((thisObj.parts || []).map(each => each));
case 'anchor':
@ -5908,13 +5914,10 @@ Process.prototype.reportGet = function (query) {
case 'temporary?':
return thisObj.isTemporary || false;
case 'clones':
stage = thisObj.parentThatIsA(StageMorph);
objName = thisObj.name || thisObj.cloneOriginName;
return new List(
stage.children.filter(each =>
each.isTemporary &&
(each !== thisObj) &&
(each.cloneOriginName === objName)
allOtherSprites().filter(each =>
each.isTemporary && (each.cloneOriginName === objName)
)
);
case 'other clones':
@ -5924,17 +5927,13 @@ Process.prototype.reportGet = function (query) {
// old rectangular, bounding-box-based algorithm
// deprecated in favor of a circular perimeter based newer one
/*
stage = thisObj.parentThatIsA(StageMorph);
neighborhood = thisObj.bounds.expandBy(new Point(
thisObj.width(),
thisObj.height()
));
return new List(
stage.children.filter(each =>
each instanceof SpriteMorph &&
each.isVisible &&
(each !== thisObj) &&
each.bounds.intersects(neighborhood)
allOtherSprites.filter(each =>
each.isVisible && each.bounds.intersects(neighborhood)
)
);
*/