kopia lustrzana https://github.com/backface/turtlestitch
added method to check whether an arbitrary block is hidden in the palette
rodzic
13590e4b91
commit
4e80d7cb0c
|
@ -43,6 +43,7 @@
|
|||
* threads: keep hidden variables out of the palette and drop-down menus
|
||||
* objects: added utilities to enumerate all palette blocks for hiding & showing
|
||||
* objects, threads, extensions: refactored block hiding methods
|
||||
* objects: added method to check whether an arbitrary block is hidden in the palette
|
||||
|
||||
### 2021-10-05
|
||||
* threads, store: added infrastructure for hiding individual variables in palette
|
||||
|
|
|
@ -3248,6 +3248,19 @@ SpriteMorph.prototype.allPaletteBlocks = function () {
|
|||
return blocks.filter(each => each instanceof BlockMorph);
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.isHidingBlock = function (aBlock) {
|
||||
if (aBlock.isCustomBlock) {
|
||||
return (
|
||||
aBlock.isGlobal ? aBlock.definition
|
||||
: this.getLocalMethod(aBlock.semanticSpec)
|
||||
).isHelper;
|
||||
}
|
||||
if (aBlock.selector === 'reportGetVar') {
|
||||
return this.variables.find(name).vars[aBlock.blockSpec].isHidden;
|
||||
}
|
||||
return StageMorph.prototype.hiddenPrimitives[aBlock.selector] === true;
|
||||
};
|
||||
|
||||
SpriteMorph.prototype.changeBlockVisibility = function (aBlock, hideIt) {
|
||||
if (aBlock.isCustomBlock) {
|
||||
this.changeCustomBlockVisibility(aBlock, hideIt);
|
||||
|
@ -9394,6 +9407,8 @@ StageMorph.prototype.searchBlocks = SpriteMorph.prototype.searchBlocks;
|
|||
StageMorph.prototype.allPaletteBlocks
|
||||
= SpriteMorph.prototype.allPaletteBlocks;
|
||||
|
||||
StageMorph.prototype.isHidingBlock = SpriteMorph.prototype.isHidingBlock;
|
||||
|
||||
StageMorph.prototype.changeBlockVisibility
|
||||
= SpriteMorph.prototype.changeBlockVisibility;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue