(boolean silent)
| 676 | } |
| 677 | |
| 678 | public static void exit(boolean silent) { |
| 679 | if (exited) { |
| 680 | return; |
| 681 | } //don't allow exiting multiple times |
| 682 | |
| 683 | final List<String> options = new ArrayList<>(); |
| 684 | options.add(getLocalizer().getMessage("lblExit")); |
| 685 | options.add(getLocalizer().getMessage("lblCancel")); |
| 686 | |
| 687 | Consumer<Integer> callback = result -> { |
| 688 | if (result == 0) { |
| 689 | exited = true; |
| 690 | exitAnimation(false); |
| 691 | } |
| 692 | }; |
| 693 | |
| 694 | if (silent) { |
| 695 | callback.accept(0); |
| 696 | } else { |
| 697 | FOptionPane.showOptionDialog(getLocalizer().getMessage("lblAreYouSureYouWishExitForge"), "", |
| 698 | FOptionPane.QUESTION_ICON, options, 0, callback); |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | public static void openScreen(final FScreen screen0) { |
| 703 | openScreen(screen0, false); |
no test coverage detected