mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
add mod name to js print() (#1677)
* add mod name to js print() * add mod name to errors
This commit is contained in:
parent
0534a4da45
commit
89a5c957fd
@ -5,7 +5,7 @@ const log = function(context, obj){
|
||||
var scriptName = "base.js"
|
||||
var modName = "none"
|
||||
|
||||
const print = text => log(scriptName, text);
|
||||
const print = text => log(modName + "/" + scriptName, text);
|
||||
|
||||
const extendContent = function(classType, name, params){
|
||||
return new JavaAdapter(classType, params, name)
|
||||
|
@ -91,6 +91,9 @@ public class Scripts implements Disposable{
|
||||
context.evaluateString(scope, script, file, 1, null);
|
||||
return true;
|
||||
}catch(Throwable t){
|
||||
if(currentMod != null){
|
||||
file = currentMod.name + "/" + file;
|
||||
}
|
||||
log(LogLevel.err, file, "" + getError(t));
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user