scratch-blocks 2.0.0-spork.2 → 2.0.0-spork.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/{block_reporting.js → block_reporting.ts} +7 -5
- package/src/blocks/{colour.js → colour.ts} +6 -6
- package/src/blocks/{control.js → control.ts} +21 -54
- package/src/blocks/{data.js → data.ts} +134 -142
- package/src/blocks/{event.js → event.ts} +12 -33
- package/src/blocks/{looks.js → looks.ts} +24 -73
- package/src/blocks/{math.js → math.ts} +6 -11
- package/src/blocks/{matrix.js → matrix.ts} +2 -3
- package/src/blocks/{motion.js → motion.ts} +23 -70
- package/src/blocks/{note.js → note.ts} +2 -3
- package/src/blocks/{operators.js → operators.ts} +18 -55
- package/src/blocks/{procedures.js → procedures.ts} +418 -269
- package/src/blocks/{sensing.js → sensing.ts} +21 -61
- package/src/blocks/{sound.js → sound.ts} +9 -28
- package/src/blocks/{text.js → text.ts} +1 -2
- package/src/blocks/{vertical_extensions.js → vertical_extensions.ts} +63 -100
- package/src/checkable_continuous_flyout.js +2 -2
- package/src/{checkbox_bubble.js → checkbox_bubble.ts} +36 -53
- package/src/{colours.js → colours.ts} +11 -4
- package/src/{constants.js → constants.ts} +13 -0
- package/src/{context_menu_items.js → context_menu_items.ts} +18 -12
- package/src/{data_category.js → data_category.ts} +216 -150
- package/src/events/{events_block_comment_base.js → events_block_comment_base.ts} +23 -4
- package/src/events/{events_block_comment_change.js → events_block_comment_change.ts} +29 -5
- package/src/events/{events_block_comment_collapse.js → events_block_comment_collapse.ts} +24 -6
- package/src/events/{events_block_comment_create.js → events_block_comment_create.ts} +36 -10
- package/src/events/{events_block_comment_delete.js → events_block_comment_delete.ts} +6 -2
- package/src/events/{events_block_comment_move.js → events_block_comment_move.ts} +36 -6
- package/src/events/events_block_comment_resize.ts +88 -0
- package/src/events/events_block_drag_end.ts +49 -0
- package/src/events/events_block_drag_outside.ts +44 -0
- package/src/events/{events_scratch_variable_create.js → events_scratch_variable_create.ts} +28 -15
- package/src/fields/{field_colour_slider.js → field_colour_slider.ts} +117 -106
- package/src/fields/{field_matrix.js → field_matrix.ts} +189 -215
- package/src/fields/{field_note.js → field_note.ts} +227 -286
- package/src/fields/{field_textinput_removable.js → field_textinput_removable.ts} +17 -20
- package/src/fields/{field_variable_getter.js → field_variable_getter.ts} +28 -17
- package/src/fields/{field_vertical_separator.js → field_vertical_separator.ts} +14 -30
- package/src/fields/{field_angle.js → scratch_field_angle.ts} +124 -80
- package/src/fields/{field_dropdown.js → scratch_field_dropdown.ts} +9 -7
- package/src/fields/{field_number.js → scratch_field_number.ts} +60 -55
- package/src/fields/{field_variable.js → scratch_field_variable.ts} +46 -27
- package/src/{flyout_checkbox_icon.js → flyout_checkbox_icon.ts} +15 -19
- package/src/{glows.js → glows.ts} +29 -18
- package/src/index.ts +59 -60
- package/src/procedures.ts +462 -0
- package/src/{recyclable_block_flyout_inflater.js → recyclable_block_flyout_inflater.ts} +35 -35
- package/src/renderer/{bowler_hat.js → bowler_hat.ts} +1 -1
- package/src/renderer/{constants.js → constants.ts} +26 -12
- package/src/renderer/{drawer.js → drawer.ts} +8 -3
- package/src/renderer/{path_object.js → path_object.ts} +2 -2
- package/src/renderer/{render_info.js → render_info.ts} +19 -7
- package/src/renderer/renderer.ts +76 -0
- package/src/{scratch_block_paster.js → scratch_block_paster.ts} +9 -7
- package/src/scratch_blocks_utils.ts +39 -0
- package/src/{scratch_comment_icon.js → scratch_comment_icon.ts} +43 -26
- package/src/scratch_connection_checker.ts +44 -0
- package/src/{scratch_continuous_category.js → scratch_continuous_category.ts} +20 -13
- package/src/{scratch_continuous_toolbox.js → scratch_continuous_toolbox.ts} +20 -18
- package/src/{scratch_dragger.js → scratch_dragger.ts} +97 -28
- package/src/{scratch_variable_map.js → scratch_variable_map.ts} +4 -1
- package/src/scratch_variable_model.ts +30 -0
- package/src/{shadows.js → shadows.ts} +8 -4
- package/src/{status_indicator_label.js → status_indicator_label.ts} +24 -36
- package/src/{status_indicator_label_flyout_inflater.js → status_indicator_label_flyout_inflater.ts} +9 -7
- package/src/{variables.js → variables.ts} +153 -123
- package/tsconfig.json +5 -0
- package/src/categories.js +0 -15
- package/src/events/events_block_comment_resize.js +0 -52
- package/src/events/events_block_drag_end.js +0 -33
- package/src/events/events_block_drag_outside.js +0 -30
- package/src/procedures.js +0 -425
- package/src/renderer/renderer.js +0 -74
- package/src/scratch_blocks_utils.js +0 -148
- package/src/scratch_connection_checker.js +0 -29
- package/src/scratch_variable_model.js +0 -24
- /package/src/{css.js → css.ts} +0 -0
- /package/{continuous-toolbox.d.ts → types/continuous-toolbox.d.ts} +0 -0
|
@@ -19,15 +19,13 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import * as Blockly from "blockly/core";
|
|
22
|
-
import
|
|
23
|
-
import * as Constants from "../constants.js";
|
|
22
|
+
import * as Constants from "../constants";
|
|
24
23
|
|
|
25
24
|
Blockly.Blocks["event_whentouchingobject"] = {
|
|
26
25
|
/**
|
|
27
26
|
* Block for when a sprite is touching an object.
|
|
28
|
-
* @this Blockly.Block
|
|
29
27
|
*/
|
|
30
|
-
init: function () {
|
|
28
|
+
init: function (this: Blockly.Block) {
|
|
31
29
|
this.jsonInit({
|
|
32
30
|
message0: Blockly.Msg.EVENT_WHENTOUCHINGOBJECT,
|
|
33
31
|
args0: [
|
|
@@ -36,7 +34,6 @@ Blockly.Blocks["event_whentouchingobject"] = {
|
|
|
36
34
|
name: "TOUCHINGOBJECTMENU",
|
|
37
35
|
},
|
|
38
36
|
],
|
|
39
|
-
category: Categories.event,
|
|
40
37
|
extensions: ["colours_event", "shape_hat"],
|
|
41
38
|
});
|
|
42
39
|
},
|
|
@@ -45,9 +42,8 @@ Blockly.Blocks["event_whentouchingobject"] = {
|
|
|
45
42
|
Blockly.Blocks["event_touchingobjectmenu"] = {
|
|
46
43
|
/**
|
|
47
44
|
* "Touching [Object]" Block Menu.
|
|
48
|
-
* @this Blockly.Block
|
|
49
45
|
*/
|
|
50
|
-
init: function () {
|
|
46
|
+
init: function (this: Blockly.Block) {
|
|
51
47
|
this.jsonInit({
|
|
52
48
|
message0: "%1",
|
|
53
49
|
args0: [
|
|
@@ -68,9 +64,8 @@ Blockly.Blocks["event_touchingobjectmenu"] = {
|
|
|
68
64
|
Blockly.Blocks["event_whenflagclicked"] = {
|
|
69
65
|
/**
|
|
70
66
|
* Block for when flag clicked.
|
|
71
|
-
* @this Blockly.Block
|
|
72
67
|
*/
|
|
73
|
-
init: function () {
|
|
68
|
+
init: function (this: Blockly.Block) {
|
|
74
69
|
const ws = this.workspace.options.parentWorkspace || this.workspace;
|
|
75
70
|
this.jsonInit({
|
|
76
71
|
id: "event_whenflagclicked",
|
|
@@ -84,7 +79,6 @@ Blockly.Blocks["event_whenflagclicked"] = {
|
|
|
84
79
|
alt: "flag",
|
|
85
80
|
},
|
|
86
81
|
],
|
|
87
|
-
category: Categories.event,
|
|
88
82
|
extensions: ["colours_event", "shape_hat"],
|
|
89
83
|
});
|
|
90
84
|
},
|
|
@@ -93,12 +87,10 @@ Blockly.Blocks["event_whenflagclicked"] = {
|
|
|
93
87
|
Blockly.Blocks["event_whenthisspriteclicked"] = {
|
|
94
88
|
/**
|
|
95
89
|
* Block for when this sprite clicked.
|
|
96
|
-
* @this Blockly.Block
|
|
97
90
|
*/
|
|
98
|
-
init: function () {
|
|
91
|
+
init: function (this: Blockly.Block) {
|
|
99
92
|
this.jsonInit({
|
|
100
93
|
message0: Blockly.Msg.EVENT_WHENTHISSPRITECLICKED,
|
|
101
|
-
category: Categories.event,
|
|
102
94
|
extensions: ["colours_event", "shape_hat"],
|
|
103
95
|
});
|
|
104
96
|
},
|
|
@@ -107,12 +99,10 @@ Blockly.Blocks["event_whenthisspriteclicked"] = {
|
|
|
107
99
|
Blockly.Blocks["event_whenstageclicked"] = {
|
|
108
100
|
/**
|
|
109
101
|
* Block for when the stage is clicked.
|
|
110
|
-
* @this Blockly.Block
|
|
111
102
|
*/
|
|
112
|
-
init: function () {
|
|
103
|
+
init: function (this: Blockly.Block) {
|
|
113
104
|
this.jsonInit({
|
|
114
105
|
message0: Blockly.Msg.EVENT_WHENSTAGECLICKED,
|
|
115
|
-
category: Categories.event,
|
|
116
106
|
extensions: ["colours_event", "shape_hat"],
|
|
117
107
|
});
|
|
118
108
|
},
|
|
@@ -121,9 +111,8 @@ Blockly.Blocks["event_whenstageclicked"] = {
|
|
|
121
111
|
Blockly.Blocks["event_whenbroadcastreceived"] = {
|
|
122
112
|
/**
|
|
123
113
|
* Block for when broadcast received.
|
|
124
|
-
* @this Blockly.Block
|
|
125
114
|
*/
|
|
126
|
-
init: function () {
|
|
115
|
+
init: function (this: Blockly.Block) {
|
|
127
116
|
this.jsonInit({
|
|
128
117
|
id: "event_whenbroadcastreceived",
|
|
129
118
|
message0: Blockly.Msg.EVENT_WHENBROADCASTRECEIVED,
|
|
@@ -136,7 +125,6 @@ Blockly.Blocks["event_whenbroadcastreceived"] = {
|
|
|
136
125
|
variable: Blockly.Msg.DEFAULT_BROADCAST_MESSAGE_NAME,
|
|
137
126
|
},
|
|
138
127
|
],
|
|
139
|
-
category: Categories.event,
|
|
140
128
|
extensions: ["colours_event", "shape_hat"],
|
|
141
129
|
});
|
|
142
130
|
},
|
|
@@ -151,9 +139,8 @@ Blockly.Blocks["event_whenbackdropswitchesto"] = {};
|
|
|
151
139
|
Blockly.Blocks["event_whengreaterthan"] = {
|
|
152
140
|
/**
|
|
153
141
|
* Block for when loudness/timer/video motion is greater than the value.
|
|
154
|
-
* @this Blockly.Block
|
|
155
142
|
*/
|
|
156
|
-
init: function () {
|
|
143
|
+
init: function (this: Blockly.Block) {
|
|
157
144
|
this.jsonInit({
|
|
158
145
|
message0: Blockly.Msg.EVENT_WHENGREATERTHAN,
|
|
159
146
|
args0: [
|
|
@@ -170,7 +157,6 @@ Blockly.Blocks["event_whengreaterthan"] = {
|
|
|
170
157
|
name: "VALUE",
|
|
171
158
|
},
|
|
172
159
|
],
|
|
173
|
-
category: Categories.event,
|
|
174
160
|
extensions: ["colours_event", "shape_hat"],
|
|
175
161
|
});
|
|
176
162
|
},
|
|
@@ -179,9 +165,8 @@ Blockly.Blocks["event_whengreaterthan"] = {
|
|
|
179
165
|
Blockly.Blocks["event_broadcast_menu"] = {
|
|
180
166
|
/**
|
|
181
167
|
* Broadcast drop-down menu.
|
|
182
|
-
* @this Blockly.Block
|
|
183
168
|
*/
|
|
184
|
-
init: function () {
|
|
169
|
+
init: function (this: Blockly.Block) {
|
|
185
170
|
this.jsonInit({
|
|
186
171
|
message0: "%1",
|
|
187
172
|
args0: [
|
|
@@ -201,9 +186,8 @@ Blockly.Blocks["event_broadcast_menu"] = {
|
|
|
201
186
|
Blockly.Blocks["event_broadcast"] = {
|
|
202
187
|
/**
|
|
203
188
|
* Block to send a broadcast.
|
|
204
|
-
* @this Blockly.Block
|
|
205
189
|
*/
|
|
206
|
-
init: function () {
|
|
190
|
+
init: function (this: Blockly.Block) {
|
|
207
191
|
this.jsonInit({
|
|
208
192
|
id: "event_broadcast",
|
|
209
193
|
message0: Blockly.Msg.EVENT_BROADCAST,
|
|
@@ -213,7 +197,6 @@ Blockly.Blocks["event_broadcast"] = {
|
|
|
213
197
|
name: "BROADCAST_INPUT",
|
|
214
198
|
},
|
|
215
199
|
],
|
|
216
|
-
category: Categories.event,
|
|
217
200
|
extensions: ["colours_event", "shape_statement"],
|
|
218
201
|
});
|
|
219
202
|
},
|
|
@@ -222,9 +205,8 @@ Blockly.Blocks["event_broadcast"] = {
|
|
|
222
205
|
Blockly.Blocks["event_broadcastandwait"] = {
|
|
223
206
|
/**
|
|
224
207
|
* Block to send a broadcast.
|
|
225
|
-
* @this Blockly.Block
|
|
226
208
|
*/
|
|
227
|
-
init: function () {
|
|
209
|
+
init: function (this: Blockly.Block) {
|
|
228
210
|
this.jsonInit({
|
|
229
211
|
message0: Blockly.Msg.EVENT_BROADCASTANDWAIT,
|
|
230
212
|
args0: [
|
|
@@ -233,7 +215,6 @@ Blockly.Blocks["event_broadcastandwait"] = {
|
|
|
233
215
|
name: "BROADCAST_INPUT",
|
|
234
216
|
},
|
|
235
217
|
],
|
|
236
|
-
category: Categories.event,
|
|
237
218
|
extensions: ["colours_event", "shape_statement"],
|
|
238
219
|
});
|
|
239
220
|
},
|
|
@@ -242,9 +223,8 @@ Blockly.Blocks["event_broadcastandwait"] = {
|
|
|
242
223
|
Blockly.Blocks["event_whenkeypressed"] = {
|
|
243
224
|
/**
|
|
244
225
|
* Block to send a broadcast.
|
|
245
|
-
* @this Blockly.Block
|
|
246
226
|
*/
|
|
247
|
-
init: function () {
|
|
227
|
+
init: function (this: Blockly.Block) {
|
|
248
228
|
this.jsonInit({
|
|
249
229
|
id: "event_whenkeypressed",
|
|
250
230
|
message0: Blockly.Msg.EVENT_WHENKEYPRESSED,
|
|
@@ -298,7 +278,6 @@ Blockly.Blocks["event_whenkeypressed"] = {
|
|
|
298
278
|
],
|
|
299
279
|
},
|
|
300
280
|
],
|
|
301
|
-
category: Categories.event,
|
|
302
281
|
extensions: ["colours_event", "shape_hat"],
|
|
303
282
|
});
|
|
304
283
|
},
|
|
@@ -19,14 +19,12 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import * as Blockly from "blockly/core";
|
|
22
|
-
import { Categories } from "../categories.js";
|
|
23
22
|
|
|
24
23
|
Blockly.Blocks["looks_sayforsecs"] = {
|
|
25
24
|
/**
|
|
26
25
|
* Block to say for some time.
|
|
27
|
-
* @this Blockly.Block
|
|
28
26
|
*/
|
|
29
|
-
init: function () {
|
|
27
|
+
init: function (this: Blockly.Block) {
|
|
30
28
|
this.jsonInit({
|
|
31
29
|
message0: Blockly.Msg.LOOKS_SAYFORSECS,
|
|
32
30
|
args0: [
|
|
@@ -39,7 +37,6 @@ Blockly.Blocks["looks_sayforsecs"] = {
|
|
|
39
37
|
name: "SECS",
|
|
40
38
|
},
|
|
41
39
|
],
|
|
42
|
-
category: Categories.looks,
|
|
43
40
|
extensions: ["colours_looks", "shape_statement"],
|
|
44
41
|
});
|
|
45
42
|
},
|
|
@@ -48,9 +45,8 @@ Blockly.Blocks["looks_sayforsecs"] = {
|
|
|
48
45
|
Blockly.Blocks["looks_say"] = {
|
|
49
46
|
/**
|
|
50
47
|
* Block to say.
|
|
51
|
-
* @this Blockly.Block
|
|
52
48
|
*/
|
|
53
|
-
init: function () {
|
|
49
|
+
init: function (this: Blockly.Block) {
|
|
54
50
|
this.jsonInit({
|
|
55
51
|
message0: Blockly.Msg.LOOKS_SAY,
|
|
56
52
|
args0: [
|
|
@@ -59,7 +55,6 @@ Blockly.Blocks["looks_say"] = {
|
|
|
59
55
|
name: "MESSAGE",
|
|
60
56
|
},
|
|
61
57
|
],
|
|
62
|
-
category: Categories.looks,
|
|
63
58
|
extensions: ["colours_looks", "shape_statement"],
|
|
64
59
|
});
|
|
65
60
|
},
|
|
@@ -68,9 +63,8 @@ Blockly.Blocks["looks_say"] = {
|
|
|
68
63
|
Blockly.Blocks["looks_thinkforsecs"] = {
|
|
69
64
|
/**
|
|
70
65
|
* Block to think for some time.
|
|
71
|
-
* @this Blockly.Block
|
|
72
66
|
*/
|
|
73
|
-
init: function () {
|
|
67
|
+
init: function (this: Blockly.Block) {
|
|
74
68
|
this.jsonInit({
|
|
75
69
|
message0: Blockly.Msg.LOOKS_THINKFORSECS,
|
|
76
70
|
args0: [
|
|
@@ -83,7 +77,6 @@ Blockly.Blocks["looks_thinkforsecs"] = {
|
|
|
83
77
|
name: "SECS",
|
|
84
78
|
},
|
|
85
79
|
],
|
|
86
|
-
category: Categories.looks,
|
|
87
80
|
extensions: ["colours_looks", "shape_statement"],
|
|
88
81
|
});
|
|
89
82
|
},
|
|
@@ -92,9 +85,8 @@ Blockly.Blocks["looks_thinkforsecs"] = {
|
|
|
92
85
|
Blockly.Blocks["looks_think"] = {
|
|
93
86
|
/**
|
|
94
87
|
* Block to think.
|
|
95
|
-
* @this Blockly.Block
|
|
96
88
|
*/
|
|
97
|
-
init: function () {
|
|
89
|
+
init: function (this: Blockly.Block) {
|
|
98
90
|
this.jsonInit({
|
|
99
91
|
message0: Blockly.Msg.LOOKS_THINK,
|
|
100
92
|
args0: [
|
|
@@ -103,7 +95,6 @@ Blockly.Blocks["looks_think"] = {
|
|
|
103
95
|
name: "MESSAGE",
|
|
104
96
|
},
|
|
105
97
|
],
|
|
106
|
-
category: Categories.looks,
|
|
107
98
|
extensions: ["colours_looks", "shape_statement"],
|
|
108
99
|
});
|
|
109
100
|
},
|
|
@@ -112,12 +103,10 @@ Blockly.Blocks["looks_think"] = {
|
|
|
112
103
|
Blockly.Blocks["looks_show"] = {
|
|
113
104
|
/**
|
|
114
105
|
* Show block.
|
|
115
|
-
* @this Blockly.Block
|
|
116
106
|
*/
|
|
117
|
-
init: function () {
|
|
107
|
+
init: function (this: Blockly.Block) {
|
|
118
108
|
this.jsonInit({
|
|
119
109
|
message0: Blockly.Msg.LOOKS_SHOW,
|
|
120
|
-
category: Categories.looks,
|
|
121
110
|
extensions: ["colours_looks", "shape_statement"],
|
|
122
111
|
});
|
|
123
112
|
},
|
|
@@ -126,12 +115,10 @@ Blockly.Blocks["looks_show"] = {
|
|
|
126
115
|
Blockly.Blocks["looks_hide"] = {
|
|
127
116
|
/**
|
|
128
117
|
* Hide block.
|
|
129
|
-
* @this Blockly.Block
|
|
130
118
|
*/
|
|
131
|
-
init: function () {
|
|
119
|
+
init: function (this: Blockly.Block) {
|
|
132
120
|
this.jsonInit({
|
|
133
121
|
message0: Blockly.Msg.LOOKS_HIDE,
|
|
134
|
-
category: Categories.looks,
|
|
135
122
|
extensions: ["colours_looks", "shape_statement"],
|
|
136
123
|
});
|
|
137
124
|
},
|
|
@@ -142,12 +129,10 @@ Blockly.Blocks["looks_hideallsprites"] = {
|
|
|
142
129
|
* Hide-all-sprites block. Does not actually do anything. This is an
|
|
143
130
|
* obsolete block that is implemented for compatibility with Scratch 2.0
|
|
144
131
|
* projects.
|
|
145
|
-
* @this Blockly.Block
|
|
146
132
|
*/
|
|
147
|
-
init: function () {
|
|
133
|
+
init: function (this: Blockly.Block) {
|
|
148
134
|
this.jsonInit({
|
|
149
135
|
message0: Blockly.Msg.LOOKS_HIDEALLSPRITES,
|
|
150
|
-
category: Categories.looks,
|
|
151
136
|
extensions: ["colours_looks", "shape_statement"],
|
|
152
137
|
});
|
|
153
138
|
},
|
|
@@ -156,9 +141,8 @@ Blockly.Blocks["looks_hideallsprites"] = {
|
|
|
156
141
|
Blockly.Blocks["looks_changeeffectby"] = {
|
|
157
142
|
/**
|
|
158
143
|
* Block to change graphic effect.
|
|
159
|
-
* @this Blockly.Block
|
|
160
144
|
*/
|
|
161
|
-
init: function () {
|
|
145
|
+
init: function (this: Blockly.Block) {
|
|
162
146
|
this.jsonInit({
|
|
163
147
|
message0: Blockly.Msg.LOOKS_CHANGEEFFECTBY,
|
|
164
148
|
args0: [
|
|
@@ -180,7 +164,6 @@ Blockly.Blocks["looks_changeeffectby"] = {
|
|
|
180
164
|
name: "CHANGE",
|
|
181
165
|
},
|
|
182
166
|
],
|
|
183
|
-
category: Categories.looks,
|
|
184
167
|
extensions: ["colours_looks", "shape_statement"],
|
|
185
168
|
});
|
|
186
169
|
},
|
|
@@ -189,9 +172,8 @@ Blockly.Blocks["looks_changeeffectby"] = {
|
|
|
189
172
|
Blockly.Blocks["looks_seteffectto"] = {
|
|
190
173
|
/**
|
|
191
174
|
* Block to set graphic effect.
|
|
192
|
-
* @this Blockly.Block
|
|
193
175
|
*/
|
|
194
|
-
init: function () {
|
|
176
|
+
init: function (this: Blockly.Block) {
|
|
195
177
|
this.jsonInit({
|
|
196
178
|
message0: Blockly.Msg.LOOKS_SETEFFECTTO,
|
|
197
179
|
args0: [
|
|
@@ -213,7 +195,6 @@ Blockly.Blocks["looks_seteffectto"] = {
|
|
|
213
195
|
name: "VALUE",
|
|
214
196
|
},
|
|
215
197
|
],
|
|
216
|
-
category: Categories.looks,
|
|
217
198
|
extensions: ["colours_looks", "shape_statement"],
|
|
218
199
|
});
|
|
219
200
|
},
|
|
@@ -222,12 +203,10 @@ Blockly.Blocks["looks_seteffectto"] = {
|
|
|
222
203
|
Blockly.Blocks["looks_cleargraphiceffects"] = {
|
|
223
204
|
/**
|
|
224
205
|
* Block to clear graphic effects.
|
|
225
|
-
* @this Blockly.Block
|
|
226
206
|
*/
|
|
227
|
-
init: function () {
|
|
207
|
+
init: function (this: Blockly.Block) {
|
|
228
208
|
this.jsonInit({
|
|
229
209
|
message0: Blockly.Msg.LOOKS_CLEARGRAPHICEFFECTS,
|
|
230
|
-
category: Categories.looks,
|
|
231
210
|
extensions: ["colours_looks", "shape_statement"],
|
|
232
211
|
});
|
|
233
212
|
},
|
|
@@ -236,9 +215,8 @@ Blockly.Blocks["looks_cleargraphiceffects"] = {
|
|
|
236
215
|
Blockly.Blocks["looks_changesizeby"] = {
|
|
237
216
|
/**
|
|
238
217
|
* Block to change size
|
|
239
|
-
* @this Blockly.Block
|
|
240
218
|
*/
|
|
241
|
-
init: function () {
|
|
219
|
+
init: function (this: Blockly.Block) {
|
|
242
220
|
this.jsonInit({
|
|
243
221
|
message0: Blockly.Msg.LOOKS_CHANGESIZEBY,
|
|
244
222
|
args0: [
|
|
@@ -247,7 +225,6 @@ Blockly.Blocks["looks_changesizeby"] = {
|
|
|
247
225
|
name: "CHANGE",
|
|
248
226
|
},
|
|
249
227
|
],
|
|
250
|
-
category: Categories.looks,
|
|
251
228
|
extensions: ["colours_looks", "shape_statement"],
|
|
252
229
|
});
|
|
253
230
|
},
|
|
@@ -256,9 +233,8 @@ Blockly.Blocks["looks_changesizeby"] = {
|
|
|
256
233
|
Blockly.Blocks["looks_setsizeto"] = {
|
|
257
234
|
/**
|
|
258
235
|
* Block to set size
|
|
259
|
-
* @this Blockly.Block
|
|
260
236
|
*/
|
|
261
|
-
init: function () {
|
|
237
|
+
init: function (this: Blockly.Block) {
|
|
262
238
|
this.jsonInit({
|
|
263
239
|
message0: Blockly.Msg.LOOKS_SETSIZETO,
|
|
264
240
|
args0: [
|
|
@@ -267,7 +243,6 @@ Blockly.Blocks["looks_setsizeto"] = {
|
|
|
267
243
|
name: "SIZE",
|
|
268
244
|
},
|
|
269
245
|
],
|
|
270
|
-
category: Categories.looks,
|
|
271
246
|
extensions: ["colours_looks", "shape_statement"],
|
|
272
247
|
});
|
|
273
248
|
},
|
|
@@ -276,12 +251,10 @@ Blockly.Blocks["looks_setsizeto"] = {
|
|
|
276
251
|
Blockly.Blocks["looks_size"] = {
|
|
277
252
|
/**
|
|
278
253
|
* Block to report size
|
|
279
|
-
* @this Blockly.Block
|
|
280
254
|
*/
|
|
281
|
-
init: function () {
|
|
255
|
+
init: function (this: Blockly.Block) {
|
|
282
256
|
this.jsonInit({
|
|
283
257
|
message0: Blockly.Msg.LOOKS_SIZE,
|
|
284
|
-
category: Categories.looks,
|
|
285
258
|
extensions: ["colours_looks", "output_number", "monitor_block"],
|
|
286
259
|
});
|
|
287
260
|
},
|
|
@@ -299,9 +272,8 @@ Blockly.Blocks["looks_changestretchby"] = {
|
|
|
299
272
|
* displayed as red "undefined" blocks. Some Scratch projects still contain
|
|
300
273
|
* these blocks, however, and they don't open in 3.0 unless the blocks
|
|
301
274
|
* actually exist (though they still don't funcitonally do anything).
|
|
302
|
-
* @this Blockly.Block
|
|
303
275
|
*/
|
|
304
|
-
init: function () {
|
|
276
|
+
init: function (this: Blockly.Block) {
|
|
305
277
|
this.jsonInit({
|
|
306
278
|
message0: Blockly.Msg.LOOKS_CHANGESTRETCHBY,
|
|
307
279
|
args0: [
|
|
@@ -310,7 +282,6 @@ Blockly.Blocks["looks_changestretchby"] = {
|
|
|
310
282
|
name: "CHANGE",
|
|
311
283
|
},
|
|
312
284
|
],
|
|
313
|
-
category: Categories.looks,
|
|
314
285
|
extensions: ["colours_looks", "shape_statement"],
|
|
315
286
|
});
|
|
316
287
|
},
|
|
@@ -321,9 +292,8 @@ Blockly.Blocks["looks_setstretchto"] = {
|
|
|
321
292
|
* Block to set stretch. Does not actually do anything. This is an obsolete
|
|
322
293
|
* block that is implemented for compatibility with Scratch 1.4 projects
|
|
323
294
|
* (see looks_changestretchby).
|
|
324
|
-
* @this Blockly.Block
|
|
325
295
|
*/
|
|
326
|
-
init: function () {
|
|
296
|
+
init: function (this: Blockly.Block) {
|
|
327
297
|
this.jsonInit({
|
|
328
298
|
message0: Blockly.Msg.LOOKS_SETSTRETCHTO,
|
|
329
299
|
args0: [
|
|
@@ -332,7 +302,6 @@ Blockly.Blocks["looks_setstretchto"] = {
|
|
|
332
302
|
name: "STRETCH",
|
|
333
303
|
},
|
|
334
304
|
],
|
|
335
|
-
category: Categories.looks,
|
|
336
305
|
extensions: ["colours_looks", "shape_statement"],
|
|
337
306
|
});
|
|
338
307
|
},
|
|
@@ -346,9 +315,8 @@ Blockly.Blocks["looks_costume"] = {};
|
|
|
346
315
|
Blockly.Blocks["looks_switchcostumeto"] = {
|
|
347
316
|
/**
|
|
348
317
|
* Block to switch the sprite's costume to the selected one.
|
|
349
|
-
* @this Blockly.Block
|
|
350
318
|
*/
|
|
351
|
-
init: function () {
|
|
319
|
+
init: function (this: Blockly.Block) {
|
|
352
320
|
this.jsonInit({
|
|
353
321
|
message0: Blockly.Msg.LOOKS_SWITCHCOSTUMETO,
|
|
354
322
|
args0: [
|
|
@@ -357,7 +325,6 @@ Blockly.Blocks["looks_switchcostumeto"] = {
|
|
|
357
325
|
name: "COSTUME",
|
|
358
326
|
},
|
|
359
327
|
],
|
|
360
|
-
category: Categories.looks,
|
|
361
328
|
extensions: ["colours_looks", "shape_statement"],
|
|
362
329
|
});
|
|
363
330
|
},
|
|
@@ -366,12 +333,10 @@ Blockly.Blocks["looks_switchcostumeto"] = {
|
|
|
366
333
|
Blockly.Blocks["looks_nextcostume"] = {
|
|
367
334
|
/**
|
|
368
335
|
* Block to switch the sprite's costume to the next one.
|
|
369
|
-
* @this Blockly.Block
|
|
370
336
|
*/
|
|
371
|
-
init: function () {
|
|
337
|
+
init: function (this: Blockly.Block) {
|
|
372
338
|
this.jsonInit({
|
|
373
339
|
message0: Blockly.Msg.LOOKS_NEXTCOSTUME,
|
|
374
|
-
category: Categories.looks,
|
|
375
340
|
extensions: ["colours_looks", "shape_statement"],
|
|
376
341
|
});
|
|
377
342
|
},
|
|
@@ -380,9 +345,8 @@ Blockly.Blocks["looks_nextcostume"] = {
|
|
|
380
345
|
Blockly.Blocks["looks_switchbackdropto"] = {
|
|
381
346
|
/**
|
|
382
347
|
* Block to switch the backdrop to the selected one.
|
|
383
|
-
* @this Blockly.Block
|
|
384
348
|
*/
|
|
385
|
-
init: function () {
|
|
349
|
+
init: function (this: Blockly.Block) {
|
|
386
350
|
this.jsonInit({
|
|
387
351
|
message0: Blockly.Msg.LOOKS_SWITCHBACKDROPTO,
|
|
388
352
|
args0: [
|
|
@@ -391,7 +355,6 @@ Blockly.Blocks["looks_switchbackdropto"] = {
|
|
|
391
355
|
name: "BACKDROP",
|
|
392
356
|
},
|
|
393
357
|
],
|
|
394
|
-
category: Categories.looks,
|
|
395
358
|
extensions: ["colours_looks", "shape_statement"],
|
|
396
359
|
});
|
|
397
360
|
},
|
|
@@ -405,9 +368,8 @@ Blockly.Blocks["looks_backdrops"] = {};
|
|
|
405
368
|
Blockly.Blocks["looks_gotofrontback"] = {
|
|
406
369
|
/**
|
|
407
370
|
* "Go to front/back" Block.
|
|
408
|
-
* @this Blockly.Block
|
|
409
371
|
*/
|
|
410
|
-
init: function () {
|
|
372
|
+
init: function (this: Blockly.Block) {
|
|
411
373
|
this.jsonInit({
|
|
412
374
|
message0: Blockly.Msg.LOOKS_GOTOFRONTBACK,
|
|
413
375
|
args0: [
|
|
@@ -420,7 +382,6 @@ Blockly.Blocks["looks_gotofrontback"] = {
|
|
|
420
382
|
],
|
|
421
383
|
},
|
|
422
384
|
],
|
|
423
|
-
category: Categories.looks,
|
|
424
385
|
extensions: ["colours_looks", "shape_statement"],
|
|
425
386
|
});
|
|
426
387
|
},
|
|
@@ -429,9 +390,8 @@ Blockly.Blocks["looks_gotofrontback"] = {
|
|
|
429
390
|
Blockly.Blocks["looks_goforwardbackwardlayers"] = {
|
|
430
391
|
/**
|
|
431
392
|
* "Go forward/backward [Number] Layers" Block.
|
|
432
|
-
* @this Blockly.Block
|
|
433
393
|
*/
|
|
434
|
-
init: function () {
|
|
394
|
+
init: function (this: Blockly.Block) {
|
|
435
395
|
this.jsonInit({
|
|
436
396
|
message0: Blockly.Msg.LOOKS_GOFORWARDBACKWARDLAYERS,
|
|
437
397
|
args0: [
|
|
@@ -448,7 +408,6 @@ Blockly.Blocks["looks_goforwardbackwardlayers"] = {
|
|
|
448
408
|
name: "NUM",
|
|
449
409
|
},
|
|
450
410
|
],
|
|
451
|
-
category: Categories.looks,
|
|
452
411
|
extensions: ["colours_looks", "shape_statement"],
|
|
453
412
|
});
|
|
454
413
|
},
|
|
@@ -457,9 +416,8 @@ Blockly.Blocks["looks_goforwardbackwardlayers"] = {
|
|
|
457
416
|
Blockly.Blocks["looks_backdropnumbername"] = {
|
|
458
417
|
/**
|
|
459
418
|
* Block to report backdrop's number or name
|
|
460
|
-
* @this Blockly.Block
|
|
461
419
|
*/
|
|
462
|
-
init: function () {
|
|
420
|
+
init: function (this: Blockly.Block) {
|
|
463
421
|
this.jsonInit({
|
|
464
422
|
message0: Blockly.Msg.LOOKS_BACKDROPNUMBERNAME,
|
|
465
423
|
args0: [
|
|
@@ -472,7 +430,6 @@ Blockly.Blocks["looks_backdropnumbername"] = {
|
|
|
472
430
|
],
|
|
473
431
|
},
|
|
474
432
|
],
|
|
475
|
-
category: Categories.looks,
|
|
476
433
|
extensions: ["colours_looks", "output_number", "monitor_block"],
|
|
477
434
|
});
|
|
478
435
|
},
|
|
@@ -481,9 +438,8 @@ Blockly.Blocks["looks_backdropnumbername"] = {
|
|
|
481
438
|
Blockly.Blocks["looks_costumenumbername"] = {
|
|
482
439
|
/**
|
|
483
440
|
* Block to report costume's number or name
|
|
484
|
-
* @this Blockly.Block
|
|
485
441
|
*/
|
|
486
|
-
init: function () {
|
|
442
|
+
init: function (this: Blockly.Block) {
|
|
487
443
|
this.jsonInit({
|
|
488
444
|
message0: Blockly.Msg.LOOKS_COSTUMENUMBERNAME,
|
|
489
445
|
args0: [
|
|
@@ -496,7 +452,6 @@ Blockly.Blocks["looks_costumenumbername"] = {
|
|
|
496
452
|
],
|
|
497
453
|
},
|
|
498
454
|
],
|
|
499
|
-
category: Categories.looks,
|
|
500
455
|
extensions: ["colours_looks", "output_number", "monitor_block"],
|
|
501
456
|
});
|
|
502
457
|
},
|
|
@@ -505,9 +460,8 @@ Blockly.Blocks["looks_costumenumbername"] = {
|
|
|
505
460
|
Blockly.Blocks["looks_switchbackdroptoandwait"] = {
|
|
506
461
|
/**
|
|
507
462
|
* Block to switch the backdrop to the selected one and wait.
|
|
508
|
-
* @this Blockly.Block
|
|
509
463
|
*/
|
|
510
|
-
init: function () {
|
|
464
|
+
init: function (this: Blockly.Block) {
|
|
511
465
|
this.jsonInit({
|
|
512
466
|
message0: Blockly.Msg.LOOKS_SWITCHBACKDROPTOANDWAIT,
|
|
513
467
|
args0: [
|
|
@@ -516,7 +470,6 @@ Blockly.Blocks["looks_switchbackdroptoandwait"] = {
|
|
|
516
470
|
name: "BACKDROP",
|
|
517
471
|
},
|
|
518
472
|
],
|
|
519
|
-
category: Categories.looks,
|
|
520
473
|
extensions: ["colours_looks", "shape_statement"],
|
|
521
474
|
});
|
|
522
475
|
},
|
|
@@ -525,12 +478,10 @@ Blockly.Blocks["looks_switchbackdroptoandwait"] = {
|
|
|
525
478
|
Blockly.Blocks["looks_nextbackdrop"] = {
|
|
526
479
|
/**
|
|
527
480
|
* Block to switch the backdrop to the next one.
|
|
528
|
-
* @this Blockly.Block
|
|
529
481
|
*/
|
|
530
|
-
init: function () {
|
|
482
|
+
init: function (this: Blockly.Block) {
|
|
531
483
|
this.jsonInit({
|
|
532
484
|
message0: Blockly.Msg.LOOKS_NEXTBACKDROP_BLOCK,
|
|
533
|
-
category: Categories.looks,
|
|
534
485
|
extensions: ["colours_looks", "shape_statement"],
|
|
535
486
|
});
|
|
536
487
|
},
|
|
@@ -23,14 +23,13 @@
|
|
|
23
23
|
* @author q.neutron@gmail.com (Quynh Neutron)
|
|
24
24
|
*/
|
|
25
25
|
import * as Blockly from "blockly/core";
|
|
26
|
-
import * as Constants from "../constants
|
|
26
|
+
import * as Constants from "../constants";
|
|
27
27
|
|
|
28
28
|
Blockly.Blocks["math_number"] = {
|
|
29
29
|
/**
|
|
30
30
|
* Block for generic numeric value.
|
|
31
|
-
* @this Blockly.Block
|
|
32
31
|
*/
|
|
33
|
-
init: function () {
|
|
32
|
+
init: function (this: Blockly.Block) {
|
|
34
33
|
this.jsonInit({
|
|
35
34
|
message0: "%1",
|
|
36
35
|
args0: [
|
|
@@ -50,9 +49,8 @@ Blockly.Blocks["math_number"] = {
|
|
|
50
49
|
Blockly.Blocks["math_integer"] = {
|
|
51
50
|
/**
|
|
52
51
|
* Block for integer value (no decimal, + or -).
|
|
53
|
-
* @this Blockly.Block
|
|
54
52
|
*/
|
|
55
|
-
init: function () {
|
|
53
|
+
init: function (this: Blockly.Block) {
|
|
56
54
|
this.jsonInit({
|
|
57
55
|
message0: "%1",
|
|
58
56
|
args0: [
|
|
@@ -72,9 +70,8 @@ Blockly.Blocks["math_integer"] = {
|
|
|
72
70
|
Blockly.Blocks["math_whole_number"] = {
|
|
73
71
|
/**
|
|
74
72
|
* Block for whole number value, no negatives or decimals.
|
|
75
|
-
* @this Blockly.Block
|
|
76
73
|
*/
|
|
77
|
-
init: function () {
|
|
74
|
+
init: function (this: Blockly.Block) {
|
|
78
75
|
this.jsonInit({
|
|
79
76
|
message0: "%1",
|
|
80
77
|
args0: [
|
|
@@ -95,9 +92,8 @@ Blockly.Blocks["math_whole_number"] = {
|
|
|
95
92
|
Blockly.Blocks["math_positive_number"] = {
|
|
96
93
|
/**
|
|
97
94
|
* Block for positive number value, with decimal.
|
|
98
|
-
* @this Blockly.Block
|
|
99
95
|
*/
|
|
100
|
-
init: function () {
|
|
96
|
+
init: function (this: Blockly.Block) {
|
|
101
97
|
this.jsonInit({
|
|
102
98
|
message0: "%1",
|
|
103
99
|
args0: [
|
|
@@ -117,9 +113,8 @@ Blockly.Blocks["math_positive_number"] = {
|
|
|
117
113
|
Blockly.Blocks["math_angle"] = {
|
|
118
114
|
/**
|
|
119
115
|
* Block for angle picker.
|
|
120
|
-
* @this Blockly.Block
|
|
121
116
|
*/
|
|
122
|
-
init: function () {
|
|
117
|
+
init: function (this: Blockly.Block) {
|
|
123
118
|
this.jsonInit({
|
|
124
119
|
message0: "%1",
|
|
125
120
|
args0: [
|
|
@@ -23,14 +23,13 @@
|
|
|
23
23
|
* @author khanning@gmail.com (Kreg Hanning)
|
|
24
24
|
*/
|
|
25
25
|
import * as Blockly from "blockly/core";
|
|
26
|
-
import * as Constants from "../constants
|
|
26
|
+
import * as Constants from "../constants";
|
|
27
27
|
|
|
28
28
|
Blockly.Blocks["matrix"] = {
|
|
29
29
|
/**
|
|
30
30
|
* Block for matrix value.
|
|
31
|
-
* @this Blockly.Block
|
|
32
31
|
*/
|
|
33
|
-
init: function () {
|
|
32
|
+
init: function (this: Blockly.Block) {
|
|
34
33
|
this.jsonInit({
|
|
35
34
|
message0: "%1",
|
|
36
35
|
args0: [
|