feat: 添加 MirrorChyan 资源更新方式 (#11669)

Co-authored-by: MistEO <mistereo@hotmail.com>
This commit is contained in:
uye
2025-01-29 02:16:16 +08:00
committed by GitHub
parent 562da7d257
commit de138a888a
15 changed files with 252 additions and 12 deletions

View File

@@ -26,6 +26,7 @@ using System.Windows;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;
using MaaWpfGui.Models;
using MaaWpfGui.Services;
using MaaWpfGui.States;
using Newtonsoft.Json;
@@ -465,6 +466,22 @@ public class VersionUpdateViewModel : Screen
}
*/
// 可以用 MirrorChyan 资源更新了喵
switch (SettingsViewModel.VersionUpdateSettings.ResourceUpdateSource)
{
case "MirrorChyan":
if (!string.IsNullOrEmpty(SettingsViewModel.VersionUpdateSettings.MirrorChyanCdk))
{
if (await ResourceUpdater.UpdateFromMirrorChyanAsync())
{
SettingsViewModel.VersionUpdateSettings.IsCheckingForUpdates = false;
return CheckUpdateRetT.OnlyGameResourceUpdated;
}
}
break;
}
SettingsViewModel.VersionUpdateSettings.IsCheckingForUpdates = false;
return ret;
}