diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java index 055a55ec9b..816530f31f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AdditionalInstallersPage.java @@ -59,7 +59,7 @@ public AdditionalInstallersPage(HMCLGameInstance instance, String gameVersion, W }); } - installable.bind(Bindings.createBooleanBinding(() -> compatible.get() && txtName.validate(), txtName.textProperty(), compatible)); + installable.bind(Bindings.createBooleanBinding(() -> txtName.validate(), txtName.textProperty())); } @Override @@ -80,27 +80,14 @@ private String getVersion(GameComponentType type) { @Override protected void reload() { - boolean gameVersionChanged = !instance.getVersion().toString().equals(getVersion(GameComponentType.GAME)); - boolean compatible = true; - for (InstallerItem component : group.getComponents()) { GameComponentType componentType = component.getComponentType(); - String version = instance.getComponentVersion(component.getComponentType()); - String libraryVersion = Lang.requireNonNullElse(getVersion(componentType), version); - boolean alreadyInstalled = version != null && !(controller.getSettings().get(componentType.getPatchId()) instanceof UpdateInstallerWizardProvider.RemoveComponentAction); - if (component.getComponentType() != GameComponentType.GAME && gameVersionChanged && getVersion(componentType) == null && alreadyInstalled) { - // For third-party libraries, if game version is being changed, and the library is not being reinstalled, - // warns the user that we should update the library. - component.versionProperty().set(new InstallerItem.InstalledState(libraryVersion, false, true)); - compatible = false; - } else if (alreadyInstalled || getVersion(componentType) != null) { - component.versionProperty().set(new InstallerItem.InstalledState(libraryVersion, false, false)); + if (controller.getSettings().containsKey(componentType.getPatchId())) { + component.versionProperty().set(new InstallerItem.InstalledState(getVersion(componentType), false, false)); } else { component.versionProperty().set(null); } } - - this.compatible.set(compatible); } @Override