From ce51dc4dd73dba56192dd02dfe01ae7b30e7da9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Tue, 8 Sep 2026 21:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E4=BF=AE=E6=94=B9=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=97=B6=E6=B8=85=E9=99=A4=E5=B7=B2=E9=80=89?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E7=BB=84=E5=8A=A0=E8=BD=BD=E5=99=A8=20(#6475?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/download/AdditionalInstallersPage.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) 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 @@ class AdditionalInstallersPage extends AbstractInstallersPage { }); } - installable.bind(Bindings.createBooleanBinding(() -> compatible.get() && txtName.validate(), txtName.textProperty(), compatible)); + installable.bind(Bindings.createBooleanBinding(() -> txtName.validate(), txtName.textProperty())); } @Override @@ -80,27 +80,14 @@ class AdditionalInstallersPage extends AbstractInstallersPage { @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