Skip to content

Commit 608c186

Browse files
authored
Fixed issue where block to call a robot method was missing the word "robot". (#290)
Also fixed several tooltips which were incorrect.
1 parent 5d77dab commit 608c186

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/blocks/mrc_call_python_function.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,22 +211,22 @@ const CALL_PYTHON_FUNCTION = {
211211
}
212212
case FunctionKind.EVENT: {
213213
const eventName = this.getFieldValue(FIELD_EVENT_NAME);
214-
tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_WITHIN_TOOLTIP;
214+
tooltip = Blockly.Msg.FIRE_EVENT_TOOLTIP;
215215
tooltip = tooltip.replace('{{eventName}}', eventName);
216216
break;
217217
}
218218
case FunctionKind.INSTANCE_COMPONENT: {
219219
const className = this.mrcComponentClassName;
220220
const functionName = this.getFieldValue(FIELD_FUNCTION_NAME);
221221
if (this.mrcMechanismId) {
222-
tooltip = Blockly.Msg.CALL_MECHANISM_COMPONENT_INSTANCE_METHOD;
222+
tooltip = Blockly.Msg.CALL_MECHANISM_COMPONENT_INSTANCE_METHOD_TOOLTIP;
223223
tooltip = tooltip
224224
.replace('{{className}}', className)
225225
.replace('{{functionName}}', functionName)
226226
.replace('{{componentName}}', this.getFieldValue(FIELD_COMPONENT_NAME))
227227
.replace('{{mechanismName}}', this.getFieldValue(FIELD_MECHANISM_NAME));
228228
} else {
229-
tooltip = Blockly.Msg.CALL_COMPONENT_INSTANCE_METHOD;
229+
tooltip = Blockly.Msg.CALL_COMPONENT_INSTANCE_METHOD_TOOLTIP;
230230
tooltip = tooltip
231231
.replace('{{className}}', className)
232232
.replace('{{functionName}}', functionName)
@@ -236,18 +236,18 @@ const CALL_PYTHON_FUNCTION = {
236236
}
237237
case FunctionKind.INSTANCE_ROBOT: {
238238
const functionName = this.getFieldValue(FIELD_FUNCTION_NAME);
239-
tooltip = Blockly.Msg.CALL_INSTANCE_METHOD_WITHIN_TOOLTIP;
239+
tooltip = Blockly.Msg.CALL_ROBOT_INSTANCE_METHOD_TOOLTIP;
240240
tooltip = tooltip.replace('{{functionName}}', functionName);
241241
break;
242242
}
243243
case FunctionKind.INSTANCE_MECHANISM: {
244244
const className = this.mrcMechanismClassName;
245245
const functionName = this.getFieldValue(FIELD_FUNCTION_NAME);
246-
tooltip = Blockly.Msg.CALL_MECHANISM_INSTANCE_METHOD;
247-
tooltip = tooltip
248-
.replace('{{className}}', className)
249-
.replace('{{functionName}}', functionName)
250-
.replace('{{mechanismName}}', this.getFieldValue(FIELD_MECHANISM_NAME));
246+
tooltip = Blockly.Msg.CALL_MECHANISM_INSTANCE_METHOD_TOOLTIP;
247+
tooltip = tooltip
248+
.replace('{{className}}', className)
249+
.replace('{{functionName}}', functionName)
250+
.replace('{{mechanismName}}', this.getFieldValue(FIELD_MECHANISM_NAME));
251251
break;
252252
}
253253
default:
@@ -436,7 +436,7 @@ const CALL_PYTHON_FUNCTION = {
436436
case FunctionKind.INSTANCE_ROBOT: {
437437
this.appendDummyInput(INPUT_TITLE)
438438
.appendField(Blockly.Msg.CALL)
439-
.appendField(createFieldNonEditableText(Blockly.Msg.ROBOT))
439+
.appendField(createFieldNonEditableText(Blockly.Msg.ROBOT_LOWER_CASE))
440440
.appendField('.')
441441
.appendField(createFieldNonEditableText(''), FIELD_FUNCTION_NAME);
442442
break;

src/i18n/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"PRINT": "print",
142142
"NO_MECHANISM_CONTENTS": "No Mechanism Contents",
143143
"CALL": "call",
144-
"ROBOT": "robot",
144+
"ROBOT_LOWER_CASE": "robot",
145145
"CREATE": "create",
146146
"FIRE": "fire",
147147
"GET": "get",

src/i18n/locales/es/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"PRINT": "imprimir",
143143
"NO_MECHANISM_CONTENTS": "Sin Contenido de Mecanismo",
144144
"CALL": "llamar",
145-
"ROBOT": "robot",
145+
"ROBOT_LOWER_CASE": "robot",
146146
"CREATE": "crear",
147147
"FIRE": "disparar",
148148
"GET": "obtener",

src/i18n/locales/he/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"PRINT": "הדפס",
142142
"NO_MECHANISM_CONTENTS": "אין תוכן במנגנון",
143143
"CALL": "קרא",
144-
"ROBOT": "רובוט",
144+
"ROBOT_LOWER_CASE": "רובוט",
145145
"CREATE": "צור",
146146
"FIRE": "הפעל",
147147
"GET": "קבל",

0 commit comments

Comments
 (0)