Skip to content

Commit 73a0b83

Browse files
author
IMS212
committed
Iris Installer 2.0.5
Supports edition suggestions
1 parent fa541ee commit 73a0b83

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
org.gradle.jvmargs=-Xmx1G
33

44
# Version and packaging info
5-
version=2.0.4
5+
version=2.0.5
66
maven_group=net.hypercubemc
77
archives_base_name=Iris-Installer
88

src/main/java/net/hypercubemc/iris_installer/Installer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ public void start() {
199199
button = new JButton("Install");
200200
button.addActionListener(action -> {
201201
if (!EDITIONS.stream().filter(edition -> edition.name.equals(selectedEditionName)).findFirst().get().compatibleVersions.contains(selectedVersion)) {
202-
JOptionPane.showMessageDialog(frame, "The selected edition is not compatible with the chosen game version.", "Incompatible Edition", JOptionPane.ERROR_MESSAGE);
202+
String[] editions = EDITIONS.stream().filter(edition -> edition.compatibleVersions.contains(selectedVersion)).map(InstallerMeta.Edition::getDisplayName).toArray(String[]::new);
203+
if (editions.length == 0 || editions == null) {
204+
JOptionPane.showMessageDialog(frame, "There are no editions compatible with the chosen game version.", "Incompatible Edition", JOptionPane.ERROR_MESSAGE);
205+
} else {
206+
JOptionPane.showMessageDialog(frame, "The selected edition is not compatible with the chosen game version, however it may be compatible with one of the following: " + Arrays.toString(editions), "Incompatible Edition", JOptionPane.ERROR_MESSAGE);
207+
}
203208
return;
204209
}
205210

src/main/java/net/hypercubemc/iris_installer/InstallerMeta.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,9 @@ public Edition(JSONObject jsonObject) {
6262
compatibleVersions.add(jsonObject.getJSONArray("compatible_versions").toList().get(i).toString());
6363
}
6464
}
65+
66+
public String getDisplayName() {
67+
return displayName;
68+
}
6569
}
6670
}

0 commit comments

Comments
 (0)