Skip to content

Commit a0a956c

Browse files
committed
add monitors to existing blocks in the palette
1 parent 09da03e commit a0a956c

File tree

1 file changed

+201
-1
lines changed

1 file changed

+201
-1
lines changed

src/lib/opcode-labels.js

Lines changed: 201 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,128 @@ const messages = defineMessages({
4343
description: 'Label for the backdrop number monitor when shown on the stage',
4444
id: 'gui.opcodeLabels.backdropnumber'
4545
},
46-
46+
looks_stretchGetX: {
47+
defaultMessage: 'stretch x',
48+
description: 'Label for the stretch x monitor when shown on the stage',
49+
id: 'gui.opcodeLabels.stretchGetX'
50+
},
51+
looks_stretchGetY: {
52+
defaultMessage: 'stretch y',
53+
description: 'Label for the stretch y monitor when shown on the stage',
54+
id: 'gui.opcodeLabels.stretchGetY'
55+
},
56+
looks_sayWidth: {
57+
defaultMessage: 'bubble width',
58+
description: 'Label for the bubble width monitor when shown on the stage',
59+
id: 'gui.opcodeLabels.sayWidth'
60+
},
61+
looks_sayHeight: {
62+
defaultMessage: 'bubble height',
63+
description: 'Label for the bubble height monitor when shown on the stage',
64+
id: 'gui.opcodeLabels.sayHeight'
65+
},
66+
looks_getEffectValue: {
67+
defaultMessage: 'effect',
68+
description: 'Label for the effect monitor with no effect chosen when shown on the stage',
69+
id: 'gui.opcodeLabels.getEffectValue'
70+
},
71+
looks_getEffectValue_color: {
72+
defaultMessage: 'color effect',
73+
description: 'Label for the color effect monitor when shown on the stage',
74+
id: 'gui.opcodeLabels.getEffectValue.color'
75+
},
76+
looks_getEffectValue_fisheye: {
77+
defaultMessage: 'fisheye effect',
78+
description: 'Label for the fisheye effect monitor when shown on the stage',
79+
id: 'gui.opcodeLabels.getEffectValue.fisheye'
80+
},
81+
looks_getEffectValue_whirl: {
82+
defaultMessage: 'whirl effect',
83+
description: 'Label for the whirl effect monitor when shown on the stage',
84+
id: 'gui.opcodeLabels.getEffectValue.whirl'
85+
},
86+
looks_getEffectValue_pixelate: {
87+
defaultMessage: 'pixelate effect',
88+
description: 'Label for the pixelate effect monitor when shown on the stage',
89+
id: 'gui.opcodeLabels.getEffectValue.pixelate'
90+
},
91+
looks_getEffectValue_mosaic: {
92+
defaultMessage: 'mosaic effect',
93+
description: 'Label for the mosaic effect monitor when shown on the stage',
94+
id: 'gui.opcodeLabels.getEffectValue.mosaic'
95+
},
96+
looks_getEffectValue_brightness: {
97+
defaultMessage: 'brightness effect',
98+
description: 'Label for the brightness effect monitor when shown on the stage',
99+
id: 'gui.opcodeLabels.getEffectValue.brightness'
100+
},
101+
looks_getEffectValue_ghost: {
102+
defaultMessage: 'ghost effect',
103+
description: 'Label for the ghost effect monitor when shown on the stage',
104+
id: 'gui.opcodeLabels.getEffectValue.ghost'
105+
},
106+
looks_getEffectValue_saturation: {
107+
defaultMessage: 'saturation effect',
108+
description: 'Label for the saturation effect monitor when shown on the stage',
109+
id: 'gui.opcodeLabels.getEffectValue.saturation'
110+
},
111+
looks_getEffectValue_red: {
112+
defaultMessage: 'red effect',
113+
description: 'Label for the red effect monitor when shown on the stage',
114+
id: 'gui.opcodeLabels.getEffectValue.red'
115+
},
116+
looks_getEffectValue_green: {
117+
defaultMessage: 'green effect',
118+
description: 'Label for the green effect monitor when shown on the stage',
119+
id: 'gui.opcodeLabels.getEffectValue.green'
120+
},
121+
looks_getEffectValue_blue: {
122+
defaultMessage: 'blue effect',
123+
description: 'Label for the blue effect monitor when shown on the stage',
124+
id: 'gui.opcodeLabels.getEffectValue.blue'
125+
},
126+
looks_getEffectValue_opaque: {
127+
defaultMessage: 'opaque effect',
128+
description: 'Label for the opaque effect monitor when shown on the stage',
129+
id: 'gui.opcodeLabels.getEffectValue.opaque'
130+
},
131+
looks_tintColor: {
132+
defaultMessage: 'tint color',
133+
description: 'Label for the tint color monitor when shown on the stage',
134+
id: 'gui.opcodeLabels.tintColor'
135+
},
136+
looks_getSpriteVisible: {
137+
defaultMessage: 'visible?',
138+
description: 'Label for the visible monitor when shown on the stage',
139+
id: 'gui.opcodeLabels.getSpriteVisible'
140+
},
141+
looks_layersGetLayer: {
142+
defaultMessage: 'layer',
143+
description: 'Label for the layer monitor when shown on the stage',
144+
id: 'gui.opcodeLabels.layersGetLayer'
145+
},
47146

48147
// Sound
49148
sound_volume: {
50149
defaultMessage: 'volume',
51150
description: 'Label for the volume monitor when shown on the stage',
52151
id: 'gui.opcodeLabels.volume'
53152
},
153+
sound_getEffectValue: {
154+
defaultMessage: 'effect',
155+
description: 'Label for the sound effect monitor with no effect chosen when shown on the stage',
156+
id: 'gui.opcodeLabels.soundgetEffectValue'
157+
},
158+
sound_getEffectValue_pitch: {
159+
defaultMessage: 'pitch',
160+
description: 'Label for the pitch effect monitor when shown on the stage',
161+
id: 'gui.opcodeLabels.soundgetEffectValue.pitch'
162+
},
163+
sound_getEffectValue_pan: {
164+
defaultMessage: 'pan left/right',
165+
description: 'Label for the pan left/right effect monitor when shown on the stage',
166+
id: 'gui.opcodeLabels.soundgetEffectValue.pan'
167+
},
54168
sound_tempo: {
55169
defaultMessage: 'tempo',
56170
description: 'Label for the tempo monitor when shown on the stage',
@@ -113,6 +227,46 @@ const messages = defineMessages({
113227
description: 'Label for the timer monitor when shown on the stage',
114228
id: 'gui.opcodeLabels.timer'
115229
},
230+
sensing_mousedown: {
231+
defaultMessage: 'mouse down?',
232+
description: 'Label for the mouse down monitor when shown on the stage',
233+
id: 'gui.opcodeLabels.mousedown'
234+
},
235+
sensing_mouseclicked: {
236+
defaultMessage: 'mouse clicked?',
237+
description: 'Label for the mouse clicked monitor when shown on the stage',
238+
id: 'gui.opcodeLabels.mouseclicked'
239+
},
240+
sensing_mousex: {
241+
defaultMessage: 'mouse x',
242+
description: 'Label for the mouse x monitor when shown on the stage',
243+
id: 'gui.opcodeLabels.mousex'
244+
},
245+
sensing_mousey: {
246+
defaultMessage: 'mouse y',
247+
description: 'Label for the mouse y monitor when shown on the stage',
248+
id: 'gui.opcodeLabels.mousey'
249+
},
250+
sensing_getclipboard: {
251+
defaultMessage: 'clipboard item',
252+
description: 'Label for the clipboard item monitor when shown on the stage',
253+
id: 'gui.opcodeLabels.getclipboard'
254+
},
255+
sensing_loud: {
256+
defaultMessage: 'loud?',
257+
description: 'Label for the loud monitor when shown on the stage',
258+
id: 'gui.opcodeLabels.loud'
259+
},
260+
sensing_dayssince2000: {
261+
defaultMessage: 'days since 2000',
262+
description: 'Label for the days since 2000 monitor when shown on the stage',
263+
id: 'gui.opcodeLabels.dayssince2000'
264+
},
265+
sensing_loggedin: {
266+
defaultMessage: 'logged in?',
267+
description: 'Label for the logged in monitor when shown on the stage',
268+
id: 'gui.opcodeLabels.loggedin'
269+
},
116270

117271
// Control
118272
control_get_counter: {
@@ -147,13 +301,22 @@ class OpcodeLabels {
147301
looks_costumenumbername: {category: 'looks'},
148302
looks_backdropnumbername: {category: 'looks'},
149303
looks_backdropname: {category: 'looks'},
304+
looks_stretchGetX: {category: 'looks'},
305+
looks_stretchGetY: {category: 'looks'},
306+
looks_sayWidth: {category: 'looks'},
307+
looks_sayHeight: {category: 'looks'},
308+
looks_getEffectValue: {category: 'looks'},
309+
looks_tintColor: {category: 'looks'},
310+
looks_getSpriteVisible: {category: 'looks'},
311+
looks_layersGetLayer: {category: 'looks'},
150312

151313
// Data
152314
data_variable: {category: 'data'},
153315
data_listcontents: {category: 'list'},
154316

155317
// Sound
156318
sound_volume: {category: 'sound'},
319+
sound_getEffectValue: {category: 'sound'},
157320
sound_tempo: {category: 'sound'},
158321

159322
// Sensing
@@ -162,6 +325,14 @@ class OpcodeLabels {
162325
sensing_username: {category: 'sensing'},
163326
sensing_current: {category: 'sensing'},
164327
sensing_timer: {category: 'sensing'},
328+
sensing_mousedown: {category: 'sensing'},
329+
sensing_mouseclicked: {category: 'sensing'},
330+
sensing_mousex: {category: 'sensing'},
331+
sensing_mousey: {category: 'sensing'},
332+
sensing_getclipboard: {category: 'sensing'},
333+
sensing_loud: {category: 'sensing'},
334+
sensing_dayssince2000: {category: 'sensing'},
335+
sensing_loggedin: {category: 'sensing'},
165336

166337
// Control
167338
control_get_counter: {category: 'control'}
@@ -193,6 +364,20 @@ class OpcodeLabels {
193364

194365
// Looks
195366
this._opcodeMap.looks_size.labelFn = () => this._translator(messages.looks_size);
367+
this._opcodeMap.looks_stretchGetX.labelFn = () => this._translator(messages.looks_stretchGetX);
368+
this._opcodeMap.looks_stretchGetY.labelFn = () => this._translator(messages.looks_stretchGetY);
369+
this._opcodeMap.looks_sayWidth.labelFn = () => this._translator(messages.looks_sayWidth);
370+
this._opcodeMap.looks_sayHeight.labelFn = () => this._translator(messages.looks_sayHeight);
371+
this._opcodeMap.looks_getEffectValue.labelFn = params => {
372+
const effect = params.EFFECT.toLowerCase();
373+
if (messages[`looks_getEffectValue_${effect}`]) {
374+
return this._translator(messages[`looks_getEffectValue_${effect}`]);
375+
}
376+
return this._translator(messages.looks_getEffectValue);
377+
};
378+
this._opcodeMap.looks_tintColor.labelFn = () => this._translator(messages.looks_tintColor);
379+
this._opcodeMap.looks_getSpriteVisible.labelFn = () => this._translator(messages.looks_getSpriteVisible);
380+
this._opcodeMap.looks_layersGetLayer.labelFn = () => this._translator(messages.looks_layersGetLayer);
196381
this._opcodeMap.looks_costumenumbername.labelFn = params => {
197382
if (params.NUMBER_NAME === 'number') {
198383
return this._translator(messages.looks_costumenumber);
@@ -214,6 +399,13 @@ class OpcodeLabels {
214399
// Sound
215400
this._opcodeMap.sound_volume.labelFn = () => this._translator(messages.sound_volume);
216401
this._opcodeMap.sound_tempo.labelFn = () => this._translator(messages.sound_tempo);
402+
this._opcodeMap.sound_getEffectValue.labelFn = params => {
403+
const effect = params.EFFECT.toLowerCase();
404+
if (messages[`sound_getEffectValue_${effect}`]) {
405+
return this._translator(messages[`sound_getEffectValue_${effect}`]);
406+
}
407+
return this._translator(messages.sound_getEffectValue);
408+
};
217409

218410
// Sensing
219411
this._opcodeMap.sensing_answer.labelFn = () => this._translator(messages.sensing_answer);
@@ -238,6 +430,14 @@ class OpcodeLabels {
238430
}
239431
};
240432
this._opcodeMap.sensing_timer.labelFn = () => this._translator(messages.sensing_timer);
433+
this._opcodeMap.sensing_mousedown.labelFn = () => this._translator(messages.sensing_mousedown);
434+
this._opcodeMap.sensing_mouseclicked.labelFn = () => this._translator(messages.sensing_mouseclicked);
435+
this._opcodeMap.sensing_mousex.labelFn = () => this._translator(messages.sensing_mousex);
436+
this._opcodeMap.sensing_mousey.labelFn = () => this._translator(messages.sensing_mousey);
437+
this._opcodeMap.sensing_getclipboard.labelFn = () => this._translator(messages.sensing_getclipboard);
438+
this._opcodeMap.sensing_loud.labelFn = () => this._translator(messages.sensing_loud);
439+
this._opcodeMap.sensing_dayssince2000.labelFn = () => this._translator(messages.sensing_dayssince2000);
440+
this._opcodeMap.sensing_loggedin.labelFn = () => this._translator(messages.sensing_loggedin);
241441

242442
// Control
243443
this._opcodeMap.control_get_counter.labelFn = () => this._translator(messages.control_get_counter);

0 commit comments

Comments
 (0)