kopia lustrzana https://github.com/backface/turtlestitch
tweaked unified palette formatting for hidden categories
rodzic
e6aabeb1e8
commit
aa31916165
|
@ -45,6 +45,7 @@
|
|||
* gui, scenes, objects: added scene-setting to hide/show category names in the unified palette
|
||||
* store: made "hide/show categories in unified palette" setting persistent
|
||||
* byob: hide unused blocks in palette
|
||||
* objects: tweaked unified palette formatting for hidden categories
|
||||
|
||||
### 2021-10-11
|
||||
* objects: sort order of blocks in custom categories alphabetically in the unified palette
|
||||
|
|
|
@ -3079,7 +3079,7 @@ SpriteMorph.prototype.freshPalette = function (category) {
|
|||
showCategories = this.parentThatIsA(IDE_Morph).scene.showCategories;
|
||||
blocks = SpriteMorph.prototype.allCategories().reduce(
|
||||
(blocks, category) => {
|
||||
let header = [this.categoryText(category), '-' ],
|
||||
let header = [this.categoryText(category), '-'],
|
||||
primitives = this.getPrimitiveTemplates(category),
|
||||
customs = this.customBlockTemplatesForCategory(category),
|
||||
showHeader = showCategories &&
|
||||
|
@ -3087,10 +3087,17 @@ SpriteMorph.prototype.freshPalette = function (category) {
|
|||
(primitives.some(item =>
|
||||
item instanceof BlockMorph) || customs.length);
|
||||
|
||||
if (!showCategories && category !== 'variables') {
|
||||
primitives = primitives.filter(each =>
|
||||
each !== '-' && each !== '=');
|
||||
}
|
||||
|
||||
return blocks.concat(
|
||||
showHeader ? header : [],
|
||||
primitives, '=',
|
||||
customs, '='
|
||||
primitives,
|
||||
showHeader ? '=' : null,
|
||||
customs,
|
||||
showHeader ? '=' : '-'
|
||||
);
|
||||
},
|
||||
[]
|
||||
|
|
Ładowanie…
Reference in New Issue