Blacklisted ui-lib (startup crash)
This commit is contained in:
@@ -139,21 +139,22 @@ mods.reloadexit = The game will now exit, to reload mods.
|
|||||||
mod.installed = [[Installed]
|
mod.installed = [[Installed]
|
||||||
mod.display = [gray]Mod:[orange] {0}
|
mod.display = [gray]Mod:[orange] {0}
|
||||||
mod.enabled = [lightgray]Enabled
|
mod.enabled = [lightgray]Enabled
|
||||||
mod.disabled = [scarlet]Disabled
|
mod.disabled = [red]Disabled
|
||||||
mod.multiplayer.compatible = [gray]Multiplayer Compatible
|
mod.multiplayer.compatible = [gray]Multiplayer Compatible
|
||||||
mod.disable = Disable
|
mod.disable = Disable
|
||||||
mod.content = Content:
|
mod.content = Content:
|
||||||
mod.delete.error = Unable to delete mod. File may be in use.
|
mod.delete.error = Unable to delete mod. File may be in use.
|
||||||
mod.requiresversion = [scarlet]Requires min game version: [accent]{0}
|
mod.requiresversion = [red]Requires min game version: [accent]{0}
|
||||||
mod.outdatedv7 = [scarlet]Incompatible with V7 (no minGameVersion: 136)
|
mod.outdatedv7 = [red]Incompatible with V7 (no minGameVersion: 136)
|
||||||
mod.missingdependencies = [scarlet]Missing dependencies: {0}
|
mod.blacklisted = [red]Unsupported
|
||||||
mod.erroredcontent = [scarlet]Content Errors
|
mod.missingdependencies = [red]Missing dependencies: {0}
|
||||||
|
mod.erroredcontent = [red]Content Errors
|
||||||
mod.errors = Errors have occurred loading content.
|
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.noerrorplay = [red]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.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.enable = Enable
|
||||||
mod.requiresrestart = The game will now close to apply the mod changes.
|
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 = Import Mod
|
||||||
mod.import.file = Import File
|
mod.import.file = Import File
|
||||||
mod.import.github = Import From GitHub
|
mod.import.github = Import From GitHub
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
public class Mods implements Loadable{
|
public class Mods implements Loadable{
|
||||||
private static final String[] metaFiles = {"mod.json", "mod.hjson", "plugin.json", "plugin.hjson"};
|
private static final String[] metaFiles = {"mod.json", "mod.hjson", "plugin.json", "plugin.hjson"};
|
||||||
|
private static final ObjectSet<String> blacklistedMods = ObjectSet.with("ui-lib");
|
||||||
|
|
||||||
private Json json = new Json();
|
private Json json = new Json();
|
||||||
private @Nullable Scripts scripts;
|
private @Nullable Scripts scripts;
|
||||||
@@ -1053,11 +1054,16 @@ public class Mods implements Loadable{
|
|||||||
|
|
||||||
/** @return whether this mod is supported by the game version */
|
/** @return whether this mod is supported by the game version */
|
||||||
public boolean isSupported(){
|
public boolean isSupported(){
|
||||||
if(isOutdated()) return false;
|
if(isOutdated() || isBlacklisted()) return false;
|
||||||
|
|
||||||
return Version.isAtLeast(meta.minGameVersion);
|
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. */
|
/** @return whether this mod is outdated, e.g. not compatible with v7. */
|
||||||
public boolean isOutdated(){
|
public boolean isOutdated(){
|
||||||
//must be at least 136 to indicate v7 compat
|
//must be at least 136 to indicate v7 compat
|
||||||
|
|||||||
@@ -254,9 +254,14 @@ public class ModsDialog extends BaseDialog{
|
|||||||
|
|
||||||
text.row();
|
text.row();
|
||||||
|
|
||||||
|
String tooltip = null;
|
||||||
|
|
||||||
if(item.isOutdated()){
|
if(item.isOutdated()){
|
||||||
text.labelWrap("@mod.outdatedv7").growX();
|
text.labelWrap("@mod.outdatedv7").growX();
|
||||||
text.row();
|
text.row();
|
||||||
|
}else if(item.isBlacklisted()){
|
||||||
|
text.labelWrap("@mod.blacklisted").growX();
|
||||||
|
text.row();
|
||||||
}else if(!item.isSupported()){
|
}else if(!item.isSupported()){
|
||||||
text.labelWrap(Core.bundle.format("mod.requiresversion", item.meta.minGameVersion)).growX();
|
text.labelWrap(Core.bundle.format("mod.requiresversion", item.meta.minGameVersion)).growX();
|
||||||
text.row();
|
text.row();
|
||||||
|
|||||||
Reference in New Issue
Block a user