diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 496a329c7a..833c4707f7 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -139,21 +139,22 @@ mods.reloadexit = The game will now exit, to reload mods. mod.installed = [[Installed] mod.display = [gray]Mod:[orange] {0} mod.enabled = [lightgray]Enabled -mod.disabled = [scarlet]Disabled +mod.disabled = [red]Disabled mod.multiplayer.compatible = [gray]Multiplayer Compatible mod.disable = Disable mod.content = Content: mod.delete.error = Unable to delete mod. File may be in use. -mod.requiresversion = [scarlet]Requires min game version: [accent]{0} -mod.outdatedv7 = [scarlet]Incompatible with V7 (no minGameVersion: 136) -mod.missingdependencies = [scarlet]Missing dependencies: {0} -mod.erroredcontent = [scarlet]Content Errors +mod.requiresversion = [red]Requires min game version: [accent]{0} +mod.outdatedv7 = [red]Incompatible with V7 (no minGameVersion: 136) +mod.blacklisted = [red]Unsupported +mod.missingdependencies = [red]Missing dependencies: {0} +mod.erroredcontent = [red]Content Errors mod.errors = Errors have occurred loading content. -mod.noerrorplay = [scarlet]You have mods with errors.[] Either disable the affected mods or fix the errors before playing. -mod.nowdisabled = [scarlet]Mod '{0}' is missing dependencies:[accent] {1}\n[lightgray]These mods need to be downloaded first.\nThis mod will be automatically disabled. +mod.noerrorplay = [red]You have mods with errors.[] Either disable the affected mods or fix the errors before playing. +mod.nowdisabled = [red]Mod '{0}' is missing dependencies:[accent] {1}\n[lightgray]These mods need to be downloaded first.\nThis mod will be automatically disabled. mod.enable = Enable mod.requiresrestart = The game will now close to apply the mod changes. -mod.reloadrequired = [scarlet]Restart Required +mod.reloadrequired = [red]Restart Required mod.import = Import Mod mod.import.file = Import File mod.import.github = Import From GitHub diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index e59a2c5416..ab53f1b068 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -32,6 +32,7 @@ import static mindustry.Vars.*; public class Mods implements Loadable{ private static final String[] metaFiles = {"mod.json", "mod.hjson", "plugin.json", "plugin.hjson"}; + private static final ObjectSet blacklistedMods = ObjectSet.with("ui-lib"); private Json json = new Json(); private @Nullable Scripts scripts; @@ -1053,11 +1054,16 @@ public class Mods implements Loadable{ /** @return whether this mod is supported by the game version */ public boolean isSupported(){ - if(isOutdated()) return false; + if(isOutdated() || isBlacklisted()) return false; return Version.isAtLeast(meta.minGameVersion); } + /** Some mods are known to cause issues with the game; this detects and returns whether a mod is manually blacklisted. */ + public boolean isBlacklisted(){ + return blacklistedMods.contains(name); + } + /** @return whether this mod is outdated, e.g. not compatible with v7. */ public boolean isOutdated(){ //must be at least 136 to indicate v7 compat diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index 322ae96177..d504281dca 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -254,9 +254,14 @@ public class ModsDialog extends BaseDialog{ text.row(); + String tooltip = null; + if(item.isOutdated()){ text.labelWrap("@mod.outdatedv7").growX(); text.row(); + }else if(item.isBlacklisted()){ + text.labelWrap("@mod.blacklisted").growX(); + text.row(); }else if(!item.isSupported()){ text.labelWrap(Core.bundle.format("mod.requiresversion", item.meta.minGameVersion)).growX(); text.row();