kopia lustrzana https://github.com/backface/turtlestitch
revert empty category indication for single palette mode
need to find a better mechanism...snap7
rodzic
af68f7a78e
commit
0073666bd4
|
@ -68,7 +68,6 @@
|
|||
* gui, translations: removed old hidden "virtual keyboard" setting
|
||||
* gui: removed old hidden "project urls" setting
|
||||
* gui: removed hidden "cache inputs" setting (only used for debugging the evaluator)
|
||||
* gui, objects: indicate empty categories in single-palette mode
|
||||
|
||||
### 2021-11-14
|
||||
* locale: contextualize translations
|
||||
|
|
12
src/gui.js
12
src/gui.js
|
@ -1276,14 +1276,6 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
if (cat.state) {
|
||||
cat.scrollIntoView();
|
||||
}
|
||||
|
||||
// indicate whether a category is empty of blocks to show
|
||||
// currently only supported in unified palette mode
|
||||
if (myself.currentSprite.emptyCategoriesCache[cat.category]) {
|
||||
cat.disable();
|
||||
} else {
|
||||
cat.enable();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -1330,7 +1322,6 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
true // has preview
|
||||
);
|
||||
|
||||
button.category = category;
|
||||
button.corner = 8;
|
||||
button.padding = 0;
|
||||
button.labelShadowOffset = new Point(-1, -1);
|
||||
|
@ -1367,7 +1358,6 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
true // has preview
|
||||
);
|
||||
|
||||
button.category = category;
|
||||
button.corner = 8;
|
||||
button.padding = 0;
|
||||
button.labelShadowOffset = new Point(-1, -1);
|
||||
|
@ -2816,7 +2806,6 @@ IDE_Morph.prototype.selectSprite = function (sprite) {
|
|||
}
|
||||
this.currentSprite = sprite;
|
||||
this.scene.currentSprite = sprite;
|
||||
this.categories.refresh(); // indicate empty categories in unified palette
|
||||
this.createPalette();
|
||||
this.createSpriteBar();
|
||||
this.createSpriteEditor();
|
||||
|
@ -6267,7 +6256,6 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) {
|
|||
|
||||
IDE_Morph.prototype.toggleUnifiedPalette = function () {
|
||||
this.setUnifiedPalette(!this.scene.unifiedPalette);
|
||||
this.categories.refresh(); // update empty categories in single palette mode
|
||||
};
|
||||
|
||||
IDE_Morph.prototype.setUnifiedPalette = function (bool) {
|
||||
|
|
|
@ -1870,7 +1870,6 @@ SpriteMorph.prototype.init = function (globals) {
|
|||
|
||||
this.primitivesCache = {}; // not to be serialized (!)
|
||||
this.paletteCache = {}; // not to be serialized (!)
|
||||
this.emptyCategoriesCache = {}; // not to be serialized;
|
||||
this.rotationOffset = ZERO; // not to be serialized (!)
|
||||
this.idx = 0; // not to be serialized (!) - used for de-serialization
|
||||
|
||||
|
@ -1936,7 +1935,6 @@ SpriteMorph.prototype.fullCopy = function (forClone) {
|
|||
c.freqPlayer = null;
|
||||
c.primitivesCache = {};
|
||||
c.paletteCache = {};
|
||||
c.emptyCategoriesCache = {};
|
||||
c.imageData = {};
|
||||
c.cachedColorDimensions = c.color[this.penColorModel]();
|
||||
arr = [];
|
||||
|
@ -3013,14 +3011,6 @@ SpriteMorph.prototype.freshPalette = function (category) {
|
|||
searchButton,
|
||||
makeButton;
|
||||
|
||||
function isEmptyCategory(blocks) {
|
||||
return blocks.filter(each =>
|
||||
each instanceof BlockMorph && !myself.isHidingBlock(each)
|
||||
).length === 0;
|
||||
}
|
||||
|
||||
this.emptyCategoriesCache = {};
|
||||
|
||||
palette.owner = this;
|
||||
palette.padding = unit / 2;
|
||||
palette.color = this.paletteColor;
|
||||
|
@ -3113,11 +3103,6 @@ SpriteMorph.prototype.freshPalette = function (category) {
|
|||
each !== '-' && each !== '=');
|
||||
}
|
||||
|
||||
// update the empty categories cache
|
||||
if (isEmptyCategory(primitives) && isEmptyCategory(customs)) {
|
||||
this.emptyCategoriesCache[category] = true;
|
||||
}
|
||||
|
||||
return blocks.concat(
|
||||
showHeader ? header : [],
|
||||
primitives,
|
||||
|
@ -7787,7 +7772,6 @@ StageMorph.prototype.init = function (globals) {
|
|||
this.keysPressed = {}; // for handling keyboard events, do not persist
|
||||
this.primitivesCache = {}; // not to be serialized (!)
|
||||
this.paletteCache = {}; // not to be serialized (!)
|
||||
this.emptyCategoriesCache = {}; // not to be serialized (!)
|
||||
this.lastAnswer = ''; // last user input, do not persist
|
||||
this.activeSounds = []; // do not persist
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue