禁止整合包复制全局游戏设置 (#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);
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
JFXButton button = new JFXButton(i18n("settings.game.copy_global.copy_all"));
copyGlobalPane.setRight(button);
button.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> {
JFXButton copyAll = new JFXButton(i18n("settings.game.copy_global.copy_all"));
copyAll.disableProperty().bind(modpack);
copyGlobalPane.setRight(copyAll);
copyAll.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> {
Set<String> ignored = new HashSet<>(Arrays.asList(
"usesGlobal",
"versionIcon"
@ -205,8 +206,8 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
PropertyUtils.copyProperties(profile.getGlobal(), lastVersionSetting, name -> !ignored.contains(name));
}, null));
button.getStyleClass().add("jfx-button-border");
BorderPane.setAlignment(button, Pos.CENTER_RIGHT);
copyAll.getStyleClass().add("jfx-button-border");
BorderPane.setAlignment(copyAll, Pos.CENTER_RIGHT);
}
componentList.getContent().add(copyGlobalPane);