[FEATURE] Вывод версии лаунчера и java в отладку

This commit is contained in:
LoomeL 2019-08-09 22:51:10 +06:00
parent 45b6f64cd7
commit fc0d3abf6d
3 changed files with 32 additions and 11 deletions

View file

@ -1,27 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextArea?>
<?import java.net.URL?> <?import java.net.URL?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.Pane?>
<!-- DrLeonardo Design --> <!-- DrLeonardo Design -->
<Pane fx:id="overlay" prefHeight="450.0" prefWidth="693.0" xmlns="http://javafx.com/javafx/8.0.201" <Pane fx:id="overlay" prefHeight="450.0" prefWidth="693.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
xmlns:fx="http://javafx.com/fxml/1">
<stylesheets> <stylesheets>
<URL value="@debug.css" /> <URL value="@debug.css" />
<URL value="@../../styles.css" /> <URL value="@../../styles.css" />
</stylesheets> </stylesheets>
<!-- Debug controls --> <!-- Debug controls -->
<TextArea fx:id="output" prefHeight="450.0" prefWidth="693.0"> <TextArea fx:id="output" prefHeight="405.0" prefWidth="693.0">
<padding> <padding>
<Insets left="10.0" right="10.0" /> <Insets left="10.0" right="10.0" />
</padding> </padding>
</TextArea> </TextArea>
<Button fx:id="copy" defaultButton="true" layoutX="373.0" layoutY="415.0" prefHeight="30.0" prefWidth="100.0" <Pane layoutY="405.0" prefHeight="45.0" prefWidth="693.0" style="-fx-background-color: #ffffff;" />
text="Копировать"/> <Button fx:id="copy" defaultButton="true" layoutX="373.0" layoutY="415.0" prefHeight="30.0" prefWidth="100.0" text="Копировать" />
<Button fx:id="action" layoutX="533.0" layoutY="415.0" prefHeight="25.0" prefWidth="150.0" text="Убить" /> <Button fx:id="action" layoutX="533.0" layoutY="415.0" prefHeight="25.0" prefWidth="150.0" text="Убить" />
<Label fx:id="version" layoutX="14.0" layoutY="419.0" text="GravitLauncher" />
</Pane> </Pane>

View file

@ -4,6 +4,15 @@ var debug = {
initOverlay: function() { initOverlay: function() {
debug.overlay = loadFXML("dialog/overlay/debug/debug.fxml"); debug.overlay = loadFXML("dialog/overlay/debug/debug.fxml");
debug.overlay.lookup("#version").setText(
java.lang.String.format(
"%s | Java %s x%s",
FunctionalBridge.getLauncherVersion(),
java.lang.System.getProperty("java.version"),
JVMHelper.JVM_BITS
)
);
debug.output = debug.overlay.lookup("#output"); debug.output = debug.overlay.lookup("#output");
debug.output.setEditable(false); debug.output.setEditable(false);

View file

@ -18,6 +18,7 @@
import pro.gravit.launcher.managers.HasherStore; import pro.gravit.launcher.managers.HasherStore;
import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.Request;
import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.LogHelper;
import pro.gravit.utils.Version;
public class FunctionalBridge { public class FunctionalBridge {
@LauncherAPI @LauncherAPI
@ -111,4 +112,14 @@ public static void evalCommand(String cmd) {
public static void addPlainOutput(LogHelper.Output output) { public static void addPlainOutput(LogHelper.Output output) {
LogHelper.addOutput(output, LogHelper.OutputTypes.PLAIN); LogHelper.addOutput(output, LogHelper.OutputTypes.PLAIN);
} }
@LauncherAPI
public static String getLauncherVersion() {
return String.format("GravitLauncher v%d.%d.%d build %d",
Version.MAJOR,
Version.MINOR,
Version.PATCH,
Version.BUILD
);
}
} }