Merge pull request from towerofnix/misc-noop-blocks

Add micellaneous no-op obsolete blocks
This commit is contained in:
kchadha 2018-05-01 15:30:29 -04:00 committed by GitHub
commit a75c6b44b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 88 additions and 0 deletions

View file

@ -146,6 +146,23 @@ Blockly.Blocks['looks_hide'] = {
}
};
Blockly.Blocks['looks_hideallsprites'] = {
/**
* Hide-all-sprites block. Does not actually do anything. This is an
* obsolete block that is implemented for compatibility with Scratch 2.0
* projects.
* @this Blockly.Block
*/
init: function() {
this.jsonInit(
{
"message0": Blockly.Msg.LOOKS_HIDEALLSPRITES,
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
}
};
Blockly.Blocks['looks_changeeffectby'] = {
/**
* Block to change graphic effect.
@ -281,6 +298,57 @@ Blockly.Blocks['looks_size'] = {
}
};
Blockly.Blocks['looks_changestretchby'] = {
/**
* Block to change stretch. Does not actually do anything. This is an
* obsolete block that is implemented for compatibility with Scratch 1.4
* projects as well as 2.0 projects that still have the block.
* The "stretch" blocks were introduced in very early versions of Scratch,
* but their functionality was removed shortly later. They still appeared
* correctly up until (and including) Scratch 1.4 - as "change stretch by"
* and "set stretch to" - but were removed altogether in Scratch 2.0, and
* displayed as red "undefined" blocks. Some Scratch projects still contain
* these blocks, however, and they don't open in 3.0 unless the blocks
* actually exist (though they still don't funcitonally do anything).
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_CHANGESTRETCHBY,
"args0": [
{
"type": "input_value",
"name": "CHANGE"
}
],
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
}
};
Blockly.Blocks['looks_setstretchto'] = {
/**
* Block to set stretch. Does not actually do anything. This is an obsolete
* block that is implemented for compatibility with Scratch 1.4 projects
* (see looks_changestretchby).
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_SETSTRETCHTO,
"args0": [
{
"type": "input_value",
"name": "STRETCH"
}
],
"category": Blockly.Categories.looks,
"extensions": ["colours_looks", "shape_statement"]
});
}
};
Blockly.Blocks['looks_costume'] = {
/**
* Costumes drop-down menu.

View file

@ -523,3 +523,19 @@ Blockly.Blocks['sensing_username'] = {
});
}
};
Blockly.Blocks['sensing_userid'] = {
/**
* Block to report user's ID. Does not actually do anything. This is an
* obsolete block that is implemented for compatibility with Scratch 2.0
* projects.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_USERID,
"category": Blockly.Categories.sensing,
"extensions": ["colours_sensing", "output_number"]
});
}
};

View file

@ -90,6 +90,7 @@ Blockly.Msg.LOOKS_THINKFORSECS = "think %1 for %2 seconds";
Blockly.Msg.LOOKS_THINK = "think %1";
Blockly.Msg.LOOKS_SHOW = "show";
Blockly.Msg.LOOKS_HIDE = "hide";
Blockly.Msg.LOOKS_HIDEALLSPRITES = "hide all sprites";
Blockly.Msg.LOOKS_EFFECT_COLOR = "color";
Blockly.Msg.LOOKS_EFFECT_FISHEYE = "fisheye";
Blockly.Msg.LOOKS_EFFECT_WHIRL = "whirl";
@ -103,6 +104,8 @@ Blockly.Msg.LOOKS_CLEARGRAPHICEFFECTS = "clear graphic effects";
Blockly.Msg.LOOKS_CHANGESIZEBY = "change size by %1";
Blockly.Msg.LOOKS_SETSIZETO = "set size to %1 %";
Blockly.Msg.LOOKS_SIZE = "size";
Blockly.Msg.LOOKS_CHANGESTRETCHBY = "change stretch by %1";
Blockly.Msg.LOOKS_SETSTRETCHTO = "set stretch to %1 %";
Blockly.Msg.LOOKS_SWITCHCOSTUMETO = "switch costume to %1";
Blockly.Msg.LOOKS_NEXTCOSTUME = "next costume";
Blockly.Msg.LOOKS_SWITCHBACKDROPTO = "switch backdrop to %1";
@ -225,6 +228,7 @@ Blockly.Msg.SENSING_CURRENT_MINUTE = "minute";
Blockly.Msg.SENSING_CURRENT_SECOND = "second";
Blockly.Msg.SENSING_DAYSSINCE2000 = "days since 2000";
Blockly.Msg.SENSING_USERNAME = "username";
Blockly.Msg.SENSING_USERID = "user id";
// Sound blocks
Blockly.Msg.SOUND_PLAY = "start sound %1";