diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Config.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Config.java index 46004c63ed..ba026fe04d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Config.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Config.java @@ -265,6 +265,21 @@ public void setAcceptPreviewUpdate(boolean acceptPreviewUpdate) { this.acceptPreviewUpdate.set(acceptPreviewUpdate); } + @SerializedName("disableStartupUpdateDialog") + private final BooleanProperty disableStartupUpdateDialog = new SimpleBooleanProperty(false); + + public BooleanProperty disableStartupUpdateDialogProperty() { + return disableStartupUpdateDialog; + } + + public boolean isDisableStartupUpdateDialog() { + return disableStartupUpdateDialog.get(); + } + + public void setDisableStartupUpdateDialog(boolean disableStartupUpdateDialog) { + this.disableStartupUpdateDialog.set(disableStartupUpdateDialog); + } + @SerializedName("shownTips") private final ObservableMap shownTips = FXCollections.observableHashMap(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index 67f33d9043..6ea1ab1d96 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -316,7 +316,7 @@ public void accept(String currentGame) { private void showUpdate(boolean show) { doAnimation(show); - if (show && getLatestVersion() != null && !Objects.equals(config().getPromptedVersion(), getLatestVersion().getVersion())) { + if (show && getLatestVersion() != null && !Objects.equals(config().getPromptedVersion(), getLatestVersion().getVersion()) && !config().isDisableStartupUpdateDialog()) { Controllers.dialog(new MessageDialogPane.Builder("", i18n("update.bubble.title", getLatestVersion().getVersion()), MessageDialogPane.MessageType.INFO) .addAction(i18n("button.view"), () -> { config().setPromptedVersion(getLatestVersion().getVersion()); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java index ddc700a719..3c6f27259a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java @@ -69,6 +69,7 @@ public SettingsPage() { selectedItemPropertyFor(cboLanguage).bindBidirectional(config().localizationProperty()); disableAutoGameOptionsPane.selectedProperty().bindBidirectional(config().disableAutoGameOptionsProperty()); + disableStartupUpdateNotificationPane.selectedProperty().bindBidirectional(config().disableStartupUpdateDialogProperty()); // ==== fileCommonLocation.selectedDataProperty().bindBidirectional(config().commonDirTypeProperty()); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java index 6b90221640..ca8f46993f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java @@ -59,6 +59,7 @@ public abstract class SettingsView extends StackPane { protected final JFXRadioButton chkUpdateDev; protected final JFXButton btnUpdate; protected final OptionToggleButton previewPane; + protected final OptionToggleButton disableStartupUpdateNotificationPane; protected final ScrollPane scroll; public SettingsView() { @@ -157,6 +158,13 @@ public SettingsView() { settingsPane.getContent().add(previewPane); } + { + disableStartupUpdateNotificationPane = new OptionToggleButton(); + disableStartupUpdateNotificationPane.setTitle(i18n("update.disable_startup_update_dialog")); + + settingsPane.getContent().add(disableStartupUpdateNotificationPane); + } + { fileCommonLocation = new MultiFileItem(); fileCommonLocationSublist = new ComponentSublist(); diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index b59ab34f74..9c9579b2dc 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -1520,6 +1520,7 @@ update.no_browser=Cannot open in system browser. But we copied the link to your update.tooltip=Update update.preview=Preview HMCL releases early update.preview.tooltip=Enable this option to receive new versions of HMCL early for testing before their official release. +update.disable_startup_update_dialog=Disable update dialog on startup version=Games version.name=Instance Name diff --git a/HMCL/src/main/resources/assets/lang/I18N_es.properties b/HMCL/src/main/resources/assets/lang/I18N_es.properties index e457b9bfc3..a258fc2c7e 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_es.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_es.properties @@ -1446,6 +1446,7 @@ update.no_browser=No se puede abrir en el navegador del sistema. Pero, hemos cop update.tooltip=Actualización update.preview=Vista previa de actualizaciones anticipadas update.preview.tooltip=Activa esta opción para recibir nuevas versiones del lanzador antes de su lanzamiento oficial para probarlas +update.disable_startup_update_dialog=Desactivar diálogo de actualización al iniciar version=Juegos version.name=Nombre de instancia diff --git a/HMCL/src/main/resources/assets/lang/I18N_ja.properties b/HMCL/src/main/resources/assets/lang/I18N_ja.properties index e5c9e5e784..5f762224e3 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ja.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ja.properties @@ -924,6 +924,7 @@ update.note=警告:ベータ版には、より多くの機能とバグ修正 update.latest=これは最新バージョンです。 update.no_browser=ブラウザを開くことができません。リンクがクリップボードにコピーされました。ブラウザのアドレスバーに貼り付けて更新します。 update.tooltip=更新 +update.disable_startup_update_dialog=起動時の更新ダイアログを無効にする version=ゲーム version.cannot_read=ゲームのバージョンが見つかりません。自動インストールを続行できません。 diff --git a/HMCL/src/main/resources/assets/lang/I18N_lzh.properties b/HMCL/src/main/resources/assets/lang/I18N_lzh.properties index 37ce0858b5..4de6bdd629 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_lzh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_lzh.properties @@ -1234,6 +1234,7 @@ update.note=开發版與預版,虽增功、修阙,然亦恐生他患。 update.latest=當版至新 update.no_browser=無啟瀏覽器。址固鈔訖,君可自粘之以啟頁。 update.tooltip=迭更 +update.disable_startup_update_dialog=關啟時之迭更窗 version=戲 version.name=戲例之名 diff --git a/HMCL/src/main/resources/assets/lang/I18N_ru.properties b/HMCL/src/main/resources/assets/lang/I18N_ru.properties index 0cab29cef7..25e0a0d1a9 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ru.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ru.properties @@ -1434,6 +1434,7 @@ update.note=Предупреждение: Бета-версии могут им update.latest=Это последняя версия. update.no_browser=Не удалось открыть браузер. Ссылка была скопирована в буфер обмена. Вставьте его в адресную строку браузера для обновления. update.tooltip=Обновить +update.disable_startup_update_dialog=Отключить диалог обновления при запуске version=Игры version.name=Название сборки diff --git a/HMCL/src/main/resources/assets/lang/I18N_uk.properties b/HMCL/src/main/resources/assets/lang/I18N_uk.properties index 6e727b8e69..549f1ce8bf 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_uk.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_uk.properties @@ -1379,6 +1379,7 @@ update.note=Канали Бета та Нічний можуть мати біл update.latest=Це остання версія update.no_browser=Не вдається відкрити в системному браузері. Але ми скопіювали посилання до вашого буфера обміну, і ви можете відкрити його вручну. update.tooltip=Оновити +update.disable_startup_update_dialog=Вимкнути діалог оновлення під час запуску version=Ігри version.name=Назва екземпляра diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index c97225c873..f06eca35e0 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -1304,6 +1304,7 @@ update.no_browser=無法開啟瀏覽器。網址已經複製到剪貼簿了, update.tooltip=更新 update.preview=提前測試 HMCL 預覽版本 update.preview.tooltip=啟用此選項,你將可以提前取得 HMCL 的新版本,以便在正式發布前進行測試。 +update.disable_startup_update_dialog=關閉啟動時的更新彈窗 version=遊戲 version.name=遊戲實例名稱 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 f05ee9608b..3d98228194 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -1314,6 +1314,7 @@ update.no_browser=无法打开浏览器。网址已经复制到剪贴板,你 update.tooltip=更新 update.preview=提前预览 HMCL 版本 update.preview.tooltip=启用此选项,你将可以提前获取 HMCL 的新版本,以便在正式发布前进行测试。 +update.disable_startup_update_dialog=关闭启动时的更新弹窗 version=游戏 version.name=游戏实例名称

AltStyle によって変換されたページ (->オリジナル) /