Skip to content

Commit

Permalink
Merge branch 'release/2.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Oct 13, 2021
2 parents 4854da1 + 2a2b6d7 commit e0c8a44
Show file tree
Hide file tree
Showing 17 changed files with 369 additions and 230 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ javafx {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
group 'pro.gravit.launcher'
version '2.0.2'
version '2.0.3'
def mainClassName = "pro.gravit.launcher.client.JavaRuntimeModule"

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -55,9 +55,9 @@ repositories {
}

dependencies {
implementation "pro.gravit.launcher:launcher-core:5.2.2"
implementation "pro.gravit.launcher:launcher-ws-api:5.2.2"
implementation "pro.gravit.launcher:launcher-client-api:5.2.2"
implementation "pro.gravit.launcher:launcher-core:5.2.3-SNAPSHOT"
implementation "pro.gravit.launcher:launcher-ws-api:5.2.3-SNAPSHOT"
implementation "pro.gravit.launcher:launcher-client-api:5.2.3-SNAPSHOT"
implementation "pro.gravit.utils.enfs:enfs:1.0.0-SNAPSHOT"
implementation 'io.netty:netty-codec-http:4.1.67.Final'
implementation 'com.github.oshi:oshi-core:5.8.1'
Expand Down
9 changes: 6 additions & 3 deletions runtime/scenes/settings/settings.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">

<!-- Навбар -->
<Pane id="header" prefHeight="100.0" prefWidth="900.0"><!-- Кнопки управления -->
<Pane id="controls" layoutX="31.0" layoutY="34.0" prefHeight="32.0" prefWidth="835.0"><!-- Кнопка назад -->
<Pane id="header" prefHeight="100.0" prefWidth="900.0">
<!-- Кнопки управления -->
<Pane id="controls" layoutX="31.0" layoutY="34.0" prefHeight="32.0" prefWidth="835.0">
<!-- Кнопка назад -->
<Button id="back" layoutX="-25.0" layoutY="-6.0" mnemonicParsing="false" prefHeight="44.0"
prefWidth="56.0" styleClass="icon-button">
<graphic>
Expand Down Expand Up @@ -112,7 +114,8 @@
</Pane>

<!-- Папка проекта-->
<Pane id="folder" layoutX="241.0" layoutY="418.0" prefHeight="40.0" prefWidth="624.0"><!-- Путь к папкам-->
<Pane id="folder" layoutX="241.0" layoutY="418.0" prefHeight="40.0" prefWidth="624.0">
<!-- Путь к папкам-->
<Hyperlink id="path" focusTraversable="false" prefHeight="40.0" prefWidth="478.0" text="C:/Users">
<padding>
<Insets left="28.0" right="10.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class JavaRuntimeModule extends LauncherModule {
private RuntimeProvider provider;

public JavaRuntimeModule() {
super(new LauncherModuleInfo("StdJavaRuntime", new Version(2, 0, 2, 1, Version.Type.STABLE),
super(new LauncherModuleInfo("StdJavaRuntime", new Version(2, 0, 3, 1, Version.Type.STABLE),
0, new String[]{}, new String[]{"runtime"}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import pro.gravit.launcher.client.gui.impl.*;
import pro.gravit.launcher.client.gui.scenes.AbstractScene;
import pro.gravit.launcher.client.gui.service.JavaService;
import pro.gravit.launcher.client.gui.service.PingService;
import pro.gravit.launcher.client.gui.service.RuntimeDialogService;
import pro.gravit.launcher.client.gui.service.StateService;
import pro.gravit.launcher.client.gui.stage.PrimaryStage;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class JavaFXApplication extends Application {
public SkinManager skinManager;
public FXMLFactory fxmlFactory;
public JavaService javaService;
public PingService pingService;
public TriggerManager triggerManager;
private SettingsManager settingsManager;
private PrimaryStage mainStage;
Expand Down Expand Up @@ -112,6 +114,7 @@ public void init() throws Exception {
skinManager = new SkinManager(this);
triggerManager = new TriggerManager(this);
javaService = new JavaService(this);
pingService = new PingService();
registerCommands();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ public class GuiModuleConfig {
public boolean forceDownloadJava;
@LauncherInject(value = "modules.javaruntime.javalist")
public Map<String, String> javaList;
@LauncherInject(value = "modules.javaruntime.lazy")
public boolean lazy;

public static Object getDefault() {
GuiModuleConfig config = new GuiModuleConfig();
config.createAccountURL = "https://gravit.pro/createAccount.php";
config.forgotPassURL = "https://gravit.pro/fogotPass.php";
config.hastebinServer = "https://hastebin.com";
config.lazy = true;
config.javaList = new HashMap<>();
return config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pro.gravit.launcher.request.RequestException;
import pro.gravit.utils.helper.LogHelper;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;

Expand All @@ -22,13 +23,17 @@ public abstract class AbstractVisualComponent {
protected Pane layout;
private String sysFxmlPath;
private Parent sysFxmlRoot;
private CompletableFuture<Node> sysFxmlFuture;
boolean isInit;
protected boolean isResetOnShow = false;

protected AbstractVisualComponent(String fxmlPath, JavaFXApplication application) {
this.application = application;
this.sysFxmlPath = fxmlPath;
this.contextHelper = new ContextHelper(this);
if(application.guiModuleConfig.lazy) {
this.sysFxmlFuture = application.fxmlFactory.getAsync(sysFxmlPath);
}
}

public static void fade(Node region, double delay, double from, double to, EventHandler<ActionEvent> onFinished) {
Expand All @@ -54,7 +59,10 @@ public boolean isInit() {
protected synchronized Parent getFxmlRoot() {
try {
if (sysFxmlRoot == null) {
sysFxmlRoot = (Parent) application.fxmlFactory.getAsync(sysFxmlPath).get();
if(sysFxmlFuture == null) {
this.sysFxmlFuture = application.fxmlFactory.getAsync(sysFxmlPath);
}
sysFxmlRoot = (Parent) sysFxmlFuture.get();
}
return sysFxmlRoot;
} catch (InterruptedException e) {
Expand Down
Loading

0 comments on commit e0c8a44

Please sign in to comment.