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