added new category feature to palette context menu

snap7
jmoenig 2021-07-22 14:27:05 +02:00
rodzic a160520abb
commit bdbb5da2d7
3 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -34,6 +34,7 @@
* objects: enabled custom categories for the stage
* store: load user defined palettes
* gui: restore custom palettes when activating a scene
* added new category feature to palette context menu
### 2021-07-21
* user defined custom block palettes, under construction

Wyświetl plik

@ -4926,15 +4926,16 @@ IDE_Morph.prototype.createNewCategory = function () {
this
).promptCategory(
"New Palette",
'Category name',
new Color(0,214,126),
null,
new Color(0,116,143),
this.world(),
null, // pic
null // msg
'Blocks category name:' // msg
);
};
IDE_Morph.prototype.addPaletteCategory = function (name, color) {
if (name === '') {return; }
SpriteMorph.prototype.customCategories.set(name, color);
this.createCategories();
this.createPaletteHandle();

Wyświetl plik

@ -3121,6 +3121,10 @@ SpriteMorph.prototype.freshPalette = function (category) {
}
);
}
menu.addItem(
'make a palette...',
() => this.parentThatIsA(IDE_Morph).createNewCategory()
);
return menu;
};