Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HMCL/src/main/java/org/jackhuang/hmcl/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private Metadata() {
public static final int RECOMMENDED_JAVA_VERSION = 21;

public static final String PUBLISH_URL = "https://hmcl.huangyuhui.net";
public static final String DOWNLOAD_URL = PUBLISH_URL + "/download";
public static final String REPOSITORY_URL = "https://github.com/HMCL-dev/HMCL";
public static final String HMCL_UPDATE_URL = System.getProperty("hmcl.update_source.override", PUBLISH_URL + "/api/update_link");
public static final String MANUAL_UPDATE_URL = "https://github.com/HMCL-dev/HMCL/releases";

Expand Down
8 changes: 8 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public enum SVG {
LOCAL_CAFE("M4 21V19H20V21H4ZM8 17Q6.35 17 5.175 15.825T4 13V3H20Q20.825 3 21.4125 3.5875T22 5V8Q22 8.825 21.4125 9.4125T20 10H18V13Q18 14.65 16.825 15.825T14 17H8ZM8 15H14Q14.825 15 15.4125 14.4125T16 13V5H6V13Q6 13.825 6.5875 14.4125T8 15ZM18 8H20V5H18V8ZM8 15H6 16 8Z"),
LOCAL_CAFE_FILL("M4 21V19H20v2H4Zm4-4q-1.65 0-2.825-1.175T4 13V3H20q.825 0 1.4125.5875T22 5V8q0 .825-.5875 1.4125T20 10H18v3q0 1.65-1.175 2.825T14 17H8ZM18 8h2V5H18V8Z"),
LOCATION_CITY("M3 21V7H9V5l3-3 3 3v6h6V21H3Zm2-2H7V17H5v2Zm0-4H7V13H5v2Zm0-4H7V9H5v2Zm6 8h2V17H11v2Zm0-4h2V13H11v2Zm0-4h2V9H11v2Zm0-4h2V5H11V7Zm6 12h2V17H17v2Zm0-4h2V13H17v2Z"),
MEMORY("M9 15V9h6v6H9Zm2-2h2v-2h-2v2Zm-2 8v-2H7q-.825 0-1.4125-.5875T5 17v-2H3v-2h2v-2H3V9h2V7q0-.825.5875-1.4125T7 5h2V3h2v2h2V3h2v2h2q.825 0 1.4125.5875T19 7v2h2v2h-2v2h2v2h-2v2q0 .825-.5875 1.4125T17 19h-2v2h-2v-2h-2v2H9Zm8-4V7H7v10h10Zm-5-5Z"),
MENU("M3 18V16H21V18H3ZM3 13V11H21V13H3ZM3 8V6H21V8H3Z"),
MICROSOFT("M4 20H22v2H4V13H20v7h2V4H20v7H4V4h7V20h2V4h9V2H2V22H4"), // Not Material
MINIMIZE_CENTER("M6 13v-2h12v2H6Z"), // Not Material
Expand Down Expand Up @@ -132,6 +133,13 @@ public enum SVG {
WARNING("M1 21 12 2 23 21H1ZM4.45 19H19.55L12 6 4.45 19ZM12 18Q12.425 18 12.7125 17.7125T13 17Q13 16.575 12.7125 16.2875T12 16Q11.575 16 11.2875 16.2875T11 17Q11 17.425 11.2875 17.7125T12 18ZM11 15H13V10H11V15ZM12 12.5Z"),
WB_SUNNY("M11 4V1H13V4H11ZM11 23V20H13V23H11ZM20 13V11H23V13H20ZM1 13V11H4V13H1ZM18.7 6.7 17.3 5.3 19.05 3.5 20.5 4.95 18.7 6.7ZM4.95 20.5 3.5 19.05 5.3 17.3 6.7 18.7 4.95 20.5ZM19.05 20.5 17.3 18.7 18.7 17.3 20.5 19.05 19.05 20.5ZM5.3 6.7 3.5 4.95 4.95 3.5 6.7 5.3 5.3 6.7ZM12 18Q9.5 18 7.75 16.25T6 12Q6 9.5 7.75 7.75T12 6Q14.5 6 16.25 7.75T18 12Q18 14.5 16.25 16.25T12 18ZM12 16Q13.675 16 14.8375 14.8375T16 12Q16 10.325 14.8375 9.1625T12 8Q10.325 8 9.1625 9.1625T8 12Q8 13.675 9.1625 14.8375T12 16ZM12 12Z"),
WB_SUNNY_FILL("M11 4V1h2V4H11Zm0 19V20h2v3H11Zm9-10V11h3v2H20ZM1 13V11H4v2H1ZM18.7 6.7 17.3 5.3l1.75-1.8L20.5 4.95 18.7 6.7ZM4.95 20.5 3.5 19.05 5.3 17.3l1.4 1.4-1.75 1.8Zm14.1 0-1.75-1.8 1.4-1.4 1.8 1.75-1.45 1.45ZM5.3 6.7 3.5 4.95 4.95 3.5 6.7 5.3 5.3 6.7ZM12 18q-2.5 0-4.25-1.75T6 12 7.75 7.75 12 6t4.25 1.75T18 12t-1.75 4.25T12 18Z"),

// https://lucide.dev/

LUCIDE_APP_WINDOW("M4 3C2.3553 3 1 4.3553 1 6V18c0 1.6447 1.3553 3 3 3H20c1.6447 0 3-1.3553 3-3V6c0-1.6447-1.3553-3-3-3H6 4zM4 5H5V7H3V6c0-.5713.4287-1 1-1zM7 5H9V7H7V5zm4 0h9c.5713 0 1 .4287 1 1V7H11V5zM3 9H6 21v9c0 .5713-.4287 1-1 1H4c-.5713 0-1-.4287-1-1V9z"),
LUCIDE_CPU("M7 1A1 1 0 006 2V3C4.3553 3 3 4.3553 3 6H2A1 1 0 001 7 1 1 0 002 8H3v3H2A1 1 0 001 12a1 1 0 001 1H3v3H2A1 1 0 001 17a1 1 0 001 1H3c0 1.6447 1.3553 3 3 3v1a1 1 0 001 1 1 1 0 001-1V21h3v1a1 1 0 001 1 1 1 0 001-1V21h3v1a1 1 0 001 1 1 1 0 001-1V21c1.6447 0 3-1.3553 3-3h1a1 1 0 001-1 1 1 0 00-1-1H21V13h1a1 1 0 001-1 1 1 0 00-1-1H21V8h1a1 1 0 001-1A1 1 0 0022 6H21c0-1.6447-1.3553-3-3-3V2A1 1 0 0017 1 1 1 0 0016 2V3H13V2A1 1 0 0012 1 1 1 0 0011 2V3H8V2A1 1 0 007 1zM6 5H18c.5713 0 1 .4287 1 1V18c0 .5713-.4287 1-1 1H6c-.5713 0-1-.4287-1-1V6c0-.5713.4287-1 1-1zM9 7C7.9093 7 7 7.9093 7 9v6c0 1.0907.9093 2 2 2h6c1.0907 0 2-.9093 2-2V9c0-1.0907-.9093-2-2-2H9zM9 9h6v6H9V9z"),
LUCIDE_GPU("M8 18v2h5V18H8Zm8-8c-.5641 0-1 .4359-1 1s.4359 1 1 1 1-.4359 1-1-.4359-1-1-1ZM8 10c-.5641 0-1 .4359-1 1s.4359 1 1 1c.5641 0 1-.4359 1-1s-.4359-1-1-1Zm8-2c1.645 0 3 1.355 3 3 0 1.645-1.355 3-3 3s-3-1.355-3-3c0-1.645 1.355-3 3-3ZM8 8c1.645 0 3 1.355 3 3 0 1.645-1.355 3-3 3s-3-1.355-3-3C5 9.355 6.355 8 8 8ZM3 6V16H20c.5641 0 1-.4359 1-1V7c0-.5641-.4359-1-1-1H3ZM2 2A1 1 0 013 3V4H20c1.645 0 3 1.355 3 3v8c0 1.645-1.355 3-3 3H15v2c0 1.0927-.9073 2-2 2H8c-1.0927 0-2-.9073-2-2V18H3v3A1 1 0 012 22 1 1 0 011 21V3A1 1 0 012 2Z"),
LUCIDE_MEMORY_STICK("M4 5C2.3553 5 1 6.3553 1 8v3 3c0 1.2949.84 2.4102 2 2.8262V18a1 1 0 001 1 1 1 0 001-1V17H7v1a1 1 0 001 1 1 1 0 001-1V17h2v1a1 1 0 001 1 1 1 0 001-1V17h2v1a1 1 0 001 1 1 1 0 001-1V17h2v1a1 1 0 001 1 1 1 0 001-1V16.8262c1.16-.416 2-1.5313 2-2.8262V11 8c0-1.6447-1.3553-3-3-3H4zM4 7H20c.5713 0 1 .4287 1 1v2h-.5a1 1 0 00-1 1 1 1 0 001 1H21v2c0 .5713-.4287 1-1 1H16 12 8 4c-.5713 0-1-.4287-1-1V12h.5a1 1 0 001-1 1 1 0 00-1-1H3V8c0-.5713.4287-1 1-1zM8 9A1 1 0 007 10v2a1 1 0 001 1 1 1 0 001-1V10A1 1 0 008 9zm4 0a1 1 0 00-1 1v2a1 1 0 001 1 1 1 0 001-1V10A1 1 0 0012 9zm4 0a1 1 0 00-1 1v2a1 1 0 001 1 1 1 0 001-1V10A1 1 0 0016 9z"),
;

public static final double DEFAULT_SIZE = 24;
Expand Down
100 changes: 84 additions & 16 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/main/AboutPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,25 @@
import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.ui.SVG;
import org.jackhuang.hmcl.ui.WeakListenerHolder;
import org.jackhuang.hmcl.ui.construct.ComponentList;
import org.jackhuang.hmcl.ui.construct.ImageContainer;
import org.jackhuang.hmcl.ui.construct.LineButton;
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
import org.jackhuang.hmcl.ui.construct.*;
import org.jackhuang.hmcl.util.DataSizeUnit;
import org.jackhuang.hmcl.util.gson.JsonUtils;
import org.jackhuang.hmcl.util.platform.Architecture;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
import org.jackhuang.hmcl.util.platform.SystemInfo;
import org.jackhuang.hmcl.util.platform.hardware.CentralProcessor;
import org.jackhuang.hmcl.util.platform.hardware.GraphicsCard;
import org.jetbrains.annotations.NotNullByDefault;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
import static org.jackhuang.hmcl.util.logging.Logger.LOG;

@NotNullByDefault
public final class AboutPage extends SpinnerPane {

private final WeakListenerHolder holder = new WeakListenerHolder();
Expand All @@ -52,22 +59,83 @@ public AboutPage() {

ComponentList about = new ComponentList();
{
var launcher = LineButton.createExternalLinkButton(Metadata.PUBLISH_URL);
var launcher = LineButton.createExternalLinkButton(Metadata.REPOSITORY_URL);
launcher.setLargeTitle(true);
launcher.setLeading(FXUtils.newBuiltinImage("/assets/img/icon.png"));
launcher.setTitle("Hello Minecraft! Launcher");
launcher.setSubtitle(Metadata.VERSION);

var author = LineButton.createExternalLinkButton("https://space.bilibili.com/1445341");
author.setLargeTitle(true);
author.setLeading(FXUtils.newBuiltinImage("/assets/img/yellow_fish.png"));
author.setTitle("huanghongxun");
author.setSubtitle(i18n("about.author.statement"));

about.getContent().setAll(launcher, author);
about.getContent().setAll(launcher);
}

ComponentList thanks = loadIconedTwoLineList("/assets/about/thanks.json");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件是不是可以删了?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么把感谢名单移除了?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么把感谢名单移除了?

我猜是考虑到页面内容过多。

但这个 thanks to list 真的打算移除了?🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是避避风头吧

ComponentList environment = new ComponentList();
{
var system = new LinePane();
system.setLargeTitle(true);
system.setLeading(SVG.LUCIDE_APP_WINDOW.createIcon(32));
system.setTitle(i18n("about.environment.system"));
system.setSubtitle((OperatingSystem.OS_RELEASE_PRETTY_NAME == null
? "%s %s (%s)".formatted(OperatingSystem.SYSTEM_NAME, OperatingSystem.SYSTEM_VERSION.getVersion(), Architecture.SYSTEM_ARCH.getDisplayName())
: "%s (%s %s, %s)".formatted(OperatingSystem.OS_RELEASE_PRETTY_NAME, OperatingSystem.SYSTEM_NAME, OperatingSystem.SYSTEM_VERSION.getVersion(), Architecture.SYSTEM_ARCH.getDisplayName())));
environment.getContent().add(system);

if (SystemInfo.getTotalMemorySize() > 0) {
var memory = new LinePane();
memory.setLargeTitle(true);
memory.setLeading(SVG.LUCIDE_MEMORY_STICK.createIcon(32));
memory.setTitle(i18n("about.environment.memory"));
memory.setSubtitle("%.1f GiB".formatted(DataSizeUnit.GIGABYTES.convertFromBytes(SystemInfo.getTotalMemorySize())));
environment.getContent().add(memory);
}

@Nullable CentralProcessor cpu = SystemInfo.getCentralProcessor();
if (cpu != null) {
String title = i18n("about.environment.cpu");
var button = new LinePane();
button.setLargeTitle(true);
button.setTitle(title);
button.setSubtitle(cpu.toString());
button.setLeading(SVG.LUCIDE_CPU.createIcon(32));

environment.getContent().add(button);
}

@Nullable List<GraphicsCard> graphicsCards = SystemInfo.getGraphicsCards();
if (graphicsCards != null) {
int index = 1;
for (GraphicsCard graphicsCard : graphicsCards) {
String name = index == 1 && graphicsCards.size() == 1
? i18n("about.environment.gpu")
: i18n("about.environment.gpu.n", index);
index++;
var button = new LinePane();
button.setLargeTitle(true);
button.setTitle(name);
button.setSubtitle(graphicsCard.getName());

button.setLeading(SVG.LUCIDE_GPU.createIcon(32));

environment.getContent().add(button);
}
}

var java = new LinePane();
java.setLargeTitle(true);
java.setLeading(SVG.LOCAL_CAFE.createIcon(32));
java.setTitle("Java");
java.setSubtitle("%s, %s by %s".formatted(
Runtime.version().toString(),
System.getProperty("java.vm.name"),
System.getProperty("java.vendor")));
environment.getContent().add(java);

var javaFX = new LinePane();
javaFX.setLargeTitle(true);
javaFX.setLeading(SVG.LOCAL_CAFE.createIcon(32));
javaFX.setTitle("JavaFX");
javaFX.setSubtitle(System.getProperty("javafx.runtime.version"));
environment.getContent().add(javaFX);
}

ComponentList deps = loadIconedTwoLineList("/assets/about/deps.json");

Expand All @@ -94,8 +162,8 @@ public AboutPage() {
content.getChildren().setAll(
ComponentList.createComponentListTitle(i18n("about")),
about,
ComponentList.createComponentListTitle(i18n("about.thanks_to")),
thanks,
ComponentList.createComponentListTitle(i18n("about.environment")),
environment,
ComponentList.createComponentListTitle(i18n("about.dependency")),
deps,
ComponentList.createComponentListTitle(i18n("about.legal")),
Expand Down Expand Up @@ -141,7 +209,6 @@ private ComponentList loadIconedTwoLineList(String path) {
imageView.setImage(loadImage(image.getAsString()));
imageView.setMouseTransparent(true);


button.setLeading(imageView);
} else if (image.isJsonObject()) {
holder.add(FXUtils.onWeakChangeAndOperate(Themes.darkModeProperty(), darkMode -> button.setLeading(darkMode
Expand Down Expand Up @@ -169,4 +236,5 @@ else if (obj.get("subtitleLocalized") instanceof JsonPrimitive subtitleLocalized

return componentList;
}

}
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ about.copyright.statement=Copyright © 2013-2026 huangyuhui and contributors.
about.author.statement=bilibili @huanghongxun
about.claim=EULA
about.claim.statement=Click this link for full text.
about.environment=Environment
about.environment.cpu=CPU
about.environment.gpu=GPU
about.environment.gpu.n=GPU %d
about.environment.memory=Memory
about.environment.system=Operating System
about.dependency=Third-party Libraries
about.legal=Legal Acknowledgement
about.thanks_to=Thanks to
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ about.copyright.statement=حقوق النشر © 2013-2026 huangyuhui والمس
about.author.statement=bilibili @huanghongxun
about.claim=اتفاقية الترخيص
about.claim.statement=انقر على هذا الرابط للاطلاع على النص الكامل.
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=مكتبات الطرف الثالث
about.legal=الإقرارات القانونية
about.thanks_to=شكر وتقدير
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright.statement=Copyright © 2013-2026 huangyuhui und Mitwirkende.
about.author.statement=bilibili @huanghongxun
about.claim=EULA
about.claim.statement=Klicken Sie auf diesen Link für den vollständigen Text.
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=Drittanbieter-Bibliotheken
about.legal=Rechtliche Hinweise
about.thanks_to=Danksagung an
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ about.copyright=Copyright
about.author.statement=bilibili @huanghongxun
about.claim=EULA
about.claim.statement=Haga clic en este enlace para ver el texto completo.
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=Bibliotecas de terceros
about.legal=Reconocimiento legal
about.thanks_to=Gracias a
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright=著作権
about.author.statement=bilibili @huanghongxun
about.claim=EULA
about.claim.statement=全文はこのリンクをクリック
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=依存関係
about.legal=法的承認
about.thanks_to=感謝します…
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_lzh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright=持權
about.author.statement=嗶站 @huanghongxun
about.claim=客契
about.claim.statement=擊鏈以詳閱
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=所依
about.legal=告以律
about.thanks_to=致謝
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright.statement=Copyright © 2013-2026 huangyuhui и контрибь
about.author.statement=bilibili @huanghongxun
about.claim=EULA
about.claim.statement=Кликните на ссылку, чтобы увидеть весь текст.
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=Сторонние библиотеки
about.legal=Правовая информация
about.thanks_to=Отдельная благодарность
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_uk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ about.copyright.statement=Copyright © 2013-2026 huangyuhui та контриб'
about.author.statement=bilibili @huanghongxun
about.claim=Ліцензійна угода з кінцевим користувачем (EULA)
about.claim.statement=Натисніть це посилання для перегляду повного тексту.
# about.environment=
# about.environment.cpu=
# about.environment.gpu=
# about.environment.gpu.n=
# about.environment.memory=
# about.environment.system=
about.dependency=Сторонні бібліотеки
about.legal=Правове визнання
about.thanks_to=Подяки
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_Hans.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright.statement=版权所有 © 2013-2026 huangyuhui 及贡献者
about.author.statement=bilibili @huanghongxun
about.claim=用户协议
about.claim.statement=点击链接以查看全文
about.environment=环境
about.environment.cpu=处理器
about.environment.gpu=显卡
about.environment.gpu.n=显卡 %d
about.environment.memory=内存
about.environment.system=操作系统
about.dependency=依赖
about.legal=法律声明
about.thanks_to=鸣谢
Expand Down
6 changes: 6 additions & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_Hant.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ about.copyright.statement=著作權所有 © 2013-2026 huangyuhui 與貢獻者
about.author.statement=bilibili @huanghongxun
about.claim=使用者協議
about.claim.statement=點擊連結以查看全文
about.environment=環境
about.environment.cpu=處理器
about.environment.gpu=顯示卡
about.environment.gpu.n=顯示卡 %d
about.environment.memory=記憶體
about.environment.system=作業系統
about.dependency=相依元件
about.legal=法律宣告
about.thanks_to=鳴謝
Expand Down
Loading