From 07f8294876f2a63d13635cb961bc1b871f9723c3 Mon Sep 17 00:00:00 2001 From: huangyuhui Date: Wed, 11 Jul 2018 12:44:47 +0800 Subject: [PATCH] Fixed mis-unbound data. GH-377 --- .../org/jackhuang/hmcl/ui/VersionSettingsController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/VersionSettingsController.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/VersionSettingsController.java index 5b0faa6e7..f6fbe7273 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/VersionSettingsController.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/VersionSettingsController.java @@ -116,6 +116,7 @@ public final class VersionSettingsController { gameDirItem.setDisable(profile.getRepository().isModpack(versionId)); globalItem.setDisable(profile.getRepository().isModpack(versionId)); + // unbind data fields if (lastVersionSetting != null) { FXUtils.unbindInt(txtWidth, lastVersionSetting.widthProperty()); FXUtils.unbindInt(txtHeight, lastVersionSetting.heightProperty()); @@ -135,6 +136,12 @@ public final class VersionSettingsController { FXUtils.unbindEnum(cboLauncherVisibility); } + // unbind data fields + globalItem.setToggleSelectedListener(null); + javaItem.setToggleSelectedListener(null); + gameDirItem.setToggleSelectedListener(null); + + // bind new data fields FXUtils.bindInt(txtWidth, versionSetting.widthProperty()); FXUtils.bindInt(txtHeight, versionSetting.heightProperty()); FXUtils.bindInt(txtMaxMemory, versionSetting.maxMemoryProperty());