Hi beka
Thank you for your help. After changing the class name to "Blockly.icons.MutatorIcon", the program can run without generating any error message, but it doesn't have any effect.
This is
class code.
This is
block code.
I tried using another approach, and although it seems to be working fine now as shown in the video., I still encounter error messages. How can I avoid generating these errors?
blocks$$module$build$src$blocks$procedures.procedures_callnoreturn=Object.assign({},PROCEDURE_CALL_COMMON$$module$build$src$blocks$procedures,
{
init:function(){
this.appendDummyInput("TOPROW").appendField("","NAME");
this.setPreviousStatement(!0);
this.setNextStatement(!0);
this.setStyle("procedure_blocks");
this.setHelpUrl($.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_HELPURL);
this.arguments_=[];
this.argumentVarModels_=[];
this.quarkConnections_={};
this.quarkIds_=null;
this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon([],this));
this.previousEnabledState_=!0
this.arguments_=[];this.argumentVarModels_=[];
}
,defType_:"procedures_defnoreturn"
,decompose: function(a) {
const b=a.newBlock("procedures_defnoreturn");
b.initSvg();
return b
}
,compose: function(a) {
}
,saveConnections:function(a){
var xml = Blockly.Xml.workspaceToDom(Blockly.getMainWorkspace());
xml = new XMLSerializer().serializeToString(xml);
xml = new DOMParser().parseFromString(xml,"text/xml").firstChild.childNodes;
for (var i=0;i<xml.length;i++) {
if (xml[i].getAttribute("type")=="procedures_defnoreturn") {
for (var j=0;j<xml[i].childNodes.length;j++) {
if (xml[i].childNodes[j].textContent==this.getFieldValue("NAME")) {
xml = Blockly.Xml.domToPrettyText(xml[i]);
xml = Blockly.utils.xml.textToDom('<xml xmlns="
https://developers.google.com/blockly/xml">'+xml.replace("x=","xx=").replace("y=","yy=")+'</xml>');
a.workspace.clear();
Blockly.Xml.domToWorkspace(xml, a.workspace);
break;
}
}
}
}
}
});
blocks$$module$build$src$blocks$procedures.procedures_callreturn=Object.assign({},PROCEDURE_CALL_COMMON$$module$build$src$blocks$procedures,
{
init:function(){
this.appendDummyInput("TOPROW").appendField("","NAME");
this.setOutput(!0);
this.setStyle("procedure_blocks");
this.setHelpUrl($.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_HELPURL);
this.arguments_=[];
this.argumentVarModels_=[];
this.quarkConnections_={};
this.quarkIds_=null;
this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon([],this));
this.previousEnabledState_=!0
this.arguments_=[];this.argumentVarModels_=[];
}
,defType_:"procedures_defreturn"
,decompose: function(a) {
const b=a.newBlock("procedures_defreturn");
b.initSvg();
return b
}
,compose: function(a) {
}
,saveConnections:function(a){
var xml = Blockly.Xml.workspaceToDom(Blockly.getMainWorkspace());
xml = new XMLSerializer().serializeToString(xml);
xml = new DOMParser().parseFromString(xml,"text/xml").firstChild.childNodes;
for (var i=0;i<xml.length;i++) {
if (xml[i].getAttribute("type")=="procedures_defreturn") {
for (var j=0;j<xml[i].childNodes.length;j++) {
if (xml[i].childNodes[j].textContent==this.getFieldValue("NAME")) {
xml = Blockly.Xml.domToPrettyText(xml[i]);
xml = Blockly.utils.xml.textToDom('<xml xmlns="
https://developers.google.com/blockly/xml">'+xml.replace("x=","xx=").replace("y=","yy=")+'</xml>');
a.workspace.clear();
Blockly.Xml.domToWorkspace(xml, a.workspace);
break;
}
}
}
}
}
});

