Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/blocks/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg {
ENABLED: t('BLOCKLY.ENABLED'),
DISPLAY_NAME: t('BLOCKLY.DISPLAY_NAME'),
DISPLAY_GROUP: t('BLOCKLY.DISPLAY_GROUP'),
NO_MECHANISM_CONTENTS: t('BLOCKLY.NO_MECHANISM_CONTENTS'),
OPMODE_TYPE_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_TYPE_TOOLTIP'),
OPMODE_ENABLED_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_ENABLED_TOOLTIP'),
OPMODE_NAME_TOOLTIP: t('BLOCKLY.TOOLTIP.OPMODE_NAME_TOOLTIP'),
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"DISPLAY_NAME": "Display Name",
"DISPLAY_GROUP": "Display Group",
"PRINT": "print",
"NO_MECHANISM_CONTENTS": "No Mechanism Contents",
"TOOLTIP":{
"EVALUATE_BUT_IGNORE_RESULT": "Executes the connected block and ignores the result. Allows you to call a function and ignore the return value.",
"OPMODE_TYPE": "What sort of OpMode this is",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"ENABLED": "Habilitado",
"DISPLAY_NAME": "Nombre a Mostrar",
"DISPLAY_GROUP": "Grupo a Mostrar",
"PRINT": "imprimir",
"NO_MECHANISM_CONTENTS": "Sin Contenido de Mecanismo",
"TOOLTIP": {
"EVALUATE_BUT_IGNORE_RESULT": "Ejecuta el bloque conectado e ignora el resultado. Te permite llamar una función e ignorar el valor de retorno.",
"OPMODE_TYPE": "Qué tipo de OpMode es este",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/he/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"DISPLAY_NAME": "שם תצוגה",
"DISPLAY_GROUP": "קבוצת תצוגה",
"PRINT": "הדפס",
"NO_MECHANISM_CONTENTS": "אין תוכן מנגנון",
"TOOLTIP":{
"EVALUATE_BUT_IGNORE_RESULT": "מריץ את הבלוק המחובר ומתעלם מהתוצאה. מאפשר לך לקרוא לפונקציה ולהתעלם מערך ההחזרה.",
"OPMODE_TYPE": "איזה סוג של מצב פעולה זה",
Expand Down
7 changes: 6 additions & 1 deletion src/toolbox/hardware_category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,19 @@ function getRobotMechanismsCategory(currentModule: storageModule.Module): toolbo

if (editor) {
editor.getMechanismsFromRobot().forEach(mechanismInRobot => {
const mechanismBlocks: toolboxItems.Block[] = [];
const mechanismBlocks: toolboxItems.Item[] = [];

// Add the blocks for this mechanism's methods.
const mechanism = editor.getMechanism(mechanismInRobot);
if (mechanism) {
const methodsFromMechanism = editor.getMethodsFromMechanism(mechanism);
addInstanceMechanismBlocks(mechanismInRobot, methodsFromMechanism, mechanismBlocks);

if(mechanismBlocks.length === 0){
const label : toolboxItems.Label = new toolboxItems.Label(Blockly.Msg['NO_MECHANISM_CONTENTS']);
mechanismBlocks.push( label );
}

contents.push({
kind: 'category',
name: mechanismInRobot.name,
Expand Down