Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Dec 23, 2023
1 parent d15d6ea commit a84da6c
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions HMCL/src/main/java/net/burningtnt/hmclprs/Hooks.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package net.burningtnt.hmclprs;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;

import javax.swing.*;
import java.util.Optional;

import static org.jackhuang.hmcl.util.i18n.I18n.i18n;

Expand All @@ -13,17 +9,10 @@ private Hooks() {
}

public static void onApplicationLaunch() {
try {
Optional<ButtonType> opt = new Alert(Alert.AlertType.CONFIRMATION, i18n("prs.warning")).showAndWait();
if (opt.isPresent() && opt.get() == ButtonType.YES) {
return;
}
} catch (Throwable ignored) {
if (JOptionPane.showConfirmDialog(
null, i18n("prs.warning"), i18n("message.warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE
) == JOptionPane.OK_OPTION) {
return;
}
if (JOptionPane.showConfirmDialog(
null, i18n("prs.warning"), i18n("message.warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE
) == JOptionPane.OK_OPTION) {
return;
}
System.exit(1);
}
Expand Down

0 comments on commit a84da6c

Please sign in to comment.