From 89027479c182416df8b0ba8d131bed2a28b55b8d Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 26 Oct 2018 22:29:26 +0700 Subject: [PATCH] =?UTF-8?q?LauncherEngine=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D0=B7=D0=B8=D1=80=D1=83=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D1=80=D1=83=D1=85=D0=BA=D0=B8=20=D0=BA=D0=BB=D0=B8?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/ru/gravit/launcher/LauncherEngine.java | 6 +++++- .../main/java/ru/gravit/launcher/client/ClientLauncher.java | 3 +++ libLauncher/src/main/java/ru/gravit/launcher/Launcher.java | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) 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;