mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 18:05:05 +01:00
Log script messages to debug instead of info.
This commit is contained in:
@@ -44,16 +44,16 @@ public class ScriptLoader {
|
||||
if (sm != null) {
|
||||
throw new Exception("Script loader already initialized");
|
||||
}
|
||||
|
||||
|
||||
// Create script engine
|
||||
sm = new ScriptEngineManager();
|
||||
engine = sm.getEngineByName("luaj");
|
||||
factory = getEngine().getFactory();
|
||||
|
||||
|
||||
// Lua stuff
|
||||
fileType = "lua";
|
||||
serializer = new LuaSerializer();
|
||||
|
||||
|
||||
// Set engine to replace require as a temporary fix to missing scripts
|
||||
LuajContext ctx = (LuajContext) engine.getContext();
|
||||
ctx.globals.set("require", new OneArgFunction() {
|
||||
@@ -62,11 +62,11 @@ public class ScriptLoader {
|
||||
return LuaValue.ZERO;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
LuaTable table = new LuaTable();
|
||||
Arrays.stream(EntityType.values()).forEach(e -> table.set(e.name().toUpperCase(), e.getValue()));
|
||||
ctx.globals.set("EntityType", table);
|
||||
|
||||
|
||||
ctx.globals.set("EventType", CoerceJavaToLua.coerce(new EventType())); // TODO - make static class to avoid instantiating a new class every scene
|
||||
ctx.globals.set("GadgetState", CoerceJavaToLua.coerce(new ScriptGadgetState()));
|
||||
ctx.globals.set("RegionShape", CoerceJavaToLua.coerce(new ScriptRegionShape()));
|
||||
@@ -75,11 +75,11 @@ public class ScriptLoader {
|
||||
scriptLibLua = CoerceJavaToLua.coerce(scriptLib);
|
||||
ctx.globals.set("ScriptLib", scriptLibLua);
|
||||
}
|
||||
|
||||
|
||||
public static ScriptEngine getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
|
||||
public static String getScriptType() {
|
||||
return fileType;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class ScriptLoader {
|
||||
return sc.get();
|
||||
}
|
||||
|
||||
Grasscutter.getLogger().info("Loading script " + path);
|
||||
Grasscutter.getLogger().debug("Loading script " + path);
|
||||
|
||||
File file = new File(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user