Compare commits

..

1 Commits

Author SHA1 Message Date
comp500
8beded7b41 Improve UX when there are no optional mods 2020-12-06 19:05:56 +00:00

View File

@@ -180,9 +180,16 @@ class InstallWindow : IUserInterface {
override fun showOptions(options: List<IOptionDetails>): Future<Boolean> { override fun showOptions(options: List<IOptionDetails>): Future<Boolean> {
val future = CompletableFuture<Boolean>() val future = CompletableFuture<Boolean>()
EventQueue.invokeLater { EventQueue.invokeLater {
OptionsSelectWindow(options, future, frmPackwizlauncher).apply { if (options.isEmpty()) {
defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE JOptionPane.showMessageDialog(null,
isVisible = true "This modpack has no optional mods!",
"Optional mods", JOptionPane.INFORMATION_MESSAGE)
future.complete(false)
} else {
OptionsSelectWindow(options, future, frmPackwizlauncher).apply {
defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE
isVisible = true
}
} }
} }
return future return future
@@ -201,7 +208,7 @@ class InstallWindow : IUserInterface {
override fun disableOptionsButton() { override fun disableOptionsButton() {
btnOptions.apply { btnOptions.apply {
text = "Optional mods..." text = "No optional mods"
isEnabled = false isEnabled = false
} }
} }