Compare commits

...
6 changed files with 68 additions and 12 deletions

No files matched your search

@@ -88,6 +88,14 @@ public class JFXTextField extends TextField {
useJFXContextMenu(this);
}
// https://github.com/HMCL-dev/HMCL/issues/5822
// TODO: This method may no longer be needed after we update JFXTextFieldSkin
@Override
protected void layoutChildren() {
super.layoutChildren();
this.setNeedsLayout(false);
}
/***************************************************************************
* *
* Properties *
@@ -975,7 +975,10 @@ repositories.chooser=闕 JavaFX。HMCL 須之以行。\n擊「善」而引 JavaF
repositories.chooser.title=擇 JavaFX 之源
resourcepack=資囊
resourcepack.add=增資囊
resourcepack.download=引資囊
resourcepack.download.title=引資囊 - %1s
resourcepack.manage=司資囊
reveal.in_file_manager=覽於理案臺
@@ -1193,6 +1196,8 @@ sponsor.hmcl=Hello Minecraft! Launcher,乃一免費,自由,開源之礦藝
system.architecture=大構
system.operating_system=械網
terracotta=眾戲
unofficial.hint=子方用非官築之 HMCL。余無能證其安,請君自辨。
update=啟者迭更
@@ -1210,6 +1215,8 @@ update.channel.nightly.hint=君所用之 HMCL 乃預版也。預版之更迭常
update.channel.nightly.title=預版告
update.channel.stable=定版
update.checking=甫察其新
update.disable_auto_show_update_dialog=弗自顯迭更窗
update.disable_auto_show_update_dialog.subtitle=啟此,HMCL 將弗自顯迭更窗。
update.failed=迭更未成
update.found=尋得新者
update.newest_version=至新:%s
@@ -1219,6 +1226,8 @@ update.note=开發版與預版,虽增功、修阙,然亦恐生他患。
update.latest=當版至新
update.no_browser=無啟瀏覽器。址固鈔訖,君可自粘之以啟頁。
update.tooltip=迭更
update.preview=先覽 HMCL 之版
update.preview.subtitle=啟此,君可先得 HMCL 之新,試之於未行。
version=戲
version.name=戲例之名
@@ -37,7 +37,7 @@ public record GameJavaVersion(String component, int majorVersion) {
public static final GameJavaVersion JAVA_16 = new GameJavaVersion("java-runtime-alpha", 16);
public static final GameJavaVersion JAVA_8 = new GameJavaVersion("jre-legacy", 8);
public static final GameJavaVersion LATEST = JAVA_21;
public static final GameJavaVersion LATEST = JAVA_25;
public static GameJavaVersion getMinimumJavaVersion(GameVersionNumber gameVersion) {
if (gameVersion.compareTo("26.1") >= 0)
@@ -268,18 +268,26 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
}
public static final class Release extends GameVersionNumber {
private static final int MINIMUM_YEAR_MAJOR_VERSION = 25;
private static final int MINIMUM_YEAR_MAJOR_VERSION = 26;
public enum ReleaseType {
UNKNOWN(""),
SNAPSHOT("-snapshot-"),
PRE_RELEASE("-pre"),
RELEASE_CANDIDATE("-rc"),
PRE_RELEASE("-pre", "-pre-"),
RELEASE_CANDIDATE("-rc", "-rc-"),
GA("");
private final String infix;
private final String legacyInfix;
private final String newInfix;
ReleaseType(String infix) {
this.infix = infix;
this.legacyInfix = infix;
this.newInfix = infix;
}
ReleaseType(String legacyInfix, String newInfix) {
this.legacyInfix = legacyInfix;
this.newInfix = newInfix;
}
}
@@ -317,6 +325,8 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
String suffix = matcher.group("suffix");
boolean isLegacyRelease = major == 1;
ReleaseType releaseType;
VersionNumber eaVersion;
Additional additional = Additional.NONE;
@@ -342,10 +352,15 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
releaseType = ReleaseType.SNAPSHOT;
eaVersion = VersionNumber.asVersion(suffix.substring(" Snapshot ".length()));
} else if (suffix.startsWith("-pre-")) {
needNormalize = true;
if (isLegacyRelease) {
needNormalize = true;
}
releaseType = ReleaseType.PRE_RELEASE;
eaVersion = VersionNumber.asVersion(suffix.substring("-pre-".length()));
} else if (suffix.startsWith("-pre")) {
if (!isLegacyRelease) {
needNormalize = true;
}
releaseType = ReleaseType.PRE_RELEASE;
eaVersion = VersionNumber.asVersion(suffix.substring("-pre".length()));
} else if (suffix.startsWith(" Pre-Release ")) {
@@ -358,10 +373,15 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
releaseType = ReleaseType.PRE_RELEASE;
eaVersion = VersionNumber.asVersion(suffix.substring(" Pre-release ".length()));
} else if (suffix.startsWith("-rc-")) {
needNormalize = true;
if (isLegacyRelease) {
needNormalize = true;
}
releaseType = ReleaseType.RELEASE_CANDIDATE;
eaVersion = VersionNumber.asVersion(suffix.substring("-rc-".length()));
} else if (suffix.startsWith("-rc")) {
if (!isLegacyRelease) {
needNormalize = true;
}
releaseType = ReleaseType.RELEASE_CANDIDATE;
eaVersion = VersionNumber.asVersion(suffix.substring("-rc".length()));
} else if (suffix.startsWith(" Release Candidate ")) {
@@ -377,7 +397,7 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
StringBuilder builder = new StringBuilder(value.length());
builder.append(matcher.group("prefix"));
if (releaseType != ReleaseType.GA) {
builder.append(releaseType.infix);
builder.append(isLegacyRelease ? releaseType.legacyInfix : releaseType.newInfix);
builder.append(eaVersion);
}
builder.append(additional.suffix);
@@ -895,3 +895,20 @@
1.21.11-rc3_unobfuscated
1.21.11
1.21.11_unobfuscated
26.1-snapshot-1
26.1-snapshot-2
26.1-snapshot-3
26.1-snapshot-4
26.1-snapshot-5
26.1-snapshot-6
26.1-snapshot-7
26.1-snapshot-8
26.1-snapshot-9
26.1-snapshot-10
26.1-snapshot-11
26.1-pre-1
26.1-pre-2
26.1-pre-3
26.1-rc-1
26.1-rc-2
26.1
@@ -432,14 +432,13 @@ public final class GameVersionNumberTest {
assertNormalized(version, version);
}
assertNormalized("26.1-snapshot-1", "26.1 Snapshot 1");
assertNormalized("1.21.11-pre3", "1.21.11-pre-3");
assertNormalized("1.21.11-pre3", "1.21.11 Pre-Release 3");
assertNormalized("1.21.11-pre3_unobfuscated", "1.21.11 Pre-Release 3 Unobfuscated");
assertNormalized("1.21.11-pre3_unobfuscated", "1.21.11-pre3 Unobfuscated");
assertNormalized("26.1-pre1", "26.1-pre-1");
assertNormalized("1.21.11-rc1", "1.21.11-rc-1");
assertNormalized("1.21.11-rc1", "1.21.11 Release Candidate 1");
assertNormalized("1.21.11-rc1_unobfuscated", "1.21.11 Release Candidate 1 Unobfuscated");
assertNormalized("26.1-rc1", "26.1-rc-1");
assertNormalized("1.14_combat-212796", "1.14.3 - Combat Test");
assertNormalized("1.14_combat-0", "Combat Test 2");
assertNormalized("1.14_combat-3", "Combat Test 3");
@@ -463,6 +462,9 @@ public final class GameVersionNumberTest {
assertNormalized("1.19_deep_dark_experimental_snapshot-1", "Deep Dark Experimental Snapshot 1");
assertNormalized("20w14infinite", "20w14~");
assertNormalized("22w13oneBlockAtATime", "22w13oneblockatatime");
assertNormalized("26.1-snapshot-1", "26.1 Snapshot 1");
assertNormalized("26.1-rc-1", "26.1-rc1");
assertNormalized("26.1-pre-1", "26.1-pre1");
}
@Test