From 4c0260d5ffae6cc85d64e0907b818b5a85eadc1d Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 1 Mar 2023 21:54:53 +0100 Subject: [PATCH] deactivate custom category creation via menu for now --- index.html | 2 +- stitchcode/gui.js | 2 +- stitchcode/objects.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index bf4a0b3f..9e3801a8 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + diff --git a/stitchcode/gui.js b/stitchcode/gui.js index 28939ef9..eb410475 100644 --- a/stitchcode/gui.js +++ b/stitchcode/gui.js @@ -1,4 +1,4 @@ -VERSION="2.7.14" +VERSION="2.7.15" // get debug mode url = new URL(window.location.href); diff --git a/stitchcode/objects.js b/stitchcode/objects.js index 2ede996a..af37bffe 100644 --- a/stitchcode/objects.js +++ b/stitchcode/objects.js @@ -3374,6 +3374,7 @@ StageMorph.prototype.clearStageBackground = function() { myself.hasChangedMedia = true; }; + StageMorph.prototype.loadCameraSnapshot = function() { var myself = this; var ide = this.parentThatIsA(IDE_Morph); @@ -3391,3 +3392,32 @@ StageMorph.prototype.loadCameraSnapshot = function() { camDialog.key = 'camera'; camDialog.popUp(this.world()); }; + + +// overwrite palette and menu (to hide make new categories) +SpriteMorph.prototype.palette = function (category) { + if (!this.paletteCache[category]) { + this.paletteCache[category] = this.freshPalette(category); + this.paletteCache[category].userMenu = function () { + var menu = new MenuMorph(); + menu.addPair( + [ + new SymbolMorph( + 'magnifyingGlass', + MorphicPreferences.menuFontSize + ), + localize('find blocks') + '...' + ], + () => myself.searchBlocks(), + '^F' + ); + menu.addItem( + 'hide blocks...', + () => new BlockVisibilityDialogMorph(myself).popUp(myself.world()) + ); + return menu; + }; + + } + return this.paletteCache[category]; +};