diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java index 0c216d945..6e51b595c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java @@ -123,7 +123,7 @@ public final class Controllers { } public static void dialog(String text, String title, int type, Runnable onAccept) { - dialog(new MessageDialogPane(text, title, decorator.getDialog(), MessageBox.INFORMATION_MESSAGE, onAccept)); + dialog(new MessageDialogPane(text, title, decorator.getDialog(), type, onAccept)); } public static void confirmDialog(String text, String title, Runnable onAccept, Runnable onCacnel) { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java index 414ca9ae3..17fa34f65 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java @@ -68,7 +68,7 @@ public final class LeftPaneController { iconedItem.prefWidthProperty().bind(leftPane.widthProperty()); iconedItem.setOnMouseClicked(e -> Controllers.navigate(Controllers.getSettingsPage())); })) - .startCategory(Main.i18n("profile")) + .startCategory(Main.i18n("profile").toUpperCase()) .add(profilePane); EventBus.EVENT_BUS.channel(ProfileLoadingEvent.class).register(this::onProfilesLoading); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java index 54e99765b..843cd036c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java @@ -64,7 +64,7 @@ public final class MessageDialogPane extends StackPane { Optional.ofNullable(onAccept).ifPresent(Runnable::run); }); - actions.getChildren().remove(cancelButton); + //actions.getChildren().remove(cancelButton); switch (type) { case MessageBox.INFORMATION_MESSAGE: @@ -79,11 +79,14 @@ public final class MessageDialogPane extends StackPane { case MessageBox.WARNING_MESSAGE: graphic.setGraphic(SVG.alert("black", 40, 40)); break; + case MessageBox.QUESTION_MESSAGE: + graphic.setGraphic(SVG.help_circle("black", 40, 40)); + break; } } public MessageDialogPane(String text, String title, JFXDialog dialog, Runnable onAccept, Runnable onCancel) { - this(text, title, dialog, -1, onAccept); + this(text, title, dialog, MessageBox.QUESTION_MESSAGE, onAccept); cancelButton.setVisible(true); cancelButton.setOnMouseClicked(e -> { @@ -95,9 +98,7 @@ public final class MessageDialogPane extends StackPane { acceptButton.setText(Main.i18n("button.yes")); cancelButton.setText(Main.i18n("button.no")); - actions.getChildren().add(cancelButton); - - graphic.setGraphic(SVG.help_circle("black", 40, 40)); + //actions.getChildren().add(cancelButton); } public void disableClosingDialog() { diff --git a/HMCL/src/main/resources/assets/fxml/task-dialog.fxml b/HMCL/src/main/resources/assets/fxml/task-dialog.fxml index 71a8aee36..1532422fd 100644 --- a/HMCL/src/main/resources/assets/fxml/task-dialog.fxml +++ b/HMCL/src/main/resources/assets/fxml/task-dialog.fxml @@ -7,16 +7,30 @@ + + + - - - - - - + + + + +
+ + +
+ + + + + +
diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 0c57ff7dc..651e7b70d 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -152,7 +152,7 @@ launch.failed.downloading_libraries=Did not finish downloading libraries, contin launch.failed.executable_permission=Unable to add permission to the launch script launch.failed.exited_abnormally=Game exited abnormally, please visit the log, or ask someone for help. launch.failed.prelaunch_command=Prelaunch command fail. -launch.state.dependencies=Decompressing natives +launch.state.dependencies=Dependencies launch.state.done=Done launch.state.logging_in=Logging In launch.state.modpack=Preparing for modpack diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/task/FileDownloadTask.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/task/FileDownloadTask.java index ab7de89d5..85d082346 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/task/FileDownloadTask.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/task/FileDownloadTask.java @@ -198,11 +198,11 @@ public class FileDownloadTask extends Task { if (!FileUtils.makeDirectory(file.getAbsoluteFile().getParentFile())) throw new IOException("Unable to make parent directory " + file); if (!temp.renameTo(file)) - throw new IOException("Unable move temp file to " + file); + throw new IOException("Unable to move temp file from " + temp + " to " + file); } if (downloaded != contentLength) - throw new IllegalStateException("Unexptected file size: " + downloaded + ", expected: " + contentLength); + throw new IllegalStateException("Unexpected file size: " + downloaded + ", expected: " + contentLength); // Check hash code if (hash != null) {