diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java index 50e0944d4..e4b5ca2d2 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java @@ -83,7 +83,6 @@ import java.util.Locale; import java.util.concurrent.ThreadLocalRandom; import static org.jackhuang.hmcl.setting.ConfigHolder.config; -import static org.jackhuang.hmcl.setting.ConfigHolder.globalConfig; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class TerracottaControllerPage extends StackPane { @@ -182,31 +181,20 @@ public class TerracottaControllerPage extends StackPane { download.setSubtitle(i18n("terracotta.status.uninitialized.desc")); download.setRightIcon(SVG.ARROW_FORWARD); FXUtils.onClicked(download, () -> { - if (globalConfig().getTerracottaAgreementVersion() >= 1) { - TerracottaState.Preparing s = TerracottaManager.install(null); - if (s != null) { - UI_STATE.set(s); - } + TerracottaState.Preparing s = TerracottaManager.install(null); + if (s != null) { + UI_STATE.set(s); + } - if (uninitialized.hasLegacy() && I18n.isUseChinese()) { - Object feedback = config().getShownTips().get(FEEDBACK_TIP); - if (!(feedback instanceof Number number) || number.intValue() < 1) { - Controllers.confirm(i18n("terracotta.feedback.desc"), i18n("terracotta.feedback.title"), () -> { - FXUtils.openLink(TerracottaMetadata.FEEDBACK_LINK); - config().getShownTips().put(FEEDBACK_TIP, 1); - }, () -> { - }); - } + if (uninitialized.hasLegacy() && I18n.isUseChinese()) { + Object feedback = config().getShownTips().get(FEEDBACK_TIP); + if (!(feedback instanceof Number number) || number.intValue() < 1) { + Controllers.confirm(i18n("terracotta.feedback.desc"), i18n("terracotta.feedback.title"), () -> { + FXUtils.openLink(TerracottaMetadata.FEEDBACK_LINK); + config().getShownTips().put(FEEDBACK_TIP, 1); + }, () -> { + }); } - } else { - Controllers.confirmWithCountdown(i18n("terracotta.confirm.desc"), i18n("terracotta.confirm.title"), 5, MessageDialogPane.MessageType.INFO, () -> { - globalConfig().setTerracottaAgreementVersion(1); - TerracottaState.Preparing s = TerracottaManager.install(null); - if (s != null) { - UI_STATE.set(s); - } - }, () -> { - }); } }); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java index 478e2733d..48f130954 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java @@ -32,9 +32,7 @@ import org.jackhuang.hmcl.ui.Controllers; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.SVG; import org.jackhuang.hmcl.ui.animation.TransitionPane; -import org.jackhuang.hmcl.ui.construct.AdvancedListBox; -import org.jackhuang.hmcl.ui.construct.PageAware; -import org.jackhuang.hmcl.ui.construct.TabHeader; +import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.decorator.DecoratorAnimatedPage; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; import org.jackhuang.hmcl.ui.main.MainPage; @@ -42,9 +40,12 @@ import org.jackhuang.hmcl.ui.versions.Versions; import org.jackhuang.hmcl.util.Lang; import org.jackhuang.hmcl.util.StringUtils; +import static org.jackhuang.hmcl.setting.ConfigHolder.globalConfig; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class TerracottaPage extends DecoratorAnimatedPage implements DecoratorPage, PageAware { + private static final int TERRACOTTA_AGREEMENT_VERSION = 2; + private final ReadOnlyObjectWrapper state = new ReadOnlyObjectWrapper<>(State.fromTitle(i18n("terracotta.terracotta"))); private final TabHeader tab; private final TabHeader.Tab statusPage = new TabHeader.Tab<>("statusPage"); @@ -94,6 +95,12 @@ public class TerracottaPage extends DecoratorAnimatedPage implements DecoratorPa @Override public void onPageShown() { tab.onPageShown(); + + if (globalConfig().getTerracottaAgreementVersion() < TERRACOTTA_AGREEMENT_VERSION) { + Controllers.confirmWithCountdown(i18n("terracotta.confirm.desc"), i18n("terracotta.confirm.title"), 5, MessageDialogPane.MessageType.INFO, () -> { + globalConfig().setTerracottaAgreementVersion(TERRACOTTA_AGREEMENT_VERSION); + }, () -> fireEvent(new PageCloseEvent())); + } } @Override diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 47d715056..32f4abca5 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1441,8 +1441,8 @@ terracotta.status.uninitialized.update.title=Update Multiplayer Core (~ 8MiB) terracotta.status.uninitialized.desc=You legally promise to strictly abide by all laws and regulations of your country or region during the multiplayer process. terracotta.confirm.title=User Notice terracotta.confirm.desc=Terracotta is a third-party open source free software. Please provide feedback on any issues you encounter through the relevant channels during use.\n\ - Terracotta is based on P2P, so that the final experience depends greatly on your network condition.\n\ - You promise to strictly abide by all laws and regulations in your country or region when playing online. + Terracotta uses P2P technology. After a successful connection, users in the room will connect directly to each other, and no third-party server will relay your traffic. The final multiplayer experience largely depends on the network conditions of the participants.\n\ + During the entire multiplayer process, you must strictly comply with all laws and regulations of your country and region. terracotta.status.preparing=Multiplayer Core: Downloading (DO NOT exit HMCL) terracotta.status.launching=Multiplayer Core: Initializing terracotta.status.unknown=Multiplayer Core: Initializing diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 7763af92b..71882ac12 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -1229,8 +1229,8 @@ terracotta.status.uninitialized.update.title=更新聯機核心 (約 8MiB) terracotta.status.uninitialized.desc=您承諾,在多人聯機全過程中,您將嚴格遵守您所在國家或地區的全部法律法規 terracotta.confirm.title=使用者須知 terracotta.confirm.desc=陶瓦聯機是第三方開源自由軟體,您在使用過程中所遇到的問題請通過相關管道進行回饋。\n\ - 多人連線基於 p2p,最終線上體驗和您的網路情況有較大關係。\n\ - 您承諾,在多人連線全過程中,您將嚴格遵守您所在國家或地區的全部法律法規。 + 陶瓦聯機使用 P2P 技術,聯機成功後房間內用戶之間將直接連接,不會使用第三方伺服器對您的流量進行轉發。最終聯機體驗和參與聯機者的網路情況有較大關係。\n\ + 在多人聯機全過程中,您必須嚴格遵守您所在國家與地區的全部法律法規。 terracotta.status.preparing=正在下載聯機核心 (請勿退出啟動器) terracotta.status.launching=正在初始化聯機核心 terracotta.status.unknown=正在初始化聯機核心 diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index 5f3afab0b..d4a5e9c68 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1239,8 +1239,8 @@ terracotta.status.uninitialized.update.title=更新联机核心 (约 8MiB) terracotta.status.uninitialized.desc=您承诺,在多人联机全过程中,您将严格遵守您所在国家或地区的全部法律法规 terracotta.confirm.title=用户须知 terracotta.confirm.desc=陶瓦联机是第三方开源自由软件,您在使用过程中所遇到的问题请通过相关渠道进行反馈。\n\ - 多人联机基于 p2p,最终联机体验和您的网络情况有较大关系。\n\ - 在多人联机全过程中,您将严格遵守您所在国家或地区的全部法律法规。 + 陶瓦联机使用 P2P 技术,联机成功后房间内用户之间将直接连接,不会使用第三方服务器对您的流量进行转发。最终联机体验和参与联机者的网络情况有较大关系。\n\ + 在多人联机全过程中,您必须严格遵守您所在国家与地区的全部法律法规。 terracotta.status.preparing=正在下载联机核心 (请勿退出启动器) terracotta.status.launching=正在初始化联机核心 terracotta.status.unknown=正在初始化联机核心