mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +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 scriptName = "base.js"
|
||||||
var modName = "none"
|
var modName = "none"
|
||||||
|
|
||||||
const print = text => log(scriptName, text);
|
const print = text => log(modName + "/" + scriptName, text);
|
||||||
|
|
||||||
const extendContent = function(classType, name, params){
|
const extendContent = function(classType, name, params){
|
||||||
return new JavaAdapter(classType, params, name)
|
return new JavaAdapter(classType, params, name)
|
||||||
|
@ -91,6 +91,9 @@ public class Scripts implements Disposable{
|
|||||||
context.evaluateString(scope, script, file, 1, null);
|
context.evaluateString(scope, script, file, 1, null);
|
||||||
return true;
|
return true;
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
|
if(currentMod != null){
|
||||||
|
file = currentMod.name + "/" + file;
|
||||||
|
}
|
||||||
log(LogLevel.err, file, "" + getError(t));
|
log(LogLevel.err, file, "" + getError(t));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user