mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-04 11:15:18 +08:00
Merge branch 'main' into autoDomain
This commit is contained in:
@@ -22,7 +22,7 @@ public partial class HotKeyConfig : ObservableObject
|
||||
|
||||
[ObservableProperty] private string _turnAroundHotkey = "F3";
|
||||
|
||||
// [ObservableProperty] private string _enhanceArtifactHotkey = "F4";
|
||||
[ObservableProperty] private string _enhanceArtifactHotkey = "F4";
|
||||
|
||||
[ObservableProperty] private string _quickBuyHotkey = "";
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using BetterGenshinImpact.GameTask.AutoSkip.Assets;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception;
|
||||
using BetterGenshinImpact.GameTask.AutoSkip.Assets;
|
||||
using BetterGenshinImpact.GameTask.AutoWood.Utils;
|
||||
using BetterGenshinImpact.View.Drawable;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenCvSharp;
|
||||
using System;
|
||||
using static BetterGenshinImpact.GameTask.Common.TaskControl;
|
||||
using static Vanara.PInvoke.User32;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoSkip;
|
||||
|
||||
@@ -10,21 +14,45 @@ public class OneKeyExpeditionTask
|
||||
{
|
||||
public void Run(AutoSkipAssets assets)
|
||||
{
|
||||
// 1.全部领取
|
||||
var content = TaskControl.CaptureToContent();
|
||||
content.CaptureRectArea.Find(assets.CollectRo, ra =>
|
||||
try
|
||||
{
|
||||
ra.ClickCenter();
|
||||
TaskControl.Logger.LogInformation("探索派遣:{Text}", "全部领取");
|
||||
TaskControl.Sleep(1100);
|
||||
// 2.重新派遣
|
||||
content = TaskControl.CaptureToContent();
|
||||
content.CaptureRectArea.Find(assets.ReRo, ra2 =>
|
||||
// 1.全部领取
|
||||
var content = CaptureToContent();
|
||||
content.CaptureRectArea.Find(assets.CollectRo, ra =>
|
||||
{
|
||||
ra2.ClickCenter();
|
||||
TaskControl.Logger.LogInformation("探索派遣:{Text}", "再次派遣");
|
||||
ra.ClickCenter();
|
||||
Logger.LogInformation("探索派遣:{Text}", "全部领取");
|
||||
Sleep(1100);
|
||||
// 2.重新派遣
|
||||
NewRetry.Do(() =>
|
||||
{
|
||||
Sleep(1);
|
||||
content = CaptureToContent();
|
||||
var ra2 = content.CaptureRectArea.Find(assets.ReRo);
|
||||
if (ra2.IsEmpty())
|
||||
{
|
||||
throw new RetryException("未检测到弹出菜单");
|
||||
}
|
||||
else
|
||||
{
|
||||
ra2.ClickCenter();
|
||||
Logger.LogInformation("探索派遣:{Text}", "再次派遣");
|
||||
}
|
||||
}, TimeSpan.FromSeconds(1), 3);
|
||||
|
||||
// 3.退出派遣页面 ESC
|
||||
Sleep(500);
|
||||
Simulation.SendInputEx.Keyboard.KeyPress(VK.VK_ESCAPE);
|
||||
Logger.LogInformation("探索派遣:{Text}", "完成");
|
||||
});
|
||||
});
|
||||
VisionContext.Instance().DrawContent.ClearAll();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogInformation(e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
VisionContext.Instance().DrawContent.ClearAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,8 @@ using System.Windows;
|
||||
namespace BetterGenshinImpact.GameTask.Macro;
|
||||
|
||||
/// <summary>
|
||||
/// 于 4.3 版本废弃
|
||||
/// 一键强化圣遗物
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
public class QuickEnhanceArtifactMacro
|
||||
{
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- 一键强化 -->
|
||||
<!--<ui:CardExpander Margin="0,0,0,12" ContentPadding="0" Icon="{ui:SymbolIcon Cursor24}">
|
||||
<ui:CardExpander Margin="0,0,0,12" ContentPadding="0" Icon="{ui:SymbolIcon Cursor24}">
|
||||
<ui:CardExpander.Header>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -114,7 +114,7 @@
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
TextWrapping="Wrap"
|
||||
Text="快速强化圣遗物(4.3下线)" />
|
||||
Text="快速强化圣遗物" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
@@ -163,7 +163,7 @@
|
||||
ValidationMode="InvalidInputOverwritten" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ui:CardExpander>-->
|
||||
</ui:CardExpander>
|
||||
|
||||
<!-- 一键购买 -->
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Cursor24}">
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
TextWrapping="Wrap"
|
||||
Text="自动选择鱼饵并抛竿" />
|
||||
Text="自动选择鱼饵并抛竿(实验功能)" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -128,7 +128,7 @@ public partial class HomePageViewModel : ObservableObject, INavigationAware
|
||||
var hWnd = SystemControl.FindGenshinImpactHandle();
|
||||
if (hWnd == IntPtr.Zero)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Config.GenshinStartConfig.InstallPath))
|
||||
if (Config.GenshinStartConfig.LinkedStartEnabled && !string.IsNullOrEmpty(Config.GenshinStartConfig.InstallPath))
|
||||
{
|
||||
hWnd = await SystemControl.StartFromLocalAsync(Config.GenshinStartConfig.InstallPath);
|
||||
}
|
||||
|
||||
@@ -120,13 +120,13 @@ public partial class HotKeyPageViewModel : ObservableObject
|
||||
);
|
||||
HotKeySettingModels.Add(turnAroundHotKeySettingModel);
|
||||
|
||||
// var enhanceArtifactHotKeySettingModel = new HotKeySettingModel(
|
||||
// "按下快速强化圣遗物",
|
||||
// nameof(Config.HotKeyConfig.EnhanceArtifactHotkey),
|
||||
// Config.HotKeyConfig.EnhanceArtifactHotkey,
|
||||
// (_, _) => { QuickEnhanceArtifactMacro.Done(); }
|
||||
// );
|
||||
// HotKeySettingModels.Add(enhanceArtifactHotKeySettingModel);
|
||||
var enhanceArtifactHotKeySettingModel = new HotKeySettingModel(
|
||||
"按下快速强化圣遗物",
|
||||
nameof(Config.HotKeyConfig.EnhanceArtifactHotkey),
|
||||
Config.HotKeyConfig.EnhanceArtifactHotkey,
|
||||
(_, _) => { QuickEnhanceArtifactMacro.Done(); }
|
||||
);
|
||||
HotKeySettingModels.Add(enhanceArtifactHotKeySettingModel);
|
||||
|
||||
HotKeySettingModels.Add(new HotKeySettingModel(
|
||||
"按下快速购买商店物品",
|
||||
|
||||
Reference in New Issue
Block a user