kopia lustrzana https://github.com/backface/turtlestitch
programmatically hide individual variables in palette
rodzic
28c66fb411
commit
12ff563071
|
@ -37,6 +37,9 @@
|
|||
* German
|
||||
* Chinese, thanks, Simon!
|
||||
|
||||
### 2021-10-06
|
||||
* threads: programmatically hide individual variables in palette
|
||||
|
||||
### 2021-10-05
|
||||
* threads, store: added infrastructure for hiding individual variables in palette
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<script src="src/symbols.js?version=2021-03-03"></script>
|
||||
<script src="src/widgets.js?version=2021-07-21"></script>
|
||||
<script src="src/blocks.js?version=2021-10-04"></script>
|
||||
<script src="src/threads.js?version=2021-10-05"></script>
|
||||
<script src="src/threads.js?version=2021-10-06"></script>
|
||||
<script src="src/objects.js?version=2021-10-04"></script>
|
||||
<script src="src/scenes.js?version=2021-07-21"></script>
|
||||
<script src="src/gui.js?version=2021-09-30"></script>
|
||||
|
|
|
@ -64,7 +64,7 @@ SnapExtensions, AlignmentMorph, TextMorph, Cloud*/
|
|||
|
||||
/*jshint esversion: 6*/
|
||||
|
||||
modules.threads = '2021-October-05';
|
||||
modules.threads = '2021-October-06';
|
||||
|
||||
var ThreadManager;
|
||||
var Process;
|
||||
|
@ -1839,7 +1839,17 @@ Process.prototype.doRemoveTemporaries = function () {
|
|||
}
|
||||
};
|
||||
|
||||
// Process hiding and showing primitives primitives :-)
|
||||
// Process hiding and showing blocks in the palette
|
||||
|
||||
Process.prototype.doChangeBlockVisibility = function (aBlock, hideIt) {
|
||||
if (aBlock.isCustomBlock) {
|
||||
this.doChangeCustomBlockVisibility(aBlock, hideIt);
|
||||
} else if (aBlock.spec === 'reportGetVar') {
|
||||
this.doChangeVarBlockVisibility(aBlock.blockSpec, hideIt);
|
||||
} else {
|
||||
this.doChangePrimitiveVisibility(aBlock, hideIt);
|
||||
}
|
||||
};
|
||||
|
||||
Process.prototype.doChangePrimitiveVisibility = function (aBlock, hideIt) {
|
||||
var ide = this.homeContext.receiver.parentThatIsA(IDE_Morph),
|
||||
|
@ -1864,9 +1874,8 @@ Process.prototype.doChangePrimitiveVisibility = function (aBlock, hideIt) {
|
|||
if (cat === 'lists') {cat = 'variables'; }
|
||||
ide.flushBlocksCache(cat);
|
||||
ide.refreshPalette();
|
||||
};
|
||||
|
||||
// Process hiding and showing custom blocks primitives
|
||||
};
|
||||
|
||||
Process.prototype.doChangeCustomBlockVisibility = function (aBlock, hideIt) {
|
||||
var ide = this.homeContext.receiver.parentThatIsA(IDE_Morph),
|
||||
|
@ -1880,6 +1889,14 @@ Process.prototype.doChangeCustomBlockVisibility = function (aBlock, hideIt) {
|
|||
ide.refreshPalette();
|
||||
};
|
||||
|
||||
Process.prototype.doChangeVarBlockVisibility = function (name, hideIt) {
|
||||
var rcvr = this.blockReceiver(),
|
||||
ide = rcvr.parentThatIsA(IDE_Morph);
|
||||
rcvr.variables.find(name).vars[name].isHidden = !!hideIt;
|
||||
ide.flushBlocksCache('variables');
|
||||
ide.refreshPalette();
|
||||
};
|
||||
|
||||
// Process sprite inheritance primitives
|
||||
|
||||
Process.prototype.doDeleteAttr = function (attrName) {
|
||||
|
|
Ładowanie…
Reference in New Issue