diff --git a/launcher/package_linux.sh b/launcher/package_linux.sh index 1e8c7f3..8c650c1 100755 --- a/launcher/package_linux.sh +++ b/launcher/package_linux.sh @@ -7,15 +7,14 @@ function join_by { fi } -mvn clean package javafx:jlink -DskipDebug=true -DstripJavaDebugAttributes=true -DnoHeaderFiles=true -DnoManPages=true - +mvn clean package cd target module_jars=(lib/*) -eligible_main_jars=("*jar-with-dependencies.jar") +eligible_main_jars=("*.jar") main_jar=(${eligible_main_jars[0]}) -module_path=$(join_by ";" ${module_jars[@]}) -module_path="$main_jar;$module_path" - +module_path=$(join_by ":" ${module_jars[@]}) +module_path="$main_jar:$module_path" +echo $module_path jpackage \ --name "Ace of Shades Launcher" \ --app-version "1.0.0" \ @@ -24,8 +23,6 @@ jpackage \ --linux-deb-maintainer "andrewlalisofficial@gmail.com" \ --linux-menu-group "Game" \ --linux-app-category "Game" \ - --runtime-image image \ - --main-jar $main_jar \ - --main-class nl.andrewl.aos2_launcher.Launcher \ - --input . + --module-path "$module_path" \ + --module aos2_launcher/nl.andrewl.aos2_launcher.Launcher diff --git a/launcher/src/main/java/nl/andrewl/aos2_launcher/view/EditProfileDialog.java b/launcher/src/main/java/nl/andrewl/aos2_launcher/view/EditProfileDialog.java index ef765d8..e6a4374 100644 --- a/launcher/src/main/java/nl/andrewl/aos2_launcher/view/EditProfileDialog.java +++ b/launcher/src/main/java/nl/andrewl/aos2_launcher/view/EditProfileDialog.java @@ -42,17 +42,26 @@ public class EditProfileDialog extends Dialog { .or(usernameField.textProperty().isEmpty()); nameField.setText(profile.getName()); usernameField.setText(profile.getUsername()); - VersionFetcher.INSTANCE.getAvailableReleases().thenAccept(releases -> Platform.runLater(() -> { - clientVersionChoiceBox.setItems(FXCollections.observableArrayList(releases.stream().map(ClientVersionRelease::tag).toList())); - // If the profile doesn't have a set version, use the latest release. - if (profile.getClientVersion() == null || profile.getClientVersion().isBlank()) { - String lastRelease = releases.size() == 0 ? null : releases.get(0).tag(); - if (lastRelease != null) { - clientVersionChoiceBox.setValue(lastRelease); - } - } else { - clientVersionChoiceBox.setValue(profile.getClientVersion()); - } + VersionFetcher.INSTANCE.getAvailableReleases() + .whenComplete((releases, throwable) -> Platform.runLater(() -> { + if (throwable == null) { + clientVersionChoiceBox.setItems(FXCollections.observableArrayList(releases.stream().map(ClientVersionRelease::tag).toList())); + // If the profile doesn't have a set version, use the latest release. + if (profile.getClientVersion() == null || profile.getClientVersion().isBlank()) { + String lastRelease = releases.size() == 0 ? null : releases.get(0).tag(); + if (lastRelease != null) { + clientVersionChoiceBox.setValue(lastRelease); + } + } else { + clientVersionChoiceBox.setValue(profile.getClientVersion()); + } + } else { + throwable.printStackTrace(); + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.initOwner(this.getOwner()); + alert.setContentText("An error occurred while fetching the latest game releases: " + throwable.getMessage()); + alert.show(); + } })); jvmArgsTextArea.setText(profile.getJvmArgs());