diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 49b4d55f..3f600029 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -15,7 +15,7 @@ jobs: submodules: recursive - name: Cache Gradle - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.gradle/caches key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher-runtime @@ -40,7 +40,7 @@ jobs: cp *.jar ../../artifacts - name: Upload artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: LauncherRuntime path: artifacts diff --git a/build.gradle b/build.gradle index f060be11..c763e070 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ javafx { sourceCompatibility = '17' targetCompatibility = '17' group 'pro.gravit.launcher' -version '4.0.5' +version '4.0.6' def mainClassName = "pro.gravit.launcher.gui.JavaRuntimeModule" task sourcesJar(type: Jar) { @@ -61,11 +61,11 @@ repositories { } dependencies { - implementation "pro.gravit.launcher:launcher-core:5.6.8" - implementation "pro.gravit.launcher:launcher-ws-api:5.6.8" - implementation "pro.gravit.launcher:launcher-client-api:5.6.8" - implementation "pro.gravit.launcher:launcher-client-start-api:5.6.8" - implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.8" + implementation "pro.gravit.launcher:launcher-core:5.6.9" + implementation "pro.gravit.launcher:launcher-ws-api:5.6.9" + implementation "pro.gravit.launcher:launcher-client-api:5.6.9" + implementation "pro.gravit.launcher:launcher-client-start-api:5.6.9" + implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.9" implementation "pro.gravit.utils.enfs:enfs:2.0.1-SNAPSHOT" implementation 'io.netty:netty-codec-http:4.1.67.Final' implementation 'com.github.oshi:oshi-core:5.8.1' diff --git a/src/main/java/pro/gravit/launcher/gui/JavaRuntimeModule.java b/src/main/java/pro/gravit/launcher/gui/JavaRuntimeModule.java index 84ce0e60..f70d07f7 100644 --- a/src/main/java/pro/gravit/launcher/gui/JavaRuntimeModule.java +++ b/src/main/java/pro/gravit/launcher/gui/JavaRuntimeModule.java @@ -29,7 +29,7 @@ public class JavaRuntimeModule extends LauncherModule { public JavaRuntimeModule() { super(new LauncherModuleInfo("StdJavaRuntime", - new Version(4, 0, 5, 1, Version.Type.STABLE), + new Version(4, 0, 6, 1, Version.Type.STABLE), 0, new String[]{}, new String[]{"runtime"})); } diff --git a/src/main/java/pro/gravit/launcher/gui/commands/runtime/InfoCommand.java b/src/main/java/pro/gravit/launcher/gui/commands/runtime/InfoCommand.java index 20bf49d9..bde11188 100644 --- a/src/main/java/pro/gravit/launcher/gui/commands/runtime/InfoCommand.java +++ b/src/main/java/pro/gravit/launcher/gui/commands/runtime/InfoCommand.java @@ -31,6 +31,7 @@ public String getUsageDescription() { public void invoke(String... args) { Platform.runLater(() -> { LogHelper.info("OS %s ARCH %s Java %d", JVMHelper.OS_TYPE.name(), JVMHelper.ARCH_TYPE.name(), JVMHelper.JVM_VERSION); + LogHelper.info("JavaFX version: %s", System.getProperty( "javafx.runtime.version")); { List supportedFeatures = new ArrayList<>(); List unsupportedFeatures = new ArrayList<>(); diff --git a/src/main/java/pro/gravit/launcher/gui/overlays/AbstractOverlay.java b/src/main/java/pro/gravit/launcher/gui/overlays/AbstractOverlay.java index 04705e8b..e59a30ef 100644 --- a/src/main/java/pro/gravit/launcher/gui/overlays/AbstractOverlay.java +++ b/src/main/java/pro/gravit/launcher/gui/overlays/AbstractOverlay.java @@ -1,6 +1,7 @@ package pro.gravit.launcher.gui.overlays; import javafx.animation.FadeTransition; +import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Node; @@ -25,6 +26,9 @@ public final void init() throws Exception { } public final void hide(double delay, EventHandler onFinished) { + if(!Platform.isFxApplicationThread()) { + throw new RuntimeException("hide() called from non FX application thread"); + } if (useCounter.decrementAndGet() != 0) { contextHelper.runInFxThread(() -> { if (onFinished != null) { @@ -60,6 +64,9 @@ public void enable() { } public void show(AbstractStage stage, EventHandler onFinished) throws Exception { + if(!Platform.isFxApplicationThread()) { + throw new RuntimeException("show() called from non FX application thread"); + } if (!isInit()) { init(); } diff --git a/src/main/java/pro/gravit/launcher/gui/overlays/ProcessingOverlay.java b/src/main/java/pro/gravit/launcher/gui/overlays/ProcessingOverlay.java index 43ec507e..d74c3af5 100644 --- a/src/main/java/pro/gravit/launcher/gui/overlays/ProcessingOverlay.java +++ b/src/main/java/pro/gravit/launcher/gui/overlays/ProcessingOverlay.java @@ -54,26 +54,26 @@ public final void processRequest(AbstractStage stage, public final void processRequest(AbstractStage stage, String message, Request request, Consumer onSuccess, Consumer onException, EventHandler onError) { try { - show(stage, (e) -> { + ContextHelper.runInFxThreadStatic(() -> show(stage, (e) -> { try { description.setText(message); application.service.request(request).thenAccept((result) -> { LogHelper.dev("RequestFuture complete normally"); onSuccess.accept(result); - hide(0, null); + ContextHelper.runInFxThreadStatic(() -> hide(0, null)); }).exceptionally((error) -> { if (onException != null) onException.accept(error); else ContextHelper.runInFxThreadStatic(() -> errorHandle(error.getCause())); - hide(2500, onError); + ContextHelper.runInFxThreadStatic(() -> hide(2500, onError)); return null; }); } catch (IOException ex) { errorHandle(ex); hide(2500, onError); } - }); + })); } catch (Exception e) { - errorHandle(e); + ContextHelper.runInFxThreadStatic(() -> errorHandle(e)); } } }