Skip to content

Commit

Permalink
splash always waits for the UI to be displayed before moving on to the
Browse files Browse the repository at this point in the history
next op
  • Loading branch information
madhephaestus committed Nov 16, 2024
1 parent be56854 commit ce8685b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/main/java/com/neuronrobotics/bowlerstudio/SplashManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.neuronrobotics.bowlerstudio.assets.StudioBuildInfo;

import javafx.application.Platform;
import javafx.scene.image.Image;

public class SplashManager {
Expand Down Expand Up @@ -46,9 +47,20 @@ public static void renderSplashFrame(int frame, String message) {
initialize();
}
String string = frame + "% " + message;
com.neuronrobotics.sdk.common.Log.error(" Splash Rendering " + frame + " " + message);
System.out.println(" Splash Rendering " + frame + " " + message);
PsudoSplash.get().setMessage(string);
updateSplash();

if (Platform.isFxApplicationThread())
throw new RuntimeException("Splash manager can not be opened from a javafx thread!");
while(!SplashManager.isVisableSplash()) {
System.out.println("Waiting for splash to open before moving on");
try {
Thread.sleep(100);
} catch (InterruptedException e) {
return;
}
}
}

private static void initialize() {
Expand Down

0 comments on commit ce8685b

Please sign in to comment.