diff --git a/src/MaaWpfGui/Constants/ConfigurationKeys.cs b/src/MaaWpfGui/Constants/ConfigurationKeys.cs index 678bb72338..d820cc2198 100644 --- a/src/MaaWpfGui/Constants/ConfigurationKeys.cs +++ b/src/MaaWpfGui/Constants/ConfigurationKeys.cs @@ -199,6 +199,7 @@ namespace MaaWpfGui.Constants // MirrorChyanCdk 迁到新配置的话就直接叫 UpdateSource,现在本体更新也加上了 MirrorChyan public const string UpdateSource = "VersionUpdate.ResourceUpdateSource"; + public const string ForceGithubGlobalSource = "VersionUpdate.UpdateSource.ForceGithubGlobalSource"; public const string MirrorChyanCdk = "VersionUpdate.ResourceUpdateSource.MirrorChyanCdk"; public const string StartupUpdateCheck = "VersionUpdate.StartupUpdateCheck"; public const string UpdateAutoCheck = "VersionUpdate.ScheduledUpdateCheck"; diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index 2f61574bbf..7a78e8d3aa 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -246,9 +246,10 @@ You can cancel this popup by clicking the Settings - About Us - Issue Reporting Resource update Update Source Global Source + Force using Github MirrorChyan MirrorChyan has detected a software update. Please go to 「Settings - Software Update」 to configure CDK or using the Global source. - MirrorChyan has detected a resource update. Please go to 「Settings - Software Update」 to configure CDK, or click 「Resource Update」 to update manually. + MirrorChyan has detected a resource update. Please go to 「Settings - Software Update」 to configure CDK, or using the Global source click 「Resource Update」 to update manually. New Version Found Downloading in the background…… Version: diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 2c527beb24..863c44c7ce 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -246,6 +246,7 @@ リソース更新 更新ソース グローバルソース + Github を強制使用 MirrorChyan MirrorChyan はソフトウェアの更新を検出しました。CDK を構成するか、グローバル ソースを使用するには、「設定-アップデート設定」に移動してください。 MirrorChyan はリソースの更新を検出しました。「設定-ソフトウェア更新」に移動して CDK を構成するか、「リソース更新」をクリックして手動で更新してください。 diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index 7acdf3254c..9bd3410592 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -246,6 +246,7 @@ 리소스 업데이트 업데이트 소스 글로벌 소스 + Github 강제 사용 MirrorChyan MirrorChyan이 소프트웨어 업데이트를 감지했습니다.「설정 - 소프트웨어 업데이트」로 이동하여 CDK를 구성하거나 글로벌 소스를 사용하세요. MirrorChyan이 리소스 업데이트를 감지했습니다.「설정 - 소프트웨어 업데이트」로 이동하여 CDK를 구성하거나「리소스 업데이트」를 클릭하여 수동으로 업데이트하세요. diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 124e5faf29..96a0657a39 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -246,9 +246,10 @@ 资源更新 更新源 海外源 + 强制使用 Github Mirror 酱 Mirror 酱检测到软件更新。请前往「设置-更新设置」配置 CDK 或使用海外源。 - Mirror 酱检测到资源更新。请前往「设置-更新设置」配置 CDK,或点击「资源更新」进行手动更新。 + Mirror 酱检测到资源更新。请前往「设置-更新设置」配置 CDK,或使用海外源点击「资源更新」进行手动更新。 检测到新版本 正在后台下载…… 版本号: diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index ed549686b6..196ef4c720 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -246,9 +246,10 @@ 資源更新 更新來源 全域來源 + 強制使用 Github Mirror 醬 Mirror 醬偵測到軟體更新。請前往「設定-更新設定」設定 CDK 或使用全域來源。 - Mirror 醬偵測到資源更新。請前往「設定-更新設定」設定 CDK,或點選「資源更新」進行手動更新。 + Mirror 醬偵測到資源更新。請前往「設定-更新設定」設定 CDK,或使用全域來源點選「資源更新」進行手動更新。 檢測到新版本 正在後臺下載…… 版本號: diff --git a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs index 1914407e1e..4230c68c11 100644 --- a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs @@ -568,12 +568,16 @@ public class VersionUpdateViewModel : Screen } string? rawUrl = _assetsObject["browser_download_url"]?.ToString(); - var mirrors = _assetsObject["mirrors"]?.ToObject>(); - var urls = new List(); - if (mirrors != null) + + if (SettingsViewModel.VersionUpdateSettings.UpdateSource == "Github" && !SettingsViewModel.VersionUpdateSettings.ForceGithubGlobalSource) { - urls.AddRange(mirrors); + var mirrors = _assetsObject["mirrors"]?.ToObject>(); + + if (mirrors != null) + { + urls.AddRange(mirrors); + } } // 负载均衡 diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs index 7d090798b2..1eac4461a2 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs @@ -252,6 +252,18 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase } } + private bool _forceGithubGlobalSource = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ForceGithubGlobalSource, bool.FalseString)); + + public bool ForceGithubGlobalSource + { + get => _forceGithubGlobalSource; + set + { + SetAndNotify(ref _forceGithubGlobalSource, value); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.ForceGithubGlobalSource, value.ToString()); + } + } + private string _mirrorChyanCdk = SimpleEncryptionHelper.Decrypt(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.MirrorChyanCdk, string.Empty)); public string MirrorChyanCdk diff --git a/src/MaaWpfGui/Views/UserControl/Settings/VersionUpdateSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/Settings/VersionUpdateSettingsUserControl.xaml index d12de49ca7..446c397074 100644 --- a/src/MaaWpfGui/Views/UserControl/Settings/VersionUpdateSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/Settings/VersionUpdateSettingsUserControl.xaml @@ -63,6 +63,13 @@ VerticalAlignment="Center" Content="{DynamicResource AutoInstallUpdatePackage}" IsChecked="{Binding AutoInstallUpdatePackage}" /> +