From d89c8cc2d21391f8ae379ddbda37cbf9421507c6 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sun, 10 Oct 2021 17:12:49 +0800 Subject: [PATCH] fix(crash): not displaying memory and java version. --- .../jackhuang/hmcl/ui/GameCrashWindow.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java index f0b1c6d8f..4ea89c6f1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/GameCrashWindow.java @@ -91,6 +91,10 @@ public class GameCrashWindow extends Stage { this.launchOptions = launchOptions; this.logs = logs; this.analyzer = LibraryAnalyzer.analyze(version); + + memory = Optional.ofNullable(launchOptions.getMaxMemory()).map(i -> i + " MB").orElse("-"); + java = launchOptions.getJava().getVersion(); + this.view = new View(); setScene(new Scene(view, 800, 480)); @@ -98,10 +102,6 @@ public class GameCrashWindow extends Stage { setTitle(i18n("game.crash.title")); getIcons().add(newImage("/assets/img/icon.png")); - memory = Optional.ofNullable(launchOptions.getMaxMemory()).map(i -> i + " MB").orElse("-"); - java = launchOptions.getJava().getVersion(); - - analyzeCrashReport(); } @@ -258,8 +258,11 @@ public class GameCrashWindow extends Stage { titlePane.getChildren().setAll(title); } - HBox infoPane = new HBox(); + HBox infoPane = new HBox(8); { + infoPane.setPadding(new Insets(8)); + infoPane.setAlignment(Pos.CENTER_LEFT); + TwoLineListItem version = new TwoLineListItem(); version.getStyleClass().setAll("two-line-item-second-large"); version.setTitle(i18n("archive.game_version")); @@ -285,12 +288,14 @@ public class GameCrashWindow extends Stage { arch.setTitle(i18n("system.architecture")); arch.subtitleProperty().bind(GameCrashWindow.this.arch); - infoPane.setPadding(new Insets(8)); infoPane.getChildren().setAll(version, memory, java, os, arch); } - HBox moddedPane = new HBox(); + HBox moddedPane = new HBox(8); { + moddedPane.setPadding(new Insets(8)); + moddedPane.setAlignment(Pos.CENTER_LEFT); + for (LibraryAnalyzer.LibraryType type : LibraryAnalyzer.LibraryType.values()) { analyzer.getVersion(type).ifPresent(ver -> { TwoLineListItem item = new TwoLineListItem();