禁止整合包复制全局游戏设置 (#3639)

* 禁止整合包复制全局游戏设置

* update
This commit is contained in:
Glavo 2025-02-22 14:35:54 +08:00 committed by GitHub
parent 82dbe18d78
commit e7e8d45497
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,9 +195,10 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
copyGlobalPane.setLeft(label); copyGlobalPane.setLeft(label);
BorderPane.setAlignment(label, Pos.CENTER_LEFT); BorderPane.setAlignment(label, Pos.CENTER_LEFT);
JFXButton button = new JFXButton(i18n("settings.game.copy_global.copy_all")); JFXButton copyAll = new JFXButton(i18n("settings.game.copy_global.copy_all"));
copyGlobalPane.setRight(button); copyAll.disableProperty().bind(modpack);
button.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> { copyGlobalPane.setRight(copyAll);
copyAll.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> {
Set<String> ignored = new HashSet<>(Arrays.asList( Set<String> ignored = new HashSet<>(Arrays.asList(
"usesGlobal", "usesGlobal",
"versionIcon" "versionIcon"
@ -205,8 +206,8 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
PropertyUtils.copyProperties(profile.getGlobal(), lastVersionSetting, name -> !ignored.contains(name)); PropertyUtils.copyProperties(profile.getGlobal(), lastVersionSetting, name -> !ignored.contains(name));
}, null)); }, null));
button.getStyleClass().add("jfx-button-border"); copyAll.getStyleClass().add("jfx-button-border");
BorderPane.setAlignment(button, Pos.CENTER_RIGHT); BorderPane.setAlignment(copyAll, Pos.CENTER_RIGHT);
} }
componentList.getContent().add(copyGlobalPane); componentList.getContent().add(copyGlobalPane);