mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Вывод версии лаунчера и java в отладку
This commit is contained in:
parent
45b6f64cd7
commit
fc0d3abf6d
3 changed files with 32 additions and 11 deletions
|
@ -1,27 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.TextArea?>
|
||||
<?import java.net.URL?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextArea?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
|
||||
<!-- DrLeonardo Design -->
|
||||
|
||||
<Pane fx:id="overlay" prefHeight="450.0" prefWidth="693.0" xmlns="http://javafx.com/javafx/8.0.201"
|
||||
xmlns:fx="http://javafx.com/fxml/1">
|
||||
<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">
|
||||
<stylesheets>
|
||||
<URL value="@debug.css"/>
|
||||
<URL value="@../../styles.css"/>
|
||||
<URL value="@debug.css" />
|
||||
<URL value="@../../styles.css" />
|
||||
</stylesheets>
|
||||
|
||||
<!-- Debug controls -->
|
||||
<TextArea fx:id="output" prefHeight="450.0" prefWidth="693.0">
|
||||
<TextArea fx:id="output" prefHeight="405.0" prefWidth="693.0">
|
||||
<padding>
|
||||
<Insets left="10.0" right="10.0"/>
|
||||
<Insets left="10.0" right="10.0" />
|
||||
</padding>
|
||||
</TextArea>
|
||||
<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="Убить"/>
|
||||
<Pane layoutY="405.0" prefHeight="45.0" prefWidth="693.0" style="-fx-background-color: #ffffff;" />
|
||||
<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="Убить" />
|
||||
<Label fx:id="version" layoutX="14.0" layoutY="419.0" text="GravitLauncher" />
|
||||
</Pane>
|
||||
|
|
|
@ -4,6 +4,15 @@ var debug = {
|
|||
initOverlay: function() {
|
||||
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.setEditable(false);
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
import pro.gravit.launcher.managers.HasherStore;
|
||||
import pro.gravit.launcher.request.Request;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.Version;
|
||||
|
||||
public class FunctionalBridge {
|
||||
@LauncherAPI
|
||||
|
@ -111,4 +112,14 @@ public static void evalCommand(String cmd) {
|
|||
public static void addPlainOutput(LogHelper.Output output) {
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue