added new "label" selector to OF BLOCK's block dropdown

snap8
Jens Mönig 2022-04-08 15:39:16 +02:00
rodzic d30e7d2827
commit f992a35e5f
4 zmienionych plików z 19 dodań i 4 usunięć

Wyświetl plik

@ -12,6 +12,7 @@
* new MOUSE POSITION primitive reporter in the SENSING category
* new "position" choice in OF reporter's attribute dropdown, reports a list of XY coordinates
* new "categories" choice in MY reporter's dropdown, reports an ordered list of all category names whose indices match the "category" reported elsewhere
* new "label" choice in the OF BLOCK block-attribute reporter's dropdown
* new localization extension primitives in the "ide" category, hyperized
* new support for setting the translation via the API
* new "Tad" costume series, thanks, Meghan and Brian!
@ -38,6 +39,9 @@
* **Translation Updates:**
* German
### 2022-04-08
* blocks, threads: added new "label" selector to OF BLOCK's block dropdown
### 2022-04-07
* extensions: added "translateback" extension primitive
* extensions: hyperized "translate" extension primitive

Wyświetl plik

@ -16,8 +16,8 @@
<script src="src/morphic.js?version=2022-01-28"></script>
<script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-17-09"></script>
<script src="src/blocks.js?version=2022-03-31"></script>
<script src="src/threads.js?version=2022-03-31"></script>
<script src="src/blocks.js?version=2022-04-08"></script>
<script src="src/threads.js?version=2022-04-08"></script>
<script src="src/objects.js?version=2022-04-04"></script>
<script src="src/scenes.js?version=2022-03-03"></script>
<script src="src/gui.js?version=2022-04-06"></script>

Wyświetl plik

@ -161,7 +161,7 @@ CostumeIconMorph, SoundIconMorph, SVG_Costume*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2022-March-31';
modules.blocks = '2022-April-08';
var SyntaxElementMorph;
var BlockMorph;
@ -801,6 +801,7 @@ SyntaxElementMorph.prototype.labelParts = {
type: 'input',
tags: 'read-only static',
menu: {
'label': ['label'],
'definition': ['definition'],
'category': ['category'],
'custom?': ['custom?'],
@ -2960,6 +2961,14 @@ BlockMorph.prototype.rebuild = function (contrast) {
}
};
BlockMorph.prototype.abstractBlockSpec = function () {
// answer the semantic block spec substituting each input
// with an underscore. Used as "name" of the Block.
return this.parseSpec(this.blockSpec).map(str =>
(str.length > 1 && (str[0]) === '%') ? '_' : str
).join(' ');
};
// BlockMorph menu:
BlockMorph.prototype.userMenu = function () {

Wyświetl plik

@ -65,7 +65,7 @@ StagePickerMorph*/
/*jshint esversion: 6, bitwise: false, evil: true*/
modules.threads = '2022-March-31';
modules.threads = '2022-April-08';
var ThreadManager;
var Process;
@ -5591,6 +5591,8 @@ Process.prototype.reportBasicBlockAttribute = function (attribute, block) {
this.assertType(block, ['command', 'reporter', 'predicate']);
expr = block.expression;
switch (choice) {
case 'label':
return expr ? expr.abstractBlockSpec() : '';
case 'definition':
if (expr.isCustomBlock) {
if (expr.isGlobal) {