diff options
Diffstat (limited to 'loader/src/main/java')
2 files changed, 19 insertions, 0 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfo.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfo.java index 780a3548..63ccad23 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfo.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfo.java @@ -40,6 +40,12 @@ public abstract class WidgetInfo extends AnnotatedImportOnlyWidget { @Bind(variableName = "version") public final BindableAttribute<String> version = new BindableAttribute<>(String.class, ""); + @Bind(variableName = "loadVisibility") + public final BindableAttribute<String> loadVisibility = new BindableAttribute<>(String.class, "loadable"); + + @Bind(variableName = "reason") + public final BindableAttribute<String> reason = new BindableAttribute<>(String.class, ""); + public WidgetInfo() { super(new ResourceLocation("dungeons_guide_loader:gui/versions/versionInfo.gui")); makeItDefault.addOnUpdate((old, neu) ->{ @@ -53,6 +59,11 @@ public abstract class WidgetInfo extends AnnotatedImportOnlyWidget { public void setVersion(String version) {this.version.setValue(version);} public void setDefault(boolean bool) {this.makeItDefault.setValue(bool);} + public void setNotLoadable(String reason) { + this.reason.setValue(reason); + this.loadVisibility.setValue("notloadable"); + } + public abstract IDGLoader getLoader(); public void setConfiguration(Configuration configuration) {} diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfoRemote.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfoRemote.java index dc4e2331..64b92d09 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfoRemote.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/gui/screen/version/WidgetInfoRemote.java @@ -18,8 +18,10 @@ package kr.syeyoung.dungeonsguide.launcher.gui.screen.version; +import kr.syeyoung.dungeonsguide.launcher.LoaderMeta; import kr.syeyoung.dungeonsguide.launcher.branch.Update; import kr.syeyoung.dungeonsguide.launcher.branch.UpdateBranch; +import kr.syeyoung.dungeonsguide.launcher.exceptions.DungeonsGuideLoadingException; import kr.syeyoung.dungeonsguide.launcher.loader.IDGLoader; import kr.syeyoung.dungeonsguide.launcher.loader.RemoteLoader; import net.minecraftforge.common.config.Configuration; @@ -37,6 +39,12 @@ public class WidgetInfoRemote extends WidgetInfo { this.isLatest = isLatest; setVersion((isLatest ? "Latest :: " : "") + branch.getName()+"/"+update.getName()+ " ("+branch.getId()+"/"+update.getId()+")"); setDefault(isLatest); + + + int reqVersion = update.getMetadata().has("loaderVersion") ? update.getMetadata().getInt("loaderVersion") : 0; + if (reqVersion > LoaderMeta.LOADER_VERSION) { + setNotLoadable("This version of Dungeons Guide requires loader version: " + reqVersion +" But current loader version: "+ LoaderMeta.LOADER_VERSION); + } } @Override |