diff --git a/src/main/java/dev/tricht/lunaris/settings/AboutGUI.java b/src/main/java/dev/tricht/lunaris/settings/AboutGUI.java new file mode 100644 index 0000000..9861edc --- /dev/null +++ b/src/main/java/dev/tricht/lunaris/settings/AboutGUI.java @@ -0,0 +1,34 @@ +package dev.tricht.lunaris.settings; + +import dev.tricht.lunaris.AutoUpdateConfiguration; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Label; +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; +import java.net.URL; +import java.util.Properties; +import java.util.ResourceBundle; + +@Slf4j +public class AboutGUI implements Initializable { + + @FXML + private Label version; + + public AboutGUI(){ } + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + Properties properties = new Properties(); + try { + properties.load(AutoUpdateConfiguration.class.getResourceAsStream("/lunaris.properties")); + version.setText("Version " + properties.getProperty("version")); + } catch (IOException e) { + log.error("Failed to load lunaris.properties", e); + } + + } + +} diff --git a/src/main/resources/settings/about.fxml b/src/main/resources/settings/about.fxml index 3054071..43bd750 100644 --- a/src/main/resources/settings/about.fxml +++ b/src/main/resources/settings/about.fxml @@ -4,7 +4,8 @@ - + @@ -28,7 +29,8 @@