优化游戏内控制台的显示

This commit is contained in:
shijian 2023-12-19 17:42:49 +08:00
parent 9571e0d266
commit 00a1dd10bd
1 changed files with 5 additions and 2 deletions

View File

@ -51704,8 +51704,11 @@ new Promise(resolve=>{
if(Array.isArray(obj)){ if(Array.isArray(obj)){
return `[${obj.map(v=>parse(v))}]`; return `[${obj.map(v=>parse(v))}]`;
}else if(typeof obj=='function'){ }else if(typeof obj=='function'){
return `Function`; return `[Function ${obj.name}]`;
}else if(typeof obj!='string'){ }else if(typeof obj!='string'){
if(obj instanceof Error){
return `<span style="color:red;">${String(obj)}</span>`;
}
return String(obj); return String(obj);
}else{ }else{
return `'${String(obj)}'`; return `'${String(obj)}'`;
@ -51749,7 +51752,7 @@ new Promise(resolve=>{
text.scrollTop=text.scrollHeight; text.scrollTop=text.scrollHeight;
} }
if(_status.toprint){ if(_status.toprint){
game.print(...status.toprint); game.print(..._status.toprint);
delete _status.toprint; delete _status.toprint;
} }
runButton.listen(runCommand); runButton.listen(runCommand);