diff --git a/BetterGenshinImpact.sln.DotSettings b/BetterGenshinImpact.sln.DotSettings index 6b95ce07..22a67a11 100644 --- a/BetterGenshinImpact.sln.DotSettings +++ b/BetterGenshinImpact.sln.DotSettings @@ -3,4 +3,5 @@ True True True + True True \ No newline at end of file diff --git a/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs b/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs index 4e6fad48..8c381ca4 100644 --- a/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs +++ b/BetterGenshinImpact/Core/Config/OneDragonFlowConfig.cs @@ -51,6 +51,10 @@ public partial class OneDragonFlowConfig : ObservableObject [ObservableProperty] private string _sundaySelectedValue = "0"; + // 尘歌壶传送方式,1. 地图传送 2. 尘歌壶道具 + [ObservableProperty] + private string _sereniteaPotTpType = "地图传送"; + // 尘歌壶洞天购买商品 [ObservableProperty] private List _secretTreasureObjects = new(); diff --git a/BetterGenshinImpact/GameTask/Common/Job/GoToSereniteaPotTask.cs b/BetterGenshinImpact/GameTask/Common/Job/GoToSereniteaPotTask.cs index 589f5045..6501f8ff 100644 --- a/BetterGenshinImpact/GameTask/Common/Job/GoToSereniteaPotTask.cs +++ b/BetterGenshinImpact/GameTask/Common/Job/GoToSereniteaPotTask.cs @@ -68,9 +68,13 @@ internal class GoToSereniteaPotTask Logger.LogDebug(e, "领取尘歌壶奖励异常"); Logger.LogError("领取尘歌壶奖励异常: {Msg}", e.Message); } + finally + { + Simulation.ReleaseAllKey(); + } } - private async Task IntoSereniteaPot(CancellationToken ct) + private async Task IntoSereniteaPot(CancellationToken ct) { // 退出到主页面 await new ReturnMainUiTask().Start(ct); @@ -167,9 +171,8 @@ internal class GoToSereniteaPotTask if (attempt == 9) { - fail = true; Logger.LogWarning("领取尘歌壶奖励:{text}", "传送至尘歌壶失败"); - return; + return false; } Logger.LogInformation("领取尘歌壶奖励:{text}", "传送按钮、传送住宅按钮未找到,重试"); @@ -177,6 +180,7 @@ internal class GoToSereniteaPotTask } await NewRetry.WaitForAction(() => Bv.IsInMainUi(CaptureToRectArea()), ct); + return true; } /// @@ -335,7 +339,7 @@ internal class GoToSereniteaPotTask } await Delay(300, ct); } - await Delay(100, ct); + await Delay(500, ct); // 默认开启动态模糊,停顿时间太短的情况下,截图可能会模糊,导致识别失败 if (continuousCount > 180) { fail = true; @@ -442,7 +446,6 @@ internal class GoToSereniteaPotTask CaptureToRectArea().Find(ElementAssets.Instance.PageCloseWhiteRo).Click(); } - InitConfigList(); await Delay(900, ct); // 商店购买 if (SelectedConfig.SecretTreasureObjects.Count == 0) @@ -630,6 +633,7 @@ internal class GoToSereniteaPotTask public async Task DoOnce(CancellationToken ct) { + InitConfigList(); // /** // * 1. 首先退出到主页面 // * 2. 进入尘歌壶 @@ -638,10 +642,21 @@ internal class GoToSereniteaPotTask // * 5. 领取奖励 // */ // 进入尘歌壶 - if (!await IntoSereniteaPotByBag(ct)) + var success = false; + if (SelectedConfig!.SereniteaPotTpType == "地图传送") { - await IntoSereniteaPot(ct); + success = await IntoSereniteaPot(ct); } + else + { + success = await IntoSereniteaPotByBag(ct); + } + if (!success) + { + await Finished(ct); + return; + } + // 寻找阿圆并靠近 await FindAYuan(ct); // 领取奖励 diff --git a/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml b/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml index a09b83aa..225f3af2 100644 --- a/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml +++ b/BetterGenshinImpact/View/Pages/OneDragonFlowPage.xaml @@ -11,7 +11,7 @@ xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" d:DataContext="{d:DesignInstance Type=pages:OneDragonFlowViewModel}" - d:DesignHeight="600" + d:DesignHeight="1000" d:DesignWidth="800" ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}" ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}" @@ -1014,6 +1014,33 @@ FontSize="14" Foreground="{DynamicResource SystemAccentColorPrimaryBrush}" Text="尘歌壶奖励" /> + + + + + + + + + + + + + + + + diff --git a/BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs b/BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs index 08332dcc..333352c4 100644 --- a/BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs +++ b/BetterGenshinImpact/ViewModel/Pages/OneDragonFlowViewModel.cs @@ -390,6 +390,8 @@ public partial class OneDragonFlowViewModel : ViewModel [ObservableProperty] private List _secretTreasureObjectList = ["布匹","须臾树脂","大英雄的经验","流浪者的经验","精锻用魔矿","摩拉","祝圣精华","祝圣油膏"]; + [ObservableProperty] private List _sereniteaPotTpTypes = ["地图传送", "尘歌壶道具"]; + public AllConfig Config { get; set; } = TaskContext.Instance().Config; public OneDragonFlowViewModel()