diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java index d193ead4..e7cbf351 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java @@ -204,7 +204,7 @@ public void start(String... args) throws Throwable { // Load init.js script loadScript(Launcher.API_SCRIPT_FILE); loadScript(Launcher.INIT_SCRIPT_FILE); - loadScript("config.js"); + loadScript(Launcher.CONFIG_SCRIPT_FILE); loadScript("dialog/dialog.js"); LogHelper.info("Invoking start() function"); Invocable invoker = (Invocable) engine; @@ -216,4 +216,8 @@ public void start(String... args) throws Throwable { Launcher.modulesManager.postInitModules(); invoker.invokeFunction("start", (Object) args); } + public static LauncherEngine clientInstance() + { + return new LauncherEngine(); + } } diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index 39cb1c7a..eeffdea4 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -401,6 +401,9 @@ else if(isDownloadJava) public static void main(String... args) throws Throwable { Launcher.modulesManager = new ClientModuleManager(null); LauncherConfig.getAutogenConfig().initModules(); //INIT + LauncherEngine engine = LauncherEngine.clientInstance(); + engine.loadScript(Launcher.API_SCRIPT_FILE); + engine.loadScript(Launcher.CONFIG_SCRIPT_FILE); Launcher.modulesManager.preInitModules(); if (Launcher.isUsingAvanguard()) { AvanguardStarter.load(); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java index 80ce866f..35079af5 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java @@ -59,6 +59,7 @@ static int readBuildNumber() { public static final String INIT_SCRIPT_FILE = "init.js"; @LauncherAPI public static final String API_SCRIPT_FILE = "engine/api.js"; + public static final String CONFIG_SCRIPT_FILE = "config.js"; private static final Pattern UUID_PATTERN = Pattern.compile("-", Pattern.LITERAL); public static int MAJOR = 4;