From c723acfe304eb9aa679deb3206a913d2d209c4cd Mon Sep 17 00:00:00 2001 From: mineDiamond Date: Wed, 7 Jan 2026 22:32:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E5=AE=9E=E4=BE=8B=E6=97=B6=E4=BD=BF=E7=94=A8=E5=8E=9F?= =?UTF-8?q?=E5=90=8D=20(#5137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/jackhuang/hmcl/ui/versions/Versions.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/Versions.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/Versions.java index e52b444d1..83bbb7205 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/Versions.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/Versions.java @@ -130,6 +130,10 @@ public final class Versions { public static CompletableFuture renameVersion(Profile profile, String version) { return Controllers.prompt(i18n("version.manage.rename.message"), (newName, resolve, reject) -> { + if (newName.equals(version)) { + resolve.run(); + return; + } if (profile.getRepository().renameVersion(version, newName)) { resolve.run(); profile.getRepository().refreshVersionsAsync() @@ -142,7 +146,7 @@ public final class Versions { reject.accept(i18n("version.manage.rename.fail")); } }, version, new Validator(i18n("install.new_game.malformed"), HMCLGameRepository::isValidVersionId), - new Validator(i18n("install.new_game.already_exists"), newVersionName -> !profile.getRepository().versionIdConflicts(newVersionName))); + new Validator(i18n("install.new_game.already_exists"), newVersionName -> !profile.getRepository().versionIdConflicts(newVersionName) || newVersionName.equals(version))); } public static void exportVersion(Profile profile, String version) {