File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed
Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export function customTokens(t: (key: string) => string): typeof Blockly.Msg {
4949 ENABLED : t ( 'BLOCKLY.ENABLED' ) ,
5050 DISPLAY_NAME : t ( 'BLOCKLY.DISPLAY_NAME' ) ,
5151 DISPLAY_GROUP : t ( 'BLOCKLY.DISPLAY_GROUP' ) ,
52+ NO_MECHANISM_CONTENTS : t ( 'BLOCKLY.NO_MECHANISM_CONTENTS' ) ,
5253 OPMODE_TYPE_TOOLTIP : t ( 'BLOCKLY.TOOLTIP.OPMODE_TYPE_TOOLTIP' ) ,
5354 OPMODE_ENABLED_TOOLTIP : t ( 'BLOCKLY.TOOLTIP.OPMODE_ENABLED_TOOLTIP' ) ,
5455 OPMODE_NAME_TOOLTIP : t ( 'BLOCKLY.TOOLTIP.OPMODE_NAME_TOOLTIP' ) ,
Original file line number Diff line number Diff line change 5454 "DISPLAY_NAME" : " Display Name" ,
5555 "DISPLAY_GROUP" : " Display Group" ,
5656 "PRINT" : " print" ,
57+ "NO_MECHANISM_CONTENTS" : " No Mechanism Contents" ,
5758 "TOOLTIP" :{
5859 "EVALUATE_BUT_IGNORE_RESULT" : " Executes the connected block and ignores the result. Allows you to call a function and ignore the return value." ,
5960 "OPMODE_TYPE" : " What sort of OpMode this is" ,
Original file line number Diff line number Diff line change 5454 "ENABLED" : " Habilitado" ,
5555 "DISPLAY_NAME" : " Nombre a Mostrar" ,
5656 "DISPLAY_GROUP" : " Grupo a Mostrar" ,
57+ "PRINT" : " imprimir" ,
58+ "NO_MECHANISM_CONTENTS" : " Sin Contenido de Mecanismo" ,
5759 "TOOLTIP" : {
5860 "EVALUATE_BUT_IGNORE_RESULT" : " Ejecuta el bloque conectado e ignora el resultado. Te permite llamar una función e ignorar el valor de retorno." ,
5961 "OPMODE_TYPE" : " Qué tipo de OpMode es este" ,
Original file line number Diff line number Diff line change 5454 "DISPLAY_NAME" : " שם תצוגה" ,
5555 "DISPLAY_GROUP" : " קבוצת תצוגה" ,
5656 "PRINT" : " הדפס" ,
57+ "NO_MECHANISM_CONTENTS" : " אין תוכן מנגנון" ,
5758 "TOOLTIP" :{
5859 "EVALUATE_BUT_IGNORE_RESULT" : " מריץ את הבלוק המחובר ומתעלם מהתוצאה. מאפשר לך לקרוא לפונקציה ולהתעלם מערך ההחזרה." ,
5960 "OPMODE_TYPE" : " איזה סוג של מצב פעולה זה" ,
Original file line number Diff line number Diff line change @@ -92,14 +92,19 @@ function getRobotMechanismsCategory(currentModule: storageModule.Module): toolbo
9292
9393 if ( editor ) {
9494 editor . getMechanismsFromRobot ( ) . forEach ( mechanismInRobot => {
95- const mechanismBlocks : toolboxItems . Block [ ] = [ ] ;
95+ const mechanismBlocks : toolboxItems . Item [ ] = [ ] ;
9696
9797 // Add the blocks for this mechanism's methods.
9898 const mechanism = editor . getMechanism ( mechanismInRobot ) ;
9999 if ( mechanism ) {
100100 const methodsFromMechanism = editor . getMethodsFromMechanism ( mechanism ) ;
101101 addInstanceMechanismBlocks ( mechanismInRobot , methodsFromMechanism , mechanismBlocks ) ;
102102
103+ if ( mechanismBlocks . length === 0 ) {
104+ const label : toolboxItems . Label = new toolboxItems . Label ( Blockly . Msg [ 'NO_MECHANISM_CONTENTS' ] ) ;
105+ mechanismBlocks . push ( label ) ;
106+ }
107+
103108 contents . push ( {
104109 kind : 'category' ,
105110 name : mechanismInRobot . name ,
You can’t perform that action at this time.
0 commit comments