mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-06 08:57:45 +07:00
Updated Rhino
This commit is contained in:
parent
91c0235ff5
commit
1895c7b8e0
@ -39,7 +39,7 @@ allprojects{
|
|||||||
if(!project.hasProperty("versionType")) versionType = 'official'
|
if(!project.hasProperty("versionType")) versionType = 'official'
|
||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
|
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
|
||||||
rhinoVersion = '099aed6c82f8094b3ba39a273b8d2ba7bdcc6443'
|
rhinoVersion = '55bf0dac1cfa7770672fd26112512c733ca9d5dc'
|
||||||
|
|
||||||
loadVersionProps = {
|
loadVersionProps = {
|
||||||
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
|
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
|
||||||
|
@ -60,7 +60,7 @@ public class Scripts implements Disposable{
|
|||||||
|
|
||||||
public String runConsole(String text){
|
public String runConsole(String text){
|
||||||
try{
|
try{
|
||||||
Object o = context.evaluateString(scope, text, "console.js", 1, null);
|
Object o = context.evaluateString(scope, text, "console.js", 1);
|
||||||
if(o instanceof NativeJavaObject n) o = n.unwrap();
|
if(o instanceof NativeJavaObject n) o = n.unwrap();
|
||||||
if(o instanceof Undefined) o = "undefined";
|
if(o instanceof Undefined) o = "undefined";
|
||||||
return String.valueOf(o);
|
return String.valueOf(o);
|
||||||
@ -172,11 +172,11 @@ public class Scripts implements Disposable{
|
|||||||
try{
|
try{
|
||||||
if(currentMod != null){
|
if(currentMod != null){
|
||||||
//inject script info into file
|
//inject script info into file
|
||||||
context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1, null);
|
context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1);
|
||||||
}
|
}
|
||||||
context.evaluateString(scope,
|
context.evaluateString(scope,
|
||||||
wrap ? "(function(){'use strict';\n" + script + "\n})();" : script,
|
wrap ? "(function(){'use strict';\n" + script + "\n})();" : script,
|
||||||
file, 0, null);
|
file, 0);
|
||||||
return true;
|
return true;
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
if(currentMod != null){
|
if(currentMod != null){
|
||||||
@ -224,7 +224,7 @@ public class Scripts implements Disposable{
|
|||||||
if(!module.exists() || module.isDirectory()) return null;
|
if(!module.exists() || module.isDirectory()) return null;
|
||||||
return new ModuleSource(
|
return new ModuleSource(
|
||||||
new InputStreamReader(new ByteArrayInputStream((module.readString()).getBytes())),
|
new InputStreamReader(new ByteArrayInputStream((module.readString()).getBytes())),
|
||||||
null, new URI(moduleId), root.file().toURI(), validator);
|
new URI(moduleId), root.file().toURI(), validator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user