Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit 18e6588

Browse files
committed
0.6
1 parent e8340d4 commit 18e6588

File tree

6 files changed

+28
-9
lines changed

6 files changed

+28
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/.gradle/
33
/build/
44
/build/classes/java/main/
5-
/out/
5+
/out/
6+
modcheck.json

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group 'com.redlimerl'
7-
version '0.5.4'
7+
version '0.6'
88
repositories {
99
mavenCentral()
1010
}

src/main/java/com/pistacium/modcheck/ModCheck.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.google.gson.JsonParser;
55
import com.pistacium.modcheck.mod.ModData;
66
import com.pistacium.modcheck.mod.version.ModVersion;
7-
import com.pistacium.modcheck.util.Config;
87
import com.pistacium.modcheck.util.ModCheckStatus;
98
import com.pistacium.modcheck.util.ModCheckUtils;
109

@@ -33,8 +32,6 @@ public static void setStatus(ModCheckStatus status) {
3332

3433
public static final ArrayList<ModData> AVAILABLE_MODS = new ArrayList<>();
3534

36-
public static Config config;
37-
3835

3936
public static void main(String[] args) {
4037
THREAD_EXECUTOR.submit(() -> {
@@ -51,7 +48,7 @@ public static void main(String[] args) {
5148

5249
// Get mod list
5350
setStatus(ModCheckStatus.LOADING_MOD_LIST);
54-
JsonElement modElement = JsonParser.parseString(Objects.requireNonNull(ModCheckUtils.getUrlRequest("https://me.redlimerl.com/mcsr/modcheck/v2")));
51+
JsonElement modElement = JsonParser.parseString(Objects.requireNonNull(ModCheckUtils.getUrlRequest("https://redlime.github.io/MCSRMods/meta/v3/mods.json")));
5552
FRAME_INSTANCE.getProgressBar().setValue(60);
5653

5754
setStatus(ModCheckStatus.LOADING_MOD_RESOURCE);

src/main/java/com/pistacium/modcheck/ModCheckConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public class ModCheckConstants {
44

5-
public static final String APPLICATION_VERSION = "0.5.3";
5+
public static final String APPLICATION_VERSION = "0.6";
66

77
}

src/main/java/com/pistacium/modcheck/ModCheckFrame.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private void initCenterLayout() {
269269
JButton selectAllButton = new JButton("Select All");
270270
selectAllButton.addActionListener(e -> {
271271
for (Map.Entry<ModData, JCheckBox> entry : modCheckBoxes.entrySet()) {
272-
if (entry.getKey().getIncompatibleMods().size() > 0) continue;
272+
if (!entry.getKey().getReadme().isEmpty() || entry.getKey().getIncompatibleMods().size() > 0) continue;
273273

274274
if (entry.getValue().isEnabled() && entry.getKey().getWarningMessage().isEmpty()) {
275275
entry.getValue().setSelected(true);
@@ -389,10 +389,25 @@ public void updateModList() {
389389
if (isSelected && !modData.getWarningMessage().isEmpty()) {
390390
JOptionPane.showMessageDialog(this, "<html><body>" + modData.getWarningMessage() + "<br>If you ignore this warning, your run being may get rejected.</body></html>", "WARNING!", JOptionPane.WARNING_MESSAGE);
391391
}
392+
393+
if (isSelected && !modData.getReadme().isEmpty()) {
394+
Object[] options = { "Check Readme", "I know!", "Cancel" };
395+
int result = JOptionPane.showOptionDialog(this, "If you are using this mod for the first time, please read the README.", "WARNING!", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
396+
if (result == 0) {
397+
try {
398+
Desktop.getDesktop().browse(new URI(modData.getReadme()));
399+
} catch (Exception e) {
400+
e.printStackTrace();
401+
}
402+
}
403+
if (result == 2) {
404+
checkBox.setSelected(false);
405+
}
406+
}
392407
});
393408

394409
int line = modData.getDescription().split("\n").length;
395-
JLabel description = new JLabel("<html><body>" + modData.getDescription().replace("\n", "<br>") + "</body></html>");
410+
JLabel description = new JLabel("<html><body>" + modData.getDescription().replaceAll("\n", "<br>").replaceAll("<a ", "<b ").replaceAll("</a>", "</b>") + "</body></html>");
396411
description.setMaximumSize(new Dimension(800, 60 * line));
397412
description.setBorder(new EmptyBorder(0, 15,0, 0));
398413
Font f = description.getFont();

src/main/java/com/pistacium/modcheck/mod/ModData.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ public class ModData {
1616
private final String warningMessage;
1717
private final List<String> incompatibleMods = new ArrayList<>();
1818
private final List<ModResource> resourceList = new ArrayList<>();
19+
private final String readme;
1920

2021
public ModData(JsonObject jsonObject) {
2122
this.name = jsonObject.get("name").getAsString();
2223
this.description = jsonObject.get("description").getAsString();
2324
this.warningMessage = jsonObject.has("warn") ? jsonObject.get("warn").getAsString() : "";
25+
this.readme = jsonObject.has("readme") ? jsonObject.get("readme").getAsString() : "";
2426
for (JsonElement jsonElement : jsonObject.getAsJsonArray("incompatible")) {
2527
this.incompatibleMods.add(jsonElement.getAsString());
2628
}
@@ -51,6 +53,10 @@ public String getWarningMessage() {
5153
return warningMessage;
5254
}
5355

56+
public String getReadme() {
57+
return readme;
58+
}
59+
5460
public List<String> getIncompatibleMods() {
5561
return incompatibleMods;
5662
}

0 commit comments

Comments
 (0)