kopia lustrzana https://github.com/backface/turtlestitch
				
				
				
			added new category feature to palette context menu
							rodzic
							
								
									a160520abb
								
							
						
					
					
						commit
						bdbb5da2d7
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3121,6 +3121,10 @@ SpriteMorph.prototype.freshPalette = function (category) {
 | 
			
		|||
                }
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        menu.addItem(
 | 
			
		||||
            'make a palette...',
 | 
			
		||||
            () => this.parentThatIsA(IDE_Morph).createNewCategory()
 | 
			
		||||
        );
 | 
			
		||||
        return menu;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue