Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d4c755b4d | ||
|
|
89e92d57b2 |
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: Bug report / 错误报告
|
||||
about: Create a report to help us improve / 创建报告以帮助我们改进
|
||||
title: "[bug]请补充标题内容"
|
||||
title: "[bug] "
|
||||
labels: bug
|
||||
---
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[submodule "Test/BetterGenshinImpact.UnitTest/Assets"]
|
||||
path = Test/BetterGenshinImpact.UnitTest/Assets
|
||||
url = https://github.com/huiyadanli/BetterGI.UnitTest.Assets.git
|
||||
[submodule "BetterGenshinImpact/Script"]
|
||||
path = BetterGenshinImpact/Script
|
||||
url = https://github.com/babalae/bettergi-scripts.git
|
||||
@@ -13,7 +13,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\BetterGenshinImpact\BetterGenshinImpact.csproj" />
|
||||
<ProjectReference Include="..\BetterGenshinImpact\BetterGenshinImpact.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -19,17 +19,17 @@ public class AvatarClassifyGen
|
||||
// 读取基础图像
|
||||
// List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "*.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// 只用一个图像
|
||||
List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Mizuki.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// List<string> sideImageFiles2 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Iansan.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// sideImageFiles.AddRange(sideImageFiles2);
|
||||
// List<string> sideImageFiles3 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Citlali.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// sideImageFiles.AddRange(sideImageFiles3);
|
||||
// List<string> sideImageFiles4 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Lanyan.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// sideImageFiles.AddRange(sideImageFiles4);
|
||||
// List<string> sideImageFiles5 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_XianglingCostumeWinter.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// sideImageFiles.AddRange(sideImageFiles5);
|
||||
// List<string> sideImageFiles6 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Mavuika.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
// sideImageFiles.AddRange(sideImageFiles6);
|
||||
List<string> sideImageFiles = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Emilie.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
List<string> sideImageFiles2 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_MomokaCostumeErrantry.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
sideImageFiles.AddRange(sideImageFiles2);
|
||||
List<string> sideImageFiles3 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_NilouCostumeFairy.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
sideImageFiles.AddRange(sideImageFiles3);
|
||||
List<string> sideImageFiles4 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Kachina.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
sideImageFiles.AddRange(sideImageFiles4);
|
||||
List<string> sideImageFiles5 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Mualani.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
sideImageFiles.AddRange(sideImageFiles5);
|
||||
List<string> sideImageFiles6 = Directory.GetFiles(Path.Combine(BaseDir, "side_src"), "UI_AvatarIcon_Side_Kinich.png", SearchOption.TopDirectoryOnly).ToList();
|
||||
sideImageFiles.AddRange(sideImageFiles6);
|
||||
|
||||
// 生成训练集
|
||||
GenTo(sideImageFiles, Path.Combine(BaseDir, @"dateset\train"), 200);
|
||||
@@ -31,7 +31,7 @@
|
||||
Width="100"
|
||||
Height="23"
|
||||
Click="DoMatchTest"
|
||||
Content="生成特征点" />
|
||||
Content="特征匹配测试" />
|
||||
<Button Canvas.Left="10"
|
||||
Canvas.Top="130"
|
||||
Width="100"
|
||||
@@ -49,15 +49,7 @@
|
||||
Width="100"
|
||||
Height="23"
|
||||
Click="GenAvatarData"
|
||||
Content="侧面头像数据集" />
|
||||
<Button Canvas.Left="120"
|
||||
Canvas.Top="190"
|
||||
Width="100"
|
||||
Height="23"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Click="GenAvatarDataT"
|
||||
Content="透明头像数据集" />
|
||||
Content="生成侧面头像数据集" />
|
||||
<Button Canvas.Left="10"
|
||||
Canvas.Top="220"
|
||||
Width="100"
|
||||
@@ -78,13 +70,5 @@
|
||||
VerticalAlignment="Center"
|
||||
Click="ZoomOut"
|
||||
Content="缩小地图到256" />
|
||||
<Button Canvas.Left="120"
|
||||
Canvas.Top="40"
|
||||
Width="100"
|
||||
Height="23"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Click="CameraTest"
|
||||
Content="新视角识别测试" />
|
||||
</Canvas>
|
||||
</Window>
|
||||
@@ -1,17 +1,17 @@
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Common.Map;
|
||||
using BetterGenshinImpact.Test.Dataset;
|
||||
using BetterGenshinImpact.Test.Simple;
|
||||
using BetterGenshinImpact.Test.Simple.AllMap;
|
||||
using BetterGenshinImpact.Test.Simple.Track;
|
||||
using BetterGenshinImpact.Test.View;
|
||||
using System.Windows;
|
||||
using BetterGenshinImpact.GameTask.Common.Map;
|
||||
using OpenCvSharp;
|
||||
using Window = System.Windows.Window;
|
||||
|
||||
namespace BetterGenshinImpact.Test;
|
||||
|
||||
/// <summary>
|
||||
/// MainWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
@@ -32,7 +32,7 @@ public partial class MainWindow : Window
|
||||
|
||||
private void DoMapPuzzle(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
MapPuzzle.PutAll();
|
||||
MapPuzzle.Put();
|
||||
}
|
||||
|
||||
private void DoOcrTest(object sender, System.Windows.RoutedEventArgs e)
|
||||
@@ -49,15 +49,10 @@ public partial class MainWindow : Window
|
||||
{
|
||||
// KeyPointMatchTest.Test();
|
||||
// EntireMapTest.Test();
|
||||
// EntireMapTest.Storage();
|
||||
EntireMapTest.Storage();
|
||||
// BigMapMatchTest.Test();
|
||||
|
||||
// FeatureTransfer.Transfer();
|
||||
|
||||
// var extractor = new LargeSiftExtractor();
|
||||
// extractor.ExtractAndSaveSift(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\");
|
||||
|
||||
EntireMapTest.Storage256();
|
||||
}
|
||||
|
||||
private void MapDrawTeleportPoint(object sender, RoutedEventArgs e)
|
||||
@@ -84,30 +79,4 @@ public partial class MainWindow : Window
|
||||
{
|
||||
ScaleTest.ZoomOutTest();
|
||||
}
|
||||
|
||||
private void GenAvatarDataT(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AvatarClassifyTransparentGen.GenAll();
|
||||
}
|
||||
|
||||
private void CameraTest(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var path = @"E:\HuiTask\更好的原神\地图匹配\比较\小地图\Clip_20240323_185854.png";
|
||||
|
||||
var pic1 = new Mat(path);
|
||||
CameraOrientationFromLimint cameraOrientation = new();
|
||||
var f = cameraOrientation.PredictRotation(pic1);
|
||||
Debug.WriteLine("C#版本 方向1:" + f);
|
||||
|
||||
|
||||
// var pic2 = new Mat(path);
|
||||
// CameraOrientationV2 cameraOrientation3 = new();
|
||||
// var f3 = cameraOrientation3.PredictRotation(pic2);
|
||||
// Debug.WriteLine("py直接翻译C#版本 方向1:" + f3);
|
||||
|
||||
|
||||
var grey = new Mat(path, ImreadModes.Grayscale);
|
||||
var f2 = CameraOrientation.ComputeMiniMap(grey);
|
||||
Debug.WriteLine("老版本方向2:" + f2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class BigMapMatchTest
|
||||
SpeedTimer speedTimer = new();
|
||||
// var mainMap100BlockMat = new Mat(@"D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Assets\Map\mainMap100Block.png", ImreadModes.Grayscale);
|
||||
|
||||
var map2048 = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", ImreadModes.Grayscale);
|
||||
var map2048 = MapAssets.Instance.MainMap2048BlockMat.Value;
|
||||
var mainMap100BlockMat = ResizeHelper.Resize(map2048, 1d / (4 * 2));
|
||||
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\mainMap128Block.png", mainMap100BlockMat);
|
||||
|
||||
@@ -6,8 +6,6 @@ using OpenCvSharp;
|
||||
using OpenCvSharp.Detail;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Common.Map;
|
||||
|
||||
namespace BetterGenshinImpact.Test.Simple.AllMap;
|
||||
|
||||
@@ -53,13 +51,7 @@ public class EntireMapTest
|
||||
|
||||
public static void Storage()
|
||||
{
|
||||
var featureMatcher = new FeatureMatcher(new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", ImreadModes.Grayscale), new FeatureStorage("mainMap2048Block"));
|
||||
var featureMatcher = new FeatureMatcher(MapAssets.Instance.MainMap2048BlockMat.Value, new FeatureStorage("mainMap2048Block"));
|
||||
MessageBox.Show("特征点生成完成");
|
||||
}
|
||||
|
||||
public static void Storage256()
|
||||
{
|
||||
FeatureMatcher _featureMatcher = new( new Mat(Global.Absolute(@"Assets\Map\mainMap256Block.png"), ImreadModes.Grayscale), new FeatureStorage("mainMap256Block"));
|
||||
MessageBox.Show("256特征点生成完成");
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ namespace BetterGenshinImpact.Test.Simple.AllMap;
|
||||
|
||||
public class MapPuzzle
|
||||
{
|
||||
public static readonly int block = 2048;
|
||||
|
||||
public static List<string> PicWhiteHashList = new List<string>
|
||||
{
|
||||
@@ -25,26 +26,9 @@ public class MapPuzzle
|
||||
|
||||
public static MD5 Md5Service = MD5.Create();
|
||||
|
||||
public static void PutAll()
|
||||
public static void Put()
|
||||
{
|
||||
// 保存2048大图
|
||||
// var img2048 = Put(2048);
|
||||
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_2048.png", img2048);
|
||||
|
||||
// 保存1024
|
||||
var img1024 = Put(1024);
|
||||
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_1024.png", img1024);
|
||||
|
||||
// 保存256
|
||||
// var grayImage = new Mat();
|
||||
// Cv2.CvtColor(img1024.Resize(new Size(img1024.Width / 4, img1024.Height / 4), 0, 0, InterpolationFlags.Cubic), grayImage, ColorConversionCodes.BGR2GRAY);
|
||||
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.2\map_52_256.png", grayImage);
|
||||
|
||||
}
|
||||
|
||||
public static Mat Put(int block = 2048)
|
||||
{
|
||||
string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map_5.2"; // 图片文件夹路径
|
||||
string folderPath = @"E:\HuiTask\更好的原神\地图匹配\UI_Map_5.0"; // 图片文件夹路径
|
||||
string pattern = @"UI_MapBack_([-+]?\d+)_([-+]?\d+)(.*)";
|
||||
var images = Directory.GetFiles(folderPath, "*.png", SearchOption.TopDirectoryOnly); // 获取所有图片文件路径
|
||||
|
||||
@@ -130,7 +114,6 @@ public class MapPuzzle
|
||||
// 计算大图的总宽度和高度
|
||||
var lenCol = maxCol - minCol;
|
||||
var lenRow = maxRow - minRow;
|
||||
Debug.WriteLine($"列数X: {lenCol+1}, 行数Y: {lenRow+1}");
|
||||
int totalWidth = (lenCol + 1) * block;
|
||||
int totalHeight = (lenRow + 1) * block;
|
||||
|
||||
@@ -175,13 +158,19 @@ public class MapPuzzle
|
||||
}
|
||||
|
||||
// 地图图片块
|
||||
// SaveImagesAs1024X1024(arr, imageLocations, @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\地图块", minRow, minCol);
|
||||
|
||||
SaveImagesAs1024X1024(arr, imageLocations, @"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\地图块", minRow, minCol);
|
||||
|
||||
// 保存大图
|
||||
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\map_50_2048.png", largeImage);
|
||||
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_sd4x.png", largeImage.Resize(new Size(largeImage.Width / 4, largeImage.Height / 4), 0, 0, InterpolationFlags.Cubic));
|
||||
// Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\combined_image_small.png", largeImage.Resize(new Size(1400, 1300), 0, 0, InterpolationFlags.Cubic));
|
||||
|
||||
// 释放资源
|
||||
return largeImage;
|
||||
largeImage.Dispose();
|
||||
foreach (var img in imageLocations.Values)
|
||||
{
|
||||
img.Img.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveImagesAs1024X1024(int[,] arr, Dictionary<(int row, int col), ImgInfo> imageLocations, string outputFolder, int minRow, int minCol)
|
||||
@@ -16,11 +16,11 @@ public class MapTeleportPointDraw
|
||||
// var pList = LoadTeleportPoint(@"E:\HuiTask\更好的原神\地图匹配\地图点位\5.0");
|
||||
// pList.AddRange(MapAssets.Instance.TpPositions);
|
||||
var map = new Mat(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\mainMap1024BlockColor.png");
|
||||
DrawTeleportPoint(map, MapLazyAssets.Instance.TpPositions);
|
||||
DrawTeleportPoint(map, MapAssets.Instance.TpPositions);
|
||||
Cv2.ImWrite(@"E:\HuiTask\更好的原神\地图匹配\有用的素材\5.0\传送点_1024_0.34.3.png", map);
|
||||
}
|
||||
|
||||
public static void DrawTeleportPoint(Mat map, List<GiTpPosition> points)
|
||||
public static void DrawTeleportPoint(Mat map, List<GiWorldPosition> points)
|
||||
{
|
||||
foreach (var point in points)
|
||||
{
|
||||
@@ -61,7 +61,7 @@ internal class HsvTestWindow
|
||||
Cv2.CreateTrackbar("High S", _windowDetectionName, ref _highS, MaxValue, on_high_S_thresh_trackbar);
|
||||
Cv2.CreateTrackbar("Low V", _windowDetectionName, ref _lowV, MaxValue, on_low_V_thresh_trackbar);
|
||||
Cv2.CreateTrackbar("High V", _windowDetectionName, ref _highV, MaxValue, on_high_V_thresh_trackbar);
|
||||
var frame = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\Q识别\拼图\2.png", ImreadModes.Color);
|
||||
var frame = Cv2.ImRead(@"E:\HuiTask\更好的原神\自动秘境\自动战斗\队伍识别\bsz1.png", ImreadModes.Color);
|
||||
Mat frameHsv = new Mat();
|
||||
// Convert from BGR to HSV colorspace
|
||||
Cv2.CvtColor(frame, frameHsv, ColorConversionCodes.BGR2HSV);
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="NativeMethods.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/CsWin32/main/src/Microsoft.Windows.CsWin32/settings.schema.json",
|
||||
"allowMarshaling": true,
|
||||
"useSafeHandles": false,
|
||||
"emitSingleFile": true,
|
||||
"public": true,
|
||||
"comInterop": {
|
||||
"useIntPtrForComOutPointers": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// D3D11
|
||||
CreateDirect3D11DeviceFromDXGIDevice
|
||||
CreateDirect3D11SurfaceFromDXGISurface
|
||||
|
||||
// GDI32
|
||||
BitBlt
|
||||
CreateCompatibleBitmap
|
||||
CreateCompatibleDC
|
||||
DeleteDC
|
||||
GetDeviceCaps
|
||||
SelectObject
|
||||
|
||||
// User32
|
||||
GetClientRect
|
||||
GetDC
|
||||
GetForegroundWindow
|
||||
GetSystemMetrics
|
||||
GetWindowDC
|
||||
GetWindowRect
|
||||
GetWindowThreadProcessId
|
||||
mouse_event
|
||||
PostMessage
|
||||
ReleaseDC
|
||||
EnumWindows
|
||||
GetWindowText
|
||||
IsWindowVisible
|
||||
GetWindowTextLength
|
||||
|
||||
// COM & WinRT
|
||||
D3D11CreateDevice
|
||||
ID3D11Device3
|
||||
IDirect3DDxgiInterfaceAccess
|
||||
|
||||
// Constants
|
||||
D3D11_SDK_VERSION
|
||||
DXGI_ERROR_UNSUPPORTED
|
||||
WM_LBUTTONDOWN
|
||||
WM_LBUTTONUP
|
||||
@@ -5,24 +5,28 @@ VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact", "BetterGenshinImpact\BetterGenshinImpact.csproj", "{75EC89E2-413D-4725-BCEA-AFAC57708F07}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.WindowCapture", "Vision.WindowCapture\Vision.WindowCapture.csproj", "{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Win32", "BetterGenshinImpact.Win32\BetterGenshinImpact.Win32.csproj", "{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.GameCapture", "Fischless.GameCapture\Fischless.GameCapture.csproj", "{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vision.WindowCapture.Test", "Vision.WindowCapture.Test\Vision.WindowCapture.Test.csproj", "{D35CB953-C666-4E57-9A9A-3AAE5BF78402}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.HotkeyCapture", "Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj", "{08152E44-2564-46C5-B5B2-54DD43C01A79}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.KeyboardCapture", "Fischless.KeyboardCapture\Fischless.KeyboardCapture.csproj", "{10A48327-7E58-4B51-B1FC-55506C703C8F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deploy", "Deploy", "{458E1106-43A4-47E6-B11B-D243035D4C76}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicaSetup", "Build\MicaSetup\MicaSetup.csproj", "{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicaSetup.Uninst", "Build\MicaSetup\MicaSetup.Uninst.csproj", "{673344BC-B860-44AE-AD88-D33465BDE25B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Test", "Test\BetterGenshinImpact.Test\BetterGenshinImpact.Test.csproj", "{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterGenshinImpact.Test", "BetterGenshinImpact.Test\BetterGenshinImpact.Test.csproj", "{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fischless.WindowsInput", "Fischless.WindowsInput\Fischless.WindowsInput.csproj", "{9D00BC7A-9280-4AC9-8951-4502EDB71B76}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterGenshinImpact.UnitTest", "Test\BetterGenshinImpact.UnitTest\BetterGenshinImpact.UnitTest.csproj", "{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -39,6 +43,22 @@ Global
|
||||
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|Any CPU.Build.0 = Release|x64
|
||||
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.ActiveCfg = Release|x64
|
||||
{75EC89E2-413D-4725-BCEA-AFAC57708F07}.Release|x64.Build.0 = Release|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Debug|x64.Build.0 = Debug|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|Any CPU.Build.0 = Release|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.ActiveCfg = Release|x64
|
||||
{C9080C1D-1B26-46CB-A494-A5E7FE3FCEBA}.Release|x64.Build.0 = Release|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Debug|x64.Build.0 = Debug|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|Any CPU.Build.0 = Release|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.ActiveCfg = Release|x64
|
||||
{75F4541B-9624-4AFB-BAEA-3EAFD3300EE1}.Release|x64.Build.0 = Release|x64
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -47,6 +67,14 @@ Global
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|Any CPU.Build.0 = Release|x64
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.ActiveCfg = Release|x64
|
||||
{6B0A3D96-D88D-48DD-8112-4CD5BA5D27CE}.Release|x64.Build.0 = Release|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Debug|x64.Build.0 = Debug|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|Any CPU.Build.0 = Release|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.ActiveCfg = Release|x64
|
||||
{D35CB953-C666-4E57-9A9A-3AAE5BF78402}.Release|x64.Build.0 = Release|x64
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -55,6 +83,14 @@ Global
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|Any CPU.Build.0 = Release|x64
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.ActiveCfg = Release|x64
|
||||
{08152E44-2564-46C5-B5B2-54DD43C01A79}.Release|x64.Build.0 = Release|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Debug|x64.Build.0 = Debug|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|Any CPU.Build.0 = Release|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|x64.ActiveCfg = Release|x64
|
||||
{10A48327-7E58-4B51-B1FC-55506C703C8F}.Release|x64.Build.0 = Release|x64
|
||||
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -73,12 +109,12 @@ Global
|
||||
{673344BC-B860-44AE-AD88-D33465BDE25B}.Release|x64.Build.0 = Release|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.Build.0 = Debug|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.Build.0 = Release|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.ActiveCfg = Release|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.Build.0 = Release|x64
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -87,14 +123,6 @@ Global
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|Any CPU.Build.0 = Release|x64
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.ActiveCfg = Release|x64
|
||||
{9D00BC7A-9280-4AC9-8951-4502EDB71B76}.Release|x64.Build.0 = Release|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Debug|x64.Build.0 = Debug|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|Any CPU.Build.0 = Release|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|x64.ActiveCfg = Release|x64
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -102,8 +130,6 @@ Global
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{AB85DA23-EB8F-4FBF-A7FA-35CE05B23C15} = {458E1106-43A4-47E6-B11B-D243035D4C76}
|
||||
{673344BC-B860-44AE-AD88-D33465BDE25B} = {458E1106-43A4-47E6-B11B-D243035D4C76}
|
||||
{27AF227E-BE44-450F-8E95-C1AD4FDE14BE} = {02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}
|
||||
{7DA575C0-8D1E-4BD2-AEDB-5471D8906B98} = {02CEA57F-C24B-40F9-AF31-F1D4F3BDB4BF}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {352D8B78-9DE3-4E58-985F-FADD22594DB4}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<bgivc:BooleanToEnableTextConverter x:Key="BooleanToEnableTextConverter" />
|
||||
<bgivc:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||
<bgivc:NotNullConverter x:Key="NotNullConverter" />
|
||||
<bgivc:EnumToKVPConverter x:Key="EnumToKVPConverter" />
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,7 +1,6 @@
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using BetterGenshinImpact.Helpers.Extensions;
|
||||
using BetterGenshinImpact.Hutao;
|
||||
using BetterGenshinImpact.Service;
|
||||
using BetterGenshinImpact.Service.Interface;
|
||||
using BetterGenshinImpact.Service.Notification;
|
||||
@@ -21,9 +20,7 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using BetterGenshinImpact.ViewModel.Pages.View;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.DependencyInjection;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
namespace BetterGenshinImpact;
|
||||
@@ -39,10 +36,6 @@ public partial class App : Application
|
||||
.CheckIntegration()
|
||||
.UseElevated()
|
||||
.UseSingleInstance("BetterGI")
|
||||
.ConfigureLogging(builder =>
|
||||
{
|
||||
builder.ClearProviders();
|
||||
})
|
||||
.ConfigureServices(
|
||||
(context, services) =>
|
||||
{
|
||||
@@ -71,12 +64,11 @@ public partial class App : Application
|
||||
Log.Logger = loggerConfiguration.CreateLogger();
|
||||
services.AddLogging(c => c.AddSerilog());
|
||||
|
||||
services.AddNavigationViewPageProvider();
|
||||
// App Host
|
||||
services.AddHostedService<ApplicationHostService>();
|
||||
|
||||
// Page resolver service
|
||||
services.AddSingleton<INavigationService, NavigationService>();
|
||||
services.AddSingleton<IUpdateService, UpdateService>();
|
||||
services.AddSingleton<IPageService, PageService>();
|
||||
|
||||
// Service containing navigation, same as INavigationWindow... but without window
|
||||
services.AddSingleton<INavigationService, NavigationService>();
|
||||
@@ -94,25 +86,10 @@ public partial class App : Application
|
||||
services.AddView<CommonSettingsPage, CommonSettingsPageViewModel>();
|
||||
services.AddView<TaskSettingsPage, TaskSettingsPageViewModel>();
|
||||
services.AddView<HotKeyPage, HotKeyPageViewModel>();
|
||||
// services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
|
||||
services.AddView<NotificationSettingsPage, NotificationSettingsPageViewModel>();
|
||||
services.AddView<KeyMouseRecordPage, KeyMouseRecordPageViewModel>();
|
||||
services.AddView<JsListPage, JsListViewModel>();
|
||||
services.AddView<MapPathingPage, MapPathingViewModel>();
|
||||
services.AddView<OneDragonFlowPage, OneDragonFlowViewModel>();
|
||||
services.AddSingleton<PathingConfigViewModel>();
|
||||
// services.AddView<PathingConfigView, PathingConfigViewModel>();
|
||||
services.AddView<KeyBindingsSettingsPage, KeyBindingsSettingsPageViewModel>();
|
||||
|
||||
// 一条龙 ViewModels
|
||||
// services.AddSingleton<CraftViewModel>();
|
||||
// services.AddSingleton<DailyCommissionViewModel>();
|
||||
// services.AddSingleton<DailyRewardViewModel>();
|
||||
// services.AddSingleton<DomainViewModel>();
|
||||
// services.AddSingleton<ForgingViewModel>();
|
||||
// services.AddSingleton<LeyLineBlossomViewModel>();
|
||||
// services.AddSingleton<MailViewModel>();
|
||||
// services.AddSingleton<SereniteaPotViewModel>();
|
||||
// services.AddSingleton<TcgViewModel>();
|
||||
|
||||
// My Services
|
||||
services.AddSingleton<TaskTriggerDispatcher>();
|
||||
@@ -120,7 +97,6 @@ public partial class App : Application
|
||||
services.AddHostedService(sp => sp.GetRequiredService<NotificationService>());
|
||||
services.AddSingleton<NotifierManager>();
|
||||
services.AddSingleton<IScriptService, ScriptService>();
|
||||
services.AddSingleton<HutaoNamedPipe>();
|
||||
|
||||
// Configuration
|
||||
//services.Configure<AppConfig>(context.Configuration.GetSection(nameof(AppConfig)));
|
||||
@@ -184,8 +160,6 @@ public partial class App : Application
|
||||
protected override async void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
|
||||
TempManager.CleanUp();
|
||||
|
||||
await _host.StopAsync();
|
||||
_host.Dispose();
|
||||
|
||||
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 199 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 2.7 MiB |
@@ -1352,7 +1352,7 @@
|
||||
"秘源机鞘",
|
||||
"秘源真芯",
|
||||
"稚嫩的尖齿",
|
||||
"老练的坚齿",
|
||||
"老练的尖齿",
|
||||
"横行霸者的利齿",
|
||||
"卫从的木哨",
|
||||
"战士的铁哨",
|
||||
@@ -4769,696 +4769,6 @@
|
||||
"「一篇未完成的手稿」",
|
||||
"杏仁",
|
||||
"溪泉",
|
||||
"《提瓦特世界史·第一部分》",
|
||||
"《枫丹香水广告集》",
|
||||
"《白猫神探》",
|
||||
"《薰衣草之花》",
|
||||
"「伊利萨」",
|
||||
"「半熟蛋」",
|
||||
"「合成台」",
|
||||
"「咕噜噜」",
|
||||
"「大椰子」",
|
||||
"「小波」",
|
||||
"「此地的伟大精神」",
|
||||
"「毛发如夜的野兽」",
|
||||
"「灵道刻印门」",
|
||||
"「炫彩呆子」",
|
||||
"「狂图捕手」",
|
||||
"「绿松石」",
|
||||
"「翡翠」",
|
||||
"「西弗安雅」",
|
||||
"「金盏花」",
|
||||
"「队长」",
|
||||
"「黑曜石碑的影像」",
|
||||
"丁戈内克",
|
||||
"万奎洛",
|
||||
"万杰鲁",
|
||||
"不耐烦的贼匪",
|
||||
"不耐烦的部族成员",
|
||||
"专注的「花羽会」战士",
|
||||
"为伙伴们烹饪料理",
|
||||
"乌丘",
|
||||
"乌兰塔",
|
||||
"乌图伦库",
|
||||
"乌尔",
|
||||
"乌米",
|
||||
"乌苏坎",
|
||||
"乌茨勒",
|
||||
"互动点",
|
||||
"亚格贝乌",
|
||||
"亚瓦尔",
|
||||
"亚蕾琪",
|
||||
"代杜古",
|
||||
"伊克娜",
|
||||
"伊兹娜",
|
||||
"伊卡力",
|
||||
"伊卡尤",
|
||||
"伊图提娅",
|
||||
"伊妮",
|
||||
"伊扎帕",
|
||||
"伊法",
|
||||
"伊波莱",
|
||||
"伊泽",
|
||||
"伊瓦伊",
|
||||
"伊约芭",
|
||||
"伊茨昆",
|
||||
"伊莫莎",
|
||||
"伊莱帕",
|
||||
"伊蒂莉",
|
||||
"伊蕾尔",
|
||||
"伊蜜",
|
||||
"伊西多尔",
|
||||
"伊西姆",
|
||||
"伊赫卡",
|
||||
"众人写成的记录",
|
||||
"低语",
|
||||
"佩蕾·努伊",
|
||||
"依扎娜",
|
||||
"依稀可以辨认的布告",
|
||||
"克伊奈",
|
||||
"克拉莉希娅",
|
||||
"克瓦斯尼科夫",
|
||||
"克维库",
|
||||
"兰卡亚",
|
||||
"兰维达",
|
||||
"兰萨提",
|
||||
"兰齐塔",
|
||||
"兴奋的「回声之子」战士",
|
||||
"冰冷的身躯",
|
||||
"冷静的「回声之子」战士",
|
||||
"凯塔",
|
||||
"凯安",
|
||||
"出魂试炼之所的留言",
|
||||
"切妮",
|
||||
"列扎诺夫",
|
||||
"利别科",
|
||||
"利洛",
|
||||
"加勒弗大汪",
|
||||
"加塔力",
|
||||
"加杰雷",
|
||||
"加纳尔",
|
||||
"努乌",
|
||||
"努斯妲",
|
||||
"勇敢的匿叶龙",
|
||||
"勇猛的嵴锋龙",
|
||||
"勒拉",
|
||||
"匿叶龙",
|
||||
"南娜",
|
||||
"卡乌帕",
|
||||
"卡乌胡",
|
||||
"卡乌鲁",
|
||||
"卡伦雅",
|
||||
"卡克斯",
|
||||
"卡克斯的行装",
|
||||
"卡兹加",
|
||||
"卡力弗",
|
||||
"卡卡妈妈",
|
||||
"卡嘉",
|
||||
"卡图马",
|
||||
"卡安",
|
||||
"卡帕可",
|
||||
"卡拉穆鲁",
|
||||
"卡纳鲁亚",
|
||||
"卡胡那",
|
||||
"卡胡鲁",
|
||||
"卡马克",
|
||||
"卡马加",
|
||||
"卡齐娜",
|
||||
"受困的匿叶龙",
|
||||
"受困的嵴锋龙",
|
||||
"古塞尼科夫",
|
||||
"古寻梦祭司的记录·其之一",
|
||||
"古寻梦祭司的记录·其之三",
|
||||
"古寻梦祭司的记录·其之二",
|
||||
"古寻梦祭司的记录·其之四",
|
||||
"古瑟雷德",
|
||||
"古老的布告",
|
||||
"古老的日记",
|
||||
"古老的碑刻",
|
||||
"古雷马",
|
||||
"叶莱菲",
|
||||
"吉恩布",
|
||||
"向下看",
|
||||
"呆呆的小嵴锋龙",
|
||||
"呆呆的绵驮兽",
|
||||
"呼噜克",
|
||||
"哈卡乌",
|
||||
"哈蒂丝",
|
||||
"哈隆加",
|
||||
"唤灵师的手记·其一",
|
||||
"唤灵师的手记·其二",
|
||||
"商队成员",
|
||||
"嗜岩·兽境幼兽",
|
||||
"嘉乌兰妮",
|
||||
"因卡纳克",
|
||||
"因娜",
|
||||
"团雀01",
|
||||
"团雀02",
|
||||
"团雀03",
|
||||
"困倦的绒翼龙",
|
||||
"图尼娜",
|
||||
"图帕克",
|
||||
"图蒂坦",
|
||||
"图蕾娅",
|
||||
"图达玛",
|
||||
"圣王的手记·其一",
|
||||
"圣王的手记·其七",
|
||||
"圣王的手记·其三",
|
||||
"圣王的手记·其九",
|
||||
"圣王的手记·其二",
|
||||
"圣王的手记·其五",
|
||||
"圣王的手记·其八",
|
||||
"圣王的手记·其六",
|
||||
"圣王的手记·其四",
|
||||
"坎内克",
|
||||
"埃文苏",
|
||||
"基尼奇",
|
||||
"基斯庇",
|
||||
"基班古",
|
||||
"基维拉",
|
||||
"基耶霍",
|
||||
"塔力帕",
|
||||
"塔卢加",
|
||||
"塔尔科",
|
||||
"塔恩加",
|
||||
"塔洛娜",
|
||||
"塔穆因",
|
||||
"塔莫蕾",
|
||||
"塔诺",
|
||||
"塞奇托",
|
||||
"塞巴尔",
|
||||
"夏安卡",
|
||||
"夏拉帕",
|
||||
"夏温",
|
||||
"夏芙米娅",
|
||||
"夏萝·努伊",
|
||||
"多巴",
|
||||
"夜猫子",
|
||||
"夜神",
|
||||
"夜魂之灵",
|
||||
"大家伙?",
|
||||
"大胆的调查员",
|
||||
"夸恩因",
|
||||
"夸恩因的日记",
|
||||
"夸梅",
|
||||
"奇卡",
|
||||
"奇怪的匿叶龙",
|
||||
"奇普",
|
||||
"奇梅",
|
||||
"奇玛",
|
||||
"奇科娅",
|
||||
"奇马利",
|
||||
"奈赫西",
|
||||
"奎兹",
|
||||
"奎泰克",
|
||||
"奎皮亚",
|
||||
"奥伯龙",
|
||||
"奥坎比",
|
||||
"奥奇坎",
|
||||
"奥奇坎的残躯",
|
||||
"奥娅",
|
||||
"奥尔科",
|
||||
"奥希娜",
|
||||
"奥杜力",
|
||||
"奥科兰",
|
||||
"奥罗卢柯",
|
||||
"奥西",
|
||||
"奥贡",
|
||||
"好奇的调查员",
|
||||
"妮乌",
|
||||
"妮佩卡",
|
||||
"妮赫佳",
|
||||
"威严的低语",
|
||||
"娅特兰",
|
||||
"娜恩希",
|
||||
"娜玛卡",
|
||||
"子澄",
|
||||
"字迹模糊的笔记",
|
||||
"孟尼力克",
|
||||
"安切塔",
|
||||
"安萨鲁",
|
||||
"安蒂妮",
|
||||
"家长般的大嵴锋龙",
|
||||
"容韦勒",
|
||||
"对话群演",
|
||||
"小孩的笔记",
|
||||
"小家伙?",
|
||||
"小小蜜虫",
|
||||
"尤季娜",
|
||||
"尤庇娅",
|
||||
"尤考姆",
|
||||
"尼南",
|
||||
"尼尼",
|
||||
"尼赞贝",
|
||||
"山王",
|
||||
"嵴锋龙",
|
||||
"嵴锋龙DJ",
|
||||
"嵴锋龙斗舞女1",
|
||||
"嵴锋龙斗舞女2",
|
||||
"嵴锋龙斗舞男1",
|
||||
"嵴锋龙斗舞男2",
|
||||
"巡山客的手记",
|
||||
"工匠的笔记·其一",
|
||||
"工匠的笔记·其二",
|
||||
"巴亚吉达",
|
||||
"巴克",
|
||||
"巴加约",
|
||||
"巴哈蒂",
|
||||
"巴拉诺夫",
|
||||
"巴茨",
|
||||
"布基纳",
|
||||
"布尔莎",
|
||||
"布纳马",
|
||||
"布鲁",
|
||||
"希乌休",
|
||||
"希亚赫",
|
||||
"希伊亚",
|
||||
"希巴拉克",
|
||||
"希库埃鲁",
|
||||
"希皮利",
|
||||
"希诺宁",
|
||||
"帕兰",
|
||||
"帕加尔",
|
||||
"帕卡·努伊",
|
||||
"帕尼娅",
|
||||
"帕恰",
|
||||
"帕朗",
|
||||
"帕莉西娅",
|
||||
"帕贾丹",
|
||||
"年轻的行商",
|
||||
"年长的行商",
|
||||
"幻写灵",
|
||||
"幼光",
|
||||
"幼小的匿叶龙",
|
||||
"幼嵴锋龙",
|
||||
"幼年的暝视龙",
|
||||
"庇兰",
|
||||
"库伊米",
|
||||
"库基亚",
|
||||
"库娅",
|
||||
"库希马纳",
|
||||
"库延",
|
||||
"库拉霍",
|
||||
"库斯可",
|
||||
"库特比",
|
||||
"库珀·努伊",
|
||||
"库约尼",
|
||||
"库纳克",
|
||||
"库西",
|
||||
"库阿勒",
|
||||
"库马约",
|
||||
"庞塞",
|
||||
"废弃-奇玛",
|
||||
"废弃-希乌休",
|
||||
"废弃-曼扎那",
|
||||
"废弃-森塔加",
|
||||
"废弃-阿乌伊娅",
|
||||
"废弃-马察特利",
|
||||
"延古",
|
||||
"延塔莎",
|
||||
"延索",
|
||||
"待物3带背包",
|
||||
"待物3带背包 深肤色",
|
||||
"德乌特",
|
||||
"德乌特(灵)",
|
||||
"忧愁的绒翼龙",
|
||||
"怪物2带背包",
|
||||
"怪物2带背包 深肤色",
|
||||
"怪物带背包",
|
||||
"怪物带背包 深肤色",
|
||||
"怯生生的小匿叶龙",
|
||||
"恩加韦",
|
||||
"恩古迪",
|
||||
"恩孔加",
|
||||
"恩托提亚",
|
||||
"恩琳",
|
||||
"恰斯卡",
|
||||
"悠然的「花羽会」战士",
|
||||
"愤怒的贩龙者",
|
||||
"懒懒的鳍游龙",
|
||||
"戈利科夫",
|
||||
"战场情报",
|
||||
"扎安娅",
|
||||
"托奥",
|
||||
"托尔特克",
|
||||
"托托",
|
||||
"托扬娜",
|
||||
"托泰克",
|
||||
"托赞",
|
||||
"托赫兰妮",
|
||||
"拉坎阿",
|
||||
"拉密萨纳",
|
||||
"拉斯塔恩",
|
||||
"拉曼",
|
||||
"拉比娜",
|
||||
"拉马奈",
|
||||
"挑战起点",
|
||||
"振尘",
|
||||
"提佐科",
|
||||
"提凯伊",
|
||||
"提帕诺",
|
||||
"提莉乌娅",
|
||||
"搭建帐篷",
|
||||
"摩亚瓦",
|
||||
"放置「古名」",
|
||||
"斯塔杜欣",
|
||||
"斯普赫",
|
||||
"无名工匠的笔记",
|
||||
"无名旅人的笔记·其一",
|
||||
"无名旅人的笔记·其三",
|
||||
"无名旅人的笔记·其二",
|
||||
"无名旅人的笔记·其五",
|
||||
"无名旅人的笔记·其四",
|
||||
"无名祭司的笔记",
|
||||
"昆纳乌",
|
||||
"晕倒的匿叶龙",
|
||||
"晕倒的鳍游龙",
|
||||
"普玛",
|
||||
"普玛莉",
|
||||
"暝视龙",
|
||||
"暴躁的部族战士",
|
||||
"更换衣服",
|
||||
"曼尤雅",
|
||||
"曼扎那",
|
||||
"曼科",
|
||||
"曼萨",
|
||||
"最佳飞行成绩记录",
|
||||
"朗戈",
|
||||
"木箱",
|
||||
"未完成的乐稿",
|
||||
"朱南",
|
||||
"机灵的小嵴锋龙",
|
||||
"来自过去的声音",
|
||||
"松伽塔",
|
||||
"某人留下的铭记·其一",
|
||||
"某人留下的铭记·其三",
|
||||
"某人留下的铭记·其二",
|
||||
"某人留下的铭记·其五",
|
||||
"某人留下的铭记·其四",
|
||||
"某人遗落的风镜",
|
||||
"柯奇妲",
|
||||
"柯娅",
|
||||
"柯林伍德",
|
||||
"柯梯米",
|
||||
"树上的小嵴锋龙",
|
||||
"栖木普",
|
||||
"格罗贝尔",
|
||||
"格茜妮",
|
||||
"格里斯潘",
|
||||
"桑哈杰",
|
||||
"桑科约克",
|
||||
"梅兹莉",
|
||||
"梅内娅",
|
||||
"梅莎",
|
||||
"梅西娜",
|
||||
"森塔加",
|
||||
"森珀娅",
|
||||
"樋口铁矢",
|
||||
"欣赏景色",
|
||||
"欧洛伦",
|
||||
"欧莎薇",
|
||||
"残破的石碑",
|
||||
"比于什",
|
||||
"比奇津",
|
||||
"比赛公告板",
|
||||
"比赛选手",
|
||||
"毛球",
|
||||
"水豚",
|
||||
"汉佩克",
|
||||
"汉扎",
|
||||
"沃蕾",
|
||||
"波卡",
|
||||
"波吉吉",
|
||||
"波奇奇",
|
||||
"波尼尼",
|
||||
"波蒂莉",
|
||||
"波蒂薇",
|
||||
"泽伊拉",
|
||||
"洛娅",
|
||||
"活泼的绵驮兽",
|
||||
"活跃的小嵴锋龙",
|
||||
"海兹尔",
|
||||
"海岳",
|
||||
"涅兰",
|
||||
"涅提",
|
||||
"游学者的笔记",
|
||||
"潘帕",
|
||||
"灵体真女儿",
|
||||
"爱可",
|
||||
"爱梅拉",
|
||||
"爱维莉",
|
||||
"爱菲拉",
|
||||
"爱雅",
|
||||
"特佐佐",
|
||||
"特佩潘",
|
||||
"特帕切",
|
||||
"特帕尔",
|
||||
"特拉佐莉",
|
||||
"特拉佐莉(表演用克隆人)",
|
||||
"特拉帕尔",
|
||||
"特拉忒",
|
||||
"特拉波",
|
||||
"特拉科",
|
||||
"特沃德罗斯",
|
||||
"特波兹",
|
||||
"特立尼达",
|
||||
"特纳华",
|
||||
"特蒂赫莉",
|
||||
"特诺切",
|
||||
"特阿墨",
|
||||
"特阿尤",
|
||||
"特马乔",
|
||||
"狄雷",
|
||||
"献上供物",
|
||||
"玛亚薇",
|
||||
"玛伊蕾",
|
||||
"玛兹嘉",
|
||||
"玛拉妮",
|
||||
"玛薇卡",
|
||||
"玻娜",
|
||||
"琪丝佩",
|
||||
"琪希可",
|
||||
"瓦伊妲",
|
||||
"瓦伊纳",
|
||||
"瓦兰卡",
|
||||
"瓦凯·努伊",
|
||||
"瓦卡尔",
|
||||
"瓦图妲",
|
||||
"瓦尔米",
|
||||
"瓦托娅",
|
||||
"瓦斯卡尔",
|
||||
"瓦曼",
|
||||
"瓦蕾",
|
||||
"瓦达娜",
|
||||
"界碑上的刻文",
|
||||
"疑惑的调查员",
|
||||
"疲惫的暝视龙",
|
||||
"白浜",
|
||||
"皮尔钦",
|
||||
"皮希加",
|
||||
"皮萨克",
|
||||
"看向仪式台",
|
||||
"研究中心紧急机械操作手册",
|
||||
"磨损的记录",
|
||||
"秋纽奥",
|
||||
"科优尔",
|
||||
"科奥劳",
|
||||
"科奴拉芙",
|
||||
"科帕",
|
||||
"科斯特利茨基",
|
||||
"科潘",
|
||||
"科科庞",
|
||||
"科米娜",
|
||||
"科约帕",
|
||||
"科莫奎",
|
||||
"秘源哨机",
|
||||
"穆伊萨",
|
||||
"穆基",
|
||||
"穆尔科",
|
||||
"穆托塔",
|
||||
"穆纳伊",
|
||||
"穆蒲",
|
||||
"竖立在旁的木牌",
|
||||
"等待…",
|
||||
"米卢·努伊",
|
||||
"米奎克",
|
||||
"米特尔",
|
||||
"米齐卡",
|
||||
"索尔涅夫",
|
||||
"索莉马娜",
|
||||
"约洛特莉",
|
||||
"练习钻地的小嵴锋龙",
|
||||
"细心的匿叶龙",
|
||||
"绒翼龙",
|
||||
"绒翼龙幼龙",
|
||||
"维兰德",
|
||||
"维图索夫",
|
||||
"维护记录·其一",
|
||||
"维护记录·其三",
|
||||
"维护记录·其二",
|
||||
"维查玛",
|
||||
"维莎",
|
||||
"羊驼",
|
||||
"群演1",
|
||||
"老鼠",
|
||||
"耶里门",
|
||||
"胆小的绵驮兽",
|
||||
"胡妮",
|
||||
"胡里约",
|
||||
"自称「山下」之物",
|
||||
"艾库瓦",
|
||||
"苏娅",
|
||||
"苏玛克",
|
||||
"若娜瓦",
|
||||
"茜特菈莉",
|
||||
"荆和",
|
||||
"莉乌娅",
|
||||
"莉洛娅",
|
||||
"莉琉",
|
||||
"莉瓦",
|
||||
"莉莉尤",
|
||||
"莎乌莎",
|
||||
"莎娜",
|
||||
"莎维娅",
|
||||
"莎迪蕾",
|
||||
"莫乌",
|
||||
"菲欣妮",
|
||||
"菲耶蒂娜",
|
||||
"萨加图拉",
|
||||
"萨卡乌",
|
||||
"萨科巴",
|
||||
"萨约尔",
|
||||
"萨费伊",
|
||||
"葵可",
|
||||
"葵莉娅",
|
||||
"蒂亚戈",
|
||||
"蒂图",
|
||||
"蒂尔妲",
|
||||
"蒂索克",
|
||||
"蓬普",
|
||||
"薇尔恰",
|
||||
"虚弱的声音",
|
||||
"虚弱的大灵显化身",
|
||||
"虚弱的绒翼龙",
|
||||
"虚弱的膨膨兽",
|
||||
"被困的匿叶龙",
|
||||
"被困的嵴锋龙",
|
||||
"被困的幼暝视龙",
|
||||
"被救出的匿叶龙",
|
||||
"被救的鳍游龙",
|
||||
"装饰花车",
|
||||
"西坎",
|
||||
"西布",
|
||||
"西帕克",
|
||||
"西蒂娜",
|
||||
"西薇",
|
||||
"观察护身符",
|
||||
"观察武器",
|
||||
"观察罐子",
|
||||
"观察腰带",
|
||||
"观察钓具",
|
||||
"警示者的记录",
|
||||
"记录用秘源哨机",
|
||||
"谁人的手记",
|
||||
"调查用投喂点",
|
||||
"谜画涂鸦中的意志",
|
||||
"谨慎的调查员",
|
||||
"贝坎",
|
||||
"贝雷哈努",
|
||||
"贤龙",
|
||||
"贪吃的绵驮兽",
|
||||
"赫伯德",
|
||||
"赫瓦特莉",
|
||||
"辛佳",
|
||||
"辛奇",
|
||||
"达伊妲",
|
||||
"达尔戈",
|
||||
"达布亚",
|
||||
"达祖玛",
|
||||
"进行比赛",
|
||||
"迷惑的调查员",
|
||||
"迷灰中的石碑·其一",
|
||||
"迷灰中的石碑·其三",
|
||||
"迷灰中的石碑·其二",
|
||||
"通皮斯",
|
||||
"醒目的标语",
|
||||
"钦特利",
|
||||
"闪亮亮的贝壳",
|
||||
"阿乌伊娅",
|
||||
"阿乌琪",
|
||||
"阿乔",
|
||||
"阿伽娅",
|
||||
"阿凯蒂",
|
||||
"阿卡坦加",
|
||||
"阿卡马",
|
||||
"阿图科",
|
||||
"阿坎蒂",
|
||||
"阿基约",
|
||||
"阿奇亚库",
|
||||
"阿妮拉",
|
||||
"阿姆鲁",
|
||||
"阿孔",
|
||||
"阿尔妲",
|
||||
"阿尔帕",
|
||||
"阿尤",
|
||||
"阿布帕隆",
|
||||
"阿希莉",
|
||||
"阿斯基娅",
|
||||
"阿斯麦隆",
|
||||
"阿格莫",
|
||||
"阿梅妲",
|
||||
"阿特琪",
|
||||
"阿科米蒂",
|
||||
"阿米娜",
|
||||
"阿纳",
|
||||
"阿蕾梅",
|
||||
"阿达玛",
|
||||
"阿邦迪",
|
||||
"阿隆",
|
||||
"阿霍伊图",
|
||||
"阿马佐利",
|
||||
"阿鲁吉",
|
||||
"陀罗诘利",
|
||||
"陀达罗",
|
||||
"难过的嵴锋龙",
|
||||
"雅库普",
|
||||
"雅蕾希",
|
||||
"雅诺斯基",
|
||||
"雇主",
|
||||
"雷格巴",
|
||||
"霍图鲁",
|
||||
"霍娅",
|
||||
"霍莱",
|
||||
"韦尼埃米诺夫",
|
||||
"顾客",
|
||||
"马伊塔",
|
||||
"马兹拉",
|
||||
"马凯莫",
|
||||
"马努阿",
|
||||
"马塔伽",
|
||||
"马塔伽!记得!!",
|
||||
"马塔拉",
|
||||
"马察特利",
|
||||
"马尼菲科",
|
||||
"马扎坦",
|
||||
"马提库伊",
|
||||
"马洛考",
|
||||
"马特兰",
|
||||
"马穆勒",
|
||||
"马蒂亚斯",
|
||||
"马西娜·努伊",
|
||||
"马陶霍",
|
||||
"驻扎日记",
|
||||
"验收与维修记录",
|
||||
"鳍游龙",
|
||||
"鳍游龙夏威夷吉他",
|
||||
"鳍游龙尤克里里",
|
||||
"鳍游龙木吉他",
|
||||
"鳍游龙箱鼓",
|
||||
"麦斯欧德",
|
||||
"黛希特莉",
|
||||
"龙铭刻",
|
||||
"(翻找箱子…)",
|
||||
"亡国的美奈姬·卷五",
|
||||
"少女薇拉的忧郁·卷一",
|
||||
"少女薇拉的忧郁·卷二",
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# 启动参数说明
|
||||
|
||||
启动参数本质是 Unity 独立平台播放器命令行参数 ,测试下来有用的参数大概如下:
|
||||
|
||||
- `-window-mode exclusive` 参数
|
||||
- **独占全屏**,即选择游戏进程以独占全屏模式运行
|
||||
- **该功能与游戏内浏览器功能不兼容,你应仅在能独立描述独占全屏的技术原理和效果的情况下开启本项**
|
||||
- `-screen-fullscreen` 参数
|
||||
- **全屏**,即选择启动游戏后的游戏界面是否设置为全屏
|
||||
- `-popupwindow` 参数
|
||||
- **无边框**,即选择启动游戏后的游戏界面是否设置为无边框窗口
|
||||
- `-platform_type CLOUD_THIRD_PARTY_MOBILE` 参数
|
||||
- **触摸屏模式**,即启用原神内置的触摸屏操作模式(键鼠输入将被忽略)
|
||||
- 分辨率
|
||||
- 该功能可以快速设置下方的覆盖屏幕宽度和高度选项,有一些常见的预设项可供选择
|
||||
- `-screen-width` 参数
|
||||
- **宽度**,即选择启动游戏后的游戏界面的宽度,例如 `1920`
|
||||
- `-screen-height` 参数
|
||||
- **高度**,即选择启动游戏后的游戏界面的高度,例如 `1080`
|
||||
- `-monitor` 参数
|
||||
- **显示器**,允许多显示器用户选择指定的显示器来运行游戏
|
||||
|
After Width: | Height: | Size: 117 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 229 KiB |
@@ -1,148 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
|
||||
<AssemblyName>BetterGI</AssemblyName>
|
||||
<AssemblyVersion>0.36.2</AssemblyVersion>
|
||||
<Platforms>x64</Platforms>
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\Images\*.jpg" />
|
||||
<None Remove="Assets\Images\*" />
|
||||
<None Remove="Assets\Images\*.png" />
|
||||
<None Remove="Assets\Images\*.ico" />
|
||||
<None Remove="Assets\Fonts\*.ttf" />
|
||||
<None Remove="Assets\Highlighting\*.xshd" />
|
||||
<None Remove="Assets\Strings\*.html" />
|
||||
<None Remove="Assets\Strings\*.md" />
|
||||
<None Remove="Assets\Audios\*.mp3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Assets\Images\*.jpg" />
|
||||
<Resource Include="Assets\Images\Anniversary\*" />
|
||||
<Resource Include="Assets\Images\*.png" />
|
||||
<Resource Include="Assets\Images\*.ico" />
|
||||
<Resource Include="Assets\Fonts\*.ttf" />
|
||||
<Resource Include="Assets\Highlighting\*.xshd" />
|
||||
<Resource Include="Assets\Strings\*.html" />
|
||||
<Resource Include="Assets\Strings\*.md" />
|
||||
<Resource Include="Assets\Audios\*.mp3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.18.1" />
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.18.1" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
|
||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
||||
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="OpenCvSharp4.Windows" Version="4.8.0.20230708" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.122" />
|
||||
<PackageReference Include="Microsoft.ClearScript.V8" Version="7.4.5" />
|
||||
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
|
||||
<PackageReference Include="MouseKeyHook" Version="5.7.1" />
|
||||
<PackageReference Include="PresentMonFps" Version="2.0.5" />
|
||||
<PackageReference Include="Sdcb.PaddleInference" Version="2.5.0.1" />
|
||||
<PackageReference Include="Sdcb.PaddleInference.runtime.win64.openblas" Version="2.5.1" />
|
||||
<PackageReference Include="Sdcb.PaddleOCR" Version="2.7.0" />
|
||||
<PackageReference Include="Sdcb.PaddleOCR.Models.Online" Version="2.7.0.1" />
|
||||
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.103" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.RichTextBoxEx.Wpf" Version="1.1.0.1" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
|
||||
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.0.2" />
|
||||
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
|
||||
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
|
||||
<PackageReference Include="WPF-UI" Version="3.0.5" />
|
||||
<PackageReference Include="WPF-UI.Tray" Version="3.0.5" />
|
||||
<PackageReference Include="WPF-UI.Violeta" Version="3.0.5.23" />
|
||||
<PackageReference Include="YoloV8" Version="4.1.7" />
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug'">
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Fischless.GameCapture\Fischless.GameCapture.csproj" />
|
||||
<ProjectReference Include="..\Fischless.HotkeyCapture\Fischless.HotkeyCapture.csproj" />
|
||||
<ProjectReference Include="..\Fischless.WindowsInput\Fischless.WindowsInput.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Assets\Map\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Assets\Model\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoFight\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoFight\Assets\combat_avatar.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoFishing\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoGeniusInvokation\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoGeniusInvokation\Assets\tcg_character_card.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoPick\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoSkip\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoSkip\Assets\hangout.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoTrackPath\Assets\tp.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\Common\Element\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoWood\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\GameLoading\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\QuickTeleport\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\QuickSereniteaPot\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="User\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="GameTask\Common\Element\Assets\新文件夹\" />
|
||||
<Folder Include="GameTask\OneDragon\" />
|
||||
<Folder Include="User\AutoPathing\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -8,51 +8,40 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
|
||||
<AssemblyName>BetterGI</AssemblyName>
|
||||
<AssemblyVersion>0.43.2</AssemblyVersion>
|
||||
<AssemblyVersion>0.34.4</AssemblyVersion>
|
||||
<Platforms>x64</Platforms>
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\Images\*.jpg" />
|
||||
<None Remove="Assets\Images\*" />
|
||||
<None Remove="Assets\Images\*.png" />
|
||||
<None Remove="Assets\Images\*.ico" />
|
||||
<None Remove="Assets\*.jpg" />
|
||||
<None Remove="Assets\*.png" />
|
||||
<None Remove="Assets\*.ico" />
|
||||
<None Remove="Assets\Fonts\*.ttf" />
|
||||
<None Remove="Assets\Highlighting\*.xshd" />
|
||||
<None Remove="Assets\Strings\*.html" />
|
||||
<None Remove="Assets\Strings\*.md" />
|
||||
<None Remove="Assets\Audios\*.mp3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Assets\Images\*.jpg" />
|
||||
<Resource Include="Assets\Images\Anniversary\*" />
|
||||
<Resource Include="Assets\Images\*.png" />
|
||||
<Resource Include="Assets\Images\*.ico" />
|
||||
<Resource Include="Assets\*.jpg" />
|
||||
<Resource Include="Assets\*.png" />
|
||||
<Resource Include="Assets\*.ico" />
|
||||
<Resource Include="Assets\Fonts\*.ttf" />
|
||||
<Resource Include="Assets\Highlighting\*.xshd" />
|
||||
<Resource Include="Assets\Strings\*.html" />
|
||||
<Resource Include="Assets\Strings\*.md" />
|
||||
<Resource Include="Assets\Audios\*.mp3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
|
||||
<PackageReference Include="BehaviourTree" Version="1.0.73" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="DeviceId" Version="6.8.0" />
|
||||
<PackageReference Include="DeviceId.Windows" Version="6.8.0" />
|
||||
<PackageReference Include="DeviceId.Windows.Wmi" Version="6.8.0" />
|
||||
<PackageReference Include="Emoji.Wpf" Version="0.3.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.18.1" />
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.18.1" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
|
||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
||||
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.8.0.20230708" />
|
||||
@@ -67,18 +56,15 @@
|
||||
<PackageReference Include="Sdcb.PaddleInference.runtime.win64.openblas" Version="2.5.1" />
|
||||
<PackageReference Include="Sdcb.PaddleOCR" Version="2.7.0" />
|
||||
<PackageReference Include="Sdcb.PaddleOCR.Models.Online" Version="2.7.0.1" />
|
||||
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.103" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.RichTextBoxEx.Wpf" Version="1.1.0.1" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
|
||||
<PackageReference Include="Vanara.PInvoke.NtDll" Version="4.0.2" />
|
||||
<PackageReference Include="Vanara.PInvoke.SHCore" Version="4.0.2" />
|
||||
<PackageReference Include="Vanara.PInvoke.User32" Version="4.0.2" />
|
||||
<PackageReference Include="WPF-UI" Version="4.0.0" />
|
||||
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.0" />
|
||||
<PackageReference Include="WPF-UI.Tray" Version="4.0.0" />
|
||||
<PackageReference Include="WPF-UI.Violeta" Version="4.0.0" />
|
||||
<PackageReference Include="WPF-UI" Version="3.0.5" />
|
||||
<PackageReference Include="WPF-UI.Tray" Version="3.0.5" />
|
||||
<PackageReference Include="WPF-UI.Violeta" Version="3.0.5.12" />
|
||||
<PackageReference Include="YoloV8" Version="4.1.7" />
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
|
||||
</ItemGroup>
|
||||
@@ -129,15 +115,9 @@
|
||||
<None Update="GameTask\Common\Element\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\Common\Element\Assets\Json\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoWood\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\AutoMusicGame\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="GameTask\GameLoading\Assets\1920x1080\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -150,27 +130,18 @@
|
||||
<None Update="User\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Script\**">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="GameTask\Model\Enum\" />
|
||||
<Folder Include="GameTask\OneDragon\" />
|
||||
<Folder Include="Service\Notification\Builder\" />
|
||||
<Folder Include="User\AutoPathing\" />
|
||||
<Folder Include="Script\JustTp\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="View\Windows\WelcomeDialog.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<XamlRuntime>Wpf</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="View\Windows\WelcomeDialog.xaml.cs">
|
||||
<Compile Update="View\Pages\MapPathingPage.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>WelcomeDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -7,17 +7,13 @@ using BetterGenshinImpact.GameTask.AutoGeniusInvokation;
|
||||
using BetterGenshinImpact.GameTask.AutoPick;
|
||||
using BetterGenshinImpact.GameTask.AutoSkip;
|
||||
using BetterGenshinImpact.GameTask.AutoWood;
|
||||
using BetterGenshinImpact.GameTask.AutoMusicGame;
|
||||
using BetterGenshinImpact.GameTask.QuickTeleport;
|
||||
using BetterGenshinImpact.Service.Notification;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Fischless.GameCapture;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.AutoTrackPath;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
@@ -51,19 +47,13 @@ public partial class AllConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private int _triggerInterval = 50;
|
||||
|
||||
// /// <summary>
|
||||
// /// WGC使用位图缓存
|
||||
// /// 高帧率情况下,可能会导致卡顿
|
||||
// /// 云原神可能会出现黑屏
|
||||
// /// </summary>
|
||||
// [ObservableProperty]
|
||||
// private bool _wgcUseBitmapCache = true;
|
||||
|
||||
/// <summary>
|
||||
/// 自动修复Win11下BitBlt截图方式不可用的问题
|
||||
/// WGC使用位图缓存
|
||||
/// 高帧率情况下,可能会导致卡顿
|
||||
/// 云原神可能会出现黑屏
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _autoFixWin11BitBlt = true;
|
||||
private bool _wgcUseBitmapCache = true;
|
||||
|
||||
/// <summary>
|
||||
/// 推理使用的设备
|
||||
@@ -71,15 +61,6 @@ public partial class AllConfig : ObservableObject
|
||||
[ObservableProperty]
|
||||
private string _inferenceDevice = "CPU";
|
||||
|
||||
[ObservableProperty]
|
||||
private List<ValueTuple<string, int, string, string>> _nextScheduledTask = [];
|
||||
|
||||
/// <summary>
|
||||
/// 一条龙选中使用的配置
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private string _selectedOneDragonFlowConfigName = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 遮罩窗口配置
|
||||
/// </summary>
|
||||
@@ -134,11 +115,6 @@ public partial class AllConfig : ObservableObject
|
||||
/// 自动战斗配置
|
||||
/// </summary>
|
||||
public AutoFightConfig AutoFightConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 自动乐曲配置 - 千音雅集
|
||||
/// </summary>
|
||||
public AutoMusicGameConfig AutoMusicGameConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 自动秘境配置
|
||||
@@ -146,22 +122,12 @@ public partial class AllConfig : ObservableObject
|
||||
public AutoDomainConfig AutoDomainConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 宏配置
|
||||
/// 脚本类配置
|
||||
/// </summary>
|
||||
public MacroConfig MacroConfig { get; set; } = new();
|
||||
|
||||
public RecordConfig RecordConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 脚本配置
|
||||
/// </summary>
|
||||
public ScriptConfig ScriptConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 地图追踪配置
|
||||
/// </summary>
|
||||
public PathingConditionConfig PathingConditionConfig { get; set; } = PathingConditionConfig.Default;
|
||||
|
||||
/// <summary>
|
||||
/// 快捷键配置
|
||||
/// </summary>
|
||||
@@ -172,18 +138,6 @@ public partial class AllConfig : ObservableObject
|
||||
/// </summary>
|
||||
public NotificationConfig NotificationConfig { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 原神按键绑定配置
|
||||
/// </summary>
|
||||
public KeyBindingsConfig KeyBindingsConfig { get; set; } = new();
|
||||
/// <summary>
|
||||
/// 其他配置
|
||||
/// </summary>
|
||||
public OtherConfig OtherConfig { get; set; } = new();
|
||||
/// <summary>
|
||||
/// 传送相关配置
|
||||
/// </summary>
|
||||
public TpConfig TpConfig { get; set; } = new();
|
||||
[JsonIgnore]
|
||||
public Action? OnAnyChangedAction { get; set; }
|
||||
|
||||
@@ -195,7 +149,7 @@ public partial class AllConfig : ObservableObject
|
||||
GenshinStartConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
NotificationConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
NotificationConfig.PropertyChanged += OnNotificationPropertyChanged;
|
||||
KeyBindingsConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
|
||||
AutoPickConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoSkipConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoFishingConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
@@ -206,10 +160,6 @@ public partial class AllConfig : ObservableObject
|
||||
AutoWoodConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoFightConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoDomainConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
AutoMusicGameConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
TpConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
ScriptConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
PathingConditionConfig.PropertyChanged += OnAnyPropertyChanged;
|
||||
}
|
||||
|
||||
public void OnAnyPropertyChanged(object? sender, EventArgs args)
|
||||
@@ -222,4 +172,4 @@ public partial class AllConfig : ObservableObject
|
||||
{
|
||||
NotificationService.Instance().RefreshNotifiers();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Wpf.Ui.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
@@ -28,28 +26,4 @@ public partial class CommonConfig : ObservableObject
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _exitToTray;
|
||||
|
||||
/// <summary>
|
||||
/// 主题
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private WindowBackdropType _currentBackdropType = WindowBackdropType.Mica;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是第一次运行
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _isFirstRun = true;
|
||||
|
||||
/// <summary>
|
||||
/// 这个版本是否运行过
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private string _runForVersion = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 一个设备只运行一次的已运行设备ID列表
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private List<string> _onceHadRunDeviceIdList = new();
|
||||
}
|
||||
@@ -9,11 +9,11 @@ namespace BetterGenshinImpact.Core.Config;
|
||||
[Serializable]
|
||||
public partial class GenshinStartConfig : ObservableObject
|
||||
{
|
||||
// /// <summary>
|
||||
// /// 自动点击月卡
|
||||
// /// </summary>
|
||||
// [ObservableProperty]
|
||||
// private bool _autoClickBlessingOfTheWelkinMoonEnabled;
|
||||
/// <summary>
|
||||
/// 自动点击月卡
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _autoClickBlessingOfTheWelkinMoonEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// 自动进入游戏(开门)
|
||||
@@ -38,10 +38,4 @@ public partial class GenshinStartConfig : ObservableObject
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _linkedStartEnabled = true;
|
||||
|
||||
/// <summary>
|
||||
/// 使用Starward同步记录时间
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _recordGameTimeEnabled = false;
|
||||
}
|
||||
@@ -29,7 +29,12 @@ public class Global
|
||||
|
||||
public static string ScriptPath()
|
||||
{
|
||||
return Absolute("User\\JsScript");
|
||||
return Absolute("Script");
|
||||
}
|
||||
|
||||
public static string ScriptPath(string folderName)
|
||||
{
|
||||
return Path.Combine(Absolute("Script"), folderName);
|
||||
}
|
||||
|
||||
public static string? ReadAllTextIfExist(string relativePath)
|
||||
|
||||
@@ -148,13 +148,6 @@ public partial class HotKeyConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _autoMusicGameHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
|
||||
|
||||
// 活动音游开始/停止
|
||||
[ObservableProperty]
|
||||
private string _autoFishingGameHotkey = "";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _autoFishingGameHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
|
||||
|
||||
// 自动寻路
|
||||
[ObservableProperty]
|
||||
@@ -218,12 +211,7 @@ public partial class HotKeyConfig : ObservableObject
|
||||
|
||||
[ObservableProperty]
|
||||
private string _keyMouseMacroRecordHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
|
||||
// 暂停
|
||||
[ObservableProperty]
|
||||
private string _suspendHotkey = "";
|
||||
|
||||
[ObservableProperty]
|
||||
private string _suspendHotkeyType = HotKeyTypeEnum.KeyboardMonitor.ToString();
|
||||
// 停止任意独立任务
|
||||
[ObservableProperty]
|
||||
private string _cancelTaskHotkey = "";
|
||||
|
||||
@@ -1,970 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using Windows.Networking.PushNotifications;
|
||||
using static Vanara.PInvoke.User32;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 原神按键绑定配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public partial class KeyBindingsConfig:ObservableObject
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用全局按键映射
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private bool _globalKeyMappingEnabled = false;
|
||||
|
||||
#region Actions(操作)
|
||||
|
||||
/// <summary>
|
||||
/// 向前移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _moveForward = KeyId.W;
|
||||
|
||||
/// <summary>
|
||||
/// 向后移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _moveBackward = KeyId.S;
|
||||
|
||||
/// <summary>
|
||||
/// 向左移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _moveLeft = KeyId.A;
|
||||
|
||||
/// <summary>
|
||||
/// 向右移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _moveRight = KeyId.D;
|
||||
|
||||
/// <summary>
|
||||
/// 切换走/跑;特定操作模式下向下移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchToWalkOrRun = KeyId.LeftCtrl;
|
||||
|
||||
/// <summary>
|
||||
/// 普通攻击
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _normalAttack = KeyId.MouseLeftButton;
|
||||
|
||||
/// <summary>
|
||||
/// 元素战技
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _elementalSkill = KeyId.E;
|
||||
|
||||
/// <summary>
|
||||
/// 元素爆发
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _elementalBurst = KeyId.Q;
|
||||
|
||||
/// <summary>
|
||||
/// 冲刺(键盘)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _sprintKeyboard = KeyId.LeftShift;
|
||||
|
||||
/// <summary>
|
||||
/// 冲刺(鼠标)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _sprintMouse = KeyId.MouseRightButton;
|
||||
|
||||
/// <summary>
|
||||
/// 切换瞄准模式
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchAimingMode = KeyId.R;
|
||||
|
||||
/// <summary>
|
||||
/// 跳跃;特定操作模式下向上移动
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _jump = KeyId.Space;
|
||||
|
||||
/// <summary>
|
||||
/// 落下
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _drop = KeyId.X;
|
||||
|
||||
/// <summary>
|
||||
/// 拾取/交互(自动拾取由AutoPick模块管理)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _pickUpOrInteract = KeyId.F;
|
||||
|
||||
/// <summary>
|
||||
/// 快捷使用小道具
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _quickUseGadget = KeyId.Z;
|
||||
|
||||
/// <summary>
|
||||
/// 特定玩法内交互操作
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _interactionInSomeMode = KeyId.T;
|
||||
|
||||
/// <summary>
|
||||
/// 开启任务追踪
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _questNavigation = KeyId.V;
|
||||
|
||||
/// <summary>
|
||||
/// 中断挑战
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _abandonChallenge = KeyId.P;
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色1
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchMember1 = KeyId.D1;
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色2
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchMember2 = KeyId.D2;
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色3
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchMember3 = KeyId.D3;
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色4
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchMember4 = KeyId.D4;
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色5
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _switchMember5 = KeyId.D5;
|
||||
|
||||
/// <summary>
|
||||
/// 呼出快捷轮盘
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _shortcutWheel = KeyId.Tab;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Menus(菜单)
|
||||
|
||||
/// <summary>
|
||||
/// 打开背包
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openInventory = KeyId.B;
|
||||
|
||||
/// <summary>
|
||||
/// 打开角色界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openCharacterScreen = KeyId.C;
|
||||
|
||||
/// <summary>
|
||||
/// 打开地图
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openMap = KeyId.M;
|
||||
|
||||
/// <summary>
|
||||
/// 打开派蒙界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openPaimonMenu = KeyId.Escape;
|
||||
|
||||
/// <summary>
|
||||
/// 打开冒险之证界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openAdventurerHandbook = KeyId.F1;
|
||||
|
||||
/// <summary>
|
||||
/// 打开多人游戏界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openCoOpScreen = KeyId.F2;
|
||||
|
||||
/// <summary>
|
||||
/// 打开祈愿界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openWishScreen = KeyId.F3;
|
||||
|
||||
/// <summary>
|
||||
/// 打开纪行界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openBattlePassScreen = KeyId.F4;
|
||||
|
||||
/// <summary>
|
||||
/// 打开活动面板
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openTheEventsMenu = KeyId.F5;
|
||||
|
||||
/// <summary>
|
||||
/// 打开玩法系统界面(尘歌壶内猫尾酒馆内)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openTheSettingsMenu = KeyId.F6;
|
||||
|
||||
/// <summary>
|
||||
/// 打开摆设界面(尘歌壶内)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openTheFurnishingScreen = KeyId.F7;
|
||||
|
||||
/// <summary>
|
||||
/// 打开星之归还(条件符合期间生效)
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openStellarReunion = KeyId.F8;
|
||||
|
||||
/// <summary>
|
||||
/// 开关任务菜单
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openQuestMenu = KeyId.J;
|
||||
|
||||
/// <summary>
|
||||
/// 打开通知详情
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openNotificationDetails = KeyId.Y;
|
||||
|
||||
/// <summary>
|
||||
/// 打开聊天界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openChatScreen = KeyId.Enter;
|
||||
|
||||
/// <summary>
|
||||
/// 打开特殊环境说明
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openSpecialEnvironmentInformation = KeyId.U;
|
||||
|
||||
/// <summary>
|
||||
/// 查看教程详情
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _checkTutorialDetails = KeyId.G;
|
||||
|
||||
/// <summary>
|
||||
/// 长按打开元素视野
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _elementalSight = KeyId.MouseMiddleButton;
|
||||
|
||||
/// <summary>
|
||||
/// 呼出鼠标
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _showCursor = KeyId.LeftAlt;
|
||||
|
||||
/// <summary>
|
||||
/// 打开队伍配置界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openPartySetupScreen = KeyId.L;
|
||||
|
||||
/// <summary>
|
||||
/// 打开好友界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _openFriendsScreen = KeyId.O;
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏主界面
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
private KeyId _hideUI = KeyId.Slash;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public static class KeyIdConverter
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 将KeyId转换为字符串(可在后续支持多语言),按键名称的显示尽量与原神UI一致
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToName(this KeyId value)
|
||||
{
|
||||
return ToChineseName(value);
|
||||
}
|
||||
|
||||
private static string ToChineseName(KeyId value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
// 需要单独翻译的按键
|
||||
KeyId.None => "<未指定>",
|
||||
KeyId.Unknown => "<未知>",
|
||||
KeyId.MouseLeftButton => "鼠标左键",
|
||||
KeyId.MouseRightButton => "鼠标右键",
|
||||
KeyId.MouseMiddleButton => "鼠标中键",
|
||||
KeyId.MouseSideButton1 => "鼠标侧键1",
|
||||
KeyId.MouseSideButton2 => "鼠标侧键2",
|
||||
KeyId.Apps => "菜单键",
|
||||
// 无需单独翻译的部分
|
||||
_ => EnglishKeyNameToChinese(value),
|
||||
};
|
||||
}
|
||||
|
||||
private static string EnglishKeyNameToChinese(KeyId value)
|
||||
{
|
||||
var engName = ToEnglishName(value);
|
||||
if (engName.StartsWith("Left ") || engName.StartsWith("Right "))
|
||||
{
|
||||
return engName.Replace("Left ", "左").Replace("Right ", "右");
|
||||
}
|
||||
return engName;
|
||||
}
|
||||
|
||||
private static string ToEnglishName(KeyId value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
// 需要转换的部分
|
||||
KeyId.None => "<None>",
|
||||
KeyId.Unknown => "<Unknown>",
|
||||
KeyId.MouseLeftButton => "Mouse LButton",
|
||||
KeyId.MouseRightButton => "Mouse RButton",
|
||||
KeyId.MouseMiddleButton => "Mouse MButton",
|
||||
KeyId.MouseSideButton1 => "Mouse XButton1",
|
||||
KeyId.MouseSideButton2 => "Mouse XButton2",
|
||||
KeyId.Escape => "Esc",
|
||||
KeyId.PageUp => "Page Up",
|
||||
KeyId.PageDown => "Page Down",
|
||||
KeyId.CapsLock => "Caps Lock",
|
||||
KeyId.ScrollLock => "Scroll Lock",
|
||||
KeyId.LeftShift => "Left Shift",
|
||||
KeyId.RightShift => "Right Shift",
|
||||
KeyId.LeftCtrl => "Left Crtl",
|
||||
KeyId.RightCtrl => "Right Ctrl",
|
||||
KeyId.LeftAlt => "Left Alt",
|
||||
KeyId.RightAlt => "Right Alt",
|
||||
KeyId.LeftWin => "Left Win",
|
||||
KeyId.RightWin => "Right Win",
|
||||
KeyId.Apps => "Menu",
|
||||
KeyId.Left => "←",
|
||||
KeyId.Up => "↑",
|
||||
KeyId.Right => "→",
|
||||
KeyId.Down => "↓",
|
||||
KeyId.D0 => "0",
|
||||
KeyId.D1 => "1",
|
||||
KeyId.D2 => "2",
|
||||
KeyId.D3 => "3",
|
||||
KeyId.D4 => "4",
|
||||
KeyId.D5 => "5",
|
||||
KeyId.D6 => "6",
|
||||
KeyId.D7 => "7",
|
||||
KeyId.D8 => "8",
|
||||
KeyId.D9 => "9",
|
||||
KeyId.Apostrophe => "'",
|
||||
KeyId.Comma => ",",
|
||||
KeyId.Minus => "-",
|
||||
KeyId.Equal => "=",
|
||||
KeyId.Period => ".",
|
||||
KeyId.Slash => "/",
|
||||
KeyId.Backslash => @"\",
|
||||
KeyId.Semicolon => ";",
|
||||
KeyId.LeftSquareBracket => "[",
|
||||
KeyId.RightSquareBracket => "]",
|
||||
KeyId.Tilde => "`",
|
||||
KeyId.NumLock => "Num Lock",
|
||||
KeyId.NumPad0 => "Num 0",
|
||||
KeyId.NumPad1 => "Num 1",
|
||||
KeyId.NumPad2 => "Num 2",
|
||||
KeyId.NumPad3 => "Num 3",
|
||||
KeyId.NumPad4 => "Num 4",
|
||||
KeyId.NumPad5 => "Num 5",
|
||||
KeyId.NumPad6 => "Num 6",
|
||||
KeyId.NumPad7 => "Num 7",
|
||||
KeyId.NumPad8 => "Num 8",
|
||||
KeyId.NumPad9 => "Num 9",
|
||||
KeyId.Decimal => "Num .",
|
||||
KeyId.Divide => "Num /",
|
||||
KeyId.Multiply => "Num *",
|
||||
KeyId.Subtract => "Num -",
|
||||
KeyId.Add => "Num +",
|
||||
KeyId.NumEnter => "Num Enter",
|
||||
// 默认使用枚举名
|
||||
_ => value.ToString(),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将KeyId转换为VK
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static VK ToVK(this KeyId value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
// 这两个值在VK中没有,抛异常
|
||||
KeyId.None => throw new ArgumentOutOfRangeException(nameof(value), "未指定按键,无法转换为VK。"),
|
||||
KeyId.Unknown => throw new ArgumentOutOfRangeException(nameof(value), "未知按键,无法转换为VK。"),
|
||||
// 剩下的值相同,直接转
|
||||
_ => (VK)value,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将KeyId转换为System.Windows.Input.Key
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static Key ToInputKey(this KeyId value)
|
||||
{
|
||||
// 部分按键名称相同,使用名称转换
|
||||
try
|
||||
{
|
||||
return Enum.Parse<Key>(value.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 其他键使用查表法转换
|
||||
return value switch
|
||||
{
|
||||
KeyId.LeftWin => Key.LWin,
|
||||
KeyId.RightWin => Key.RWin,
|
||||
KeyId.Apostrophe => Key.Oem7,
|
||||
KeyId.Comma => Key.OemComma,
|
||||
KeyId.Minus => Key.OemMinus,
|
||||
KeyId.Equal => Key.OemPlus,
|
||||
KeyId.Period => Key.OemPeriod,
|
||||
KeyId.Slash => Key.Oem2,
|
||||
KeyId.Semicolon => Key.Oem1,
|
||||
KeyId.LeftSquareBracket => Key.Oem4,
|
||||
KeyId.Backslash => Key.Oem5,
|
||||
KeyId.RightSquareBracket => Key.Oem6,
|
||||
KeyId.Tilde => Key.Oem3,
|
||||
KeyId.Enter => Key.Enter,
|
||||
KeyId.ScrollLock => Key.Scroll,
|
||||
KeyId.PageUp => Key.Prior,
|
||||
KeyId.PageDown => Key.Next,
|
||||
KeyId.Backspace => Key.Back,
|
||||
KeyId.CapsLock => Key.Capital,
|
||||
// None、Unknown和鼠标按键抛异常
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(value)),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将KeyId转换为MouseButton
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||
public static MouseButton ToMouseButton(this KeyId value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
KeyId.MouseLeftButton => MouseButton.Left,
|
||||
KeyId.MouseRightButton => MouseButton.Right,
|
||||
KeyId.MouseMiddleButton => MouseButton.Middle,
|
||||
KeyId.MouseSideButton1 => MouseButton.XButton1,
|
||||
KeyId.MouseSideButton2 => MouseButton.XButton2,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(value), "键盘按键请使用ToInputKey方法"),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [实验] 将KeyId转换为WinForm中的Keys(用于兼容按键连发功能)
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static Keys ToWinFormKeys(this KeyId value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Enum.Parse<Keys>(value.ToInputKey().ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将VK转换为KeyId
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static KeyId FromVK(VK value)
|
||||
{
|
||||
// 尝试通过VK的值获取KeyId的枚举名。若成功,表示对应的VK在KeyId支持的范围内,直接转换;否则返回Unknown
|
||||
return string.IsNullOrEmpty(Enum.GetName(typeof(KeyId), value)) ? KeyId.Unknown : (KeyId)value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将System.Windows.Input.Key转换为KeyId
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static KeyId FromInputKey(Key value)
|
||||
{
|
||||
// 部分按键名称相同,使用名称转换
|
||||
try
|
||||
{
|
||||
return Enum.Parse<KeyId>(value.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 其他键使用查表法转换
|
||||
return value switch
|
||||
{
|
||||
Key.LWin => KeyId.LeftWin,
|
||||
Key.RWin => KeyId.RightWin,
|
||||
Key.Oem7 => KeyId.Apostrophe,
|
||||
Key.OemComma => KeyId.Comma,
|
||||
Key.OemMinus => KeyId.Minus,
|
||||
Key.OemPlus => KeyId.Equal,
|
||||
Key.OemPeriod => KeyId.Period,
|
||||
Key.Oem2 => KeyId.Slash,
|
||||
Key.Oem1 => KeyId.Semicolon,
|
||||
Key.Oem4 => KeyId.LeftSquareBracket,
|
||||
Key.Oem5 => KeyId.Backslash,
|
||||
Key.Oem6 => KeyId.RightSquareBracket,
|
||||
Key.Oem3 => KeyId.Tilde,
|
||||
Key.Enter => KeyId.Enter,
|
||||
Key.Scroll => KeyId.ScrollLock,
|
||||
Key.Prior => KeyId.PageUp,
|
||||
Key.Next => KeyId.PageDown,
|
||||
Key.Back => KeyId.Backspace,
|
||||
Key.Capital => KeyId.CapsLock,
|
||||
// 支持列表外的值返回Unknown
|
||||
_ => KeyId.Unknown,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将MouseButton转换为KeyId
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static KeyId FromMouseButton(MouseButton value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
MouseButton.Left => KeyId.MouseLeftButton,
|
||||
MouseButton.Right => KeyId.MouseRightButton,
|
||||
MouseButton.Middle => KeyId.MouseMiddleButton,
|
||||
MouseButton.XButton1 => KeyId.MouseSideButton1,
|
||||
MouseButton.XButton2 => KeyId.MouseSideButton2,
|
||||
_ => KeyId.Unknown,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用于与VK/Windows.Input.Key解耦,值与VK对应,但是仅包含美式键盘(104键,不包括媒体控制等)和鼠标中的按键
|
||||
/// </summary>
|
||||
public enum KeyId
|
||||
{
|
||||
/// <summary>无</summary>
|
||||
None = 0x00,
|
||||
|
||||
/// <summary>未知按键</summary>
|
||||
Unknown = 0xFF,
|
||||
|
||||
#region 鼠标按键
|
||||
|
||||
/// <summary>鼠标左键</summary>
|
||||
MouseLeftButton = 0x01,
|
||||
|
||||
/// <summary>鼠标右键</summary>
|
||||
MouseRightButton = 0x02,
|
||||
|
||||
/// <summary>鼠标中键(滚轮)</summary>
|
||||
MouseMiddleButton = 0x04,
|
||||
|
||||
/// <summary>鼠标侧键1(后退)</summary>
|
||||
MouseSideButton1 = 0x05,
|
||||
|
||||
/// <summary>鼠标侧键2(前进)</summary>
|
||||
MouseSideButton2 = 0x06,
|
||||
|
||||
#endregion
|
||||
|
||||
#region F键区
|
||||
|
||||
/// <summary>F1</summary>
|
||||
F1 = 0x70,
|
||||
|
||||
/// <summary>F2</summary>
|
||||
F2 = 0x71,
|
||||
|
||||
/// <summary>F3</summary>
|
||||
F3 = 0x72,
|
||||
|
||||
/// <summary>F4</summary>
|
||||
F4 = 0x73,
|
||||
|
||||
/// <summary>F5</summary>
|
||||
F5 = 0x74,
|
||||
|
||||
/// <summary>F6</summary>
|
||||
F6 = 0x75,
|
||||
|
||||
/// <summary>F7</summary>
|
||||
F7 = 0x76,
|
||||
|
||||
/// <summary>F8</summary>
|
||||
F8 = 0x77,
|
||||
|
||||
/// <summary>F9</summary>
|
||||
F9 = 0x78,
|
||||
|
||||
/// <summary>F10</summary>
|
||||
F10 = 0x79,
|
||||
|
||||
/// <summary>F11</summary>
|
||||
F11 = 0x7A,
|
||||
|
||||
/// <summary>F12</summary>
|
||||
F12 = 0x7B,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 控制&功能键
|
||||
|
||||
/// <summary>Esc</summary>
|
||||
Escape = 0x1B,
|
||||
|
||||
/// <summary>PrintScreen</summary>
|
||||
PrintScreen = 0x2C,
|
||||
|
||||
/// <summary>ScrollLock</summary>
|
||||
ScrollLock = 0x91,
|
||||
|
||||
/// <summary>Pause</summary>
|
||||
Pause = 0x13,
|
||||
|
||||
/// <summary>Insert</summary>
|
||||
Insert = 0x2D,
|
||||
|
||||
/// <summary>Delete</summary>
|
||||
Delete = 0x2E,
|
||||
|
||||
/// <summary>Home</summary>
|
||||
Home = 0x24,
|
||||
|
||||
/// <summary>End</summary>
|
||||
End = 0x23,
|
||||
|
||||
/// <summary>Page Up</summary>
|
||||
PageUp = 0x21,
|
||||
|
||||
/// <summary>Page Down</summary>
|
||||
PageDown = 0x22,
|
||||
|
||||
/// <summary>Backspace退格</summary>
|
||||
Backspace = 0x08,
|
||||
|
||||
/// <summary>Tab</summary>
|
||||
Tab = 0x09,
|
||||
|
||||
/// <summary>Caps Lock大写锁定</summary>
|
||||
CapsLock = 0x14,
|
||||
|
||||
/// <summary>Enter回车</summary>
|
||||
Enter = 0x0D,
|
||||
|
||||
///// <summary>Shift</summary>
|
||||
//Shift = 0x10,
|
||||
|
||||
/// <summary>左Shift</summary>
|
||||
LeftShift = 0xA0,
|
||||
|
||||
/// <summary>右Shift</summary>
|
||||
RightShift = 0xA1,
|
||||
|
||||
///// <summary>Ctrl</summary>
|
||||
//Ctrl = 0x11,
|
||||
|
||||
/// <summary>左Ctrl</summary>
|
||||
LeftCtrl = 0xA2,
|
||||
|
||||
/// <summary>右Ctrl</summary>
|
||||
RightCtrl = 0xA3,
|
||||
|
||||
///// <summary>Alt</summary>
|
||||
//Alt = 0x12,
|
||||
|
||||
/// <summary>左Alt</summary>
|
||||
LeftAlt = 0xA4,
|
||||
|
||||
/// <summary>右Alt</summary>
|
||||
RightAlt = 0xA5,
|
||||
|
||||
/// <summary>左Win键 (Microsoft Natural Keyboard)</summary>
|
||||
LeftWin = 0x5B,
|
||||
|
||||
/// <summary>右Win键 (Microsoft Natural Keyboard)</summary>
|
||||
RightWin = 0x5C,
|
||||
|
||||
/// <summary>菜单键 (Microsoft Natural Keyboard)</summary>
|
||||
Apps = 0x5D,
|
||||
|
||||
/// <summary>Space空格键</summary>
|
||||
Space = 0x20,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 方向键
|
||||
|
||||
/// <summary>方向键 ←</summary>
|
||||
Left = 0x25,
|
||||
|
||||
/// <summary>方向键 ↑</summary>
|
||||
Up = 0x26,
|
||||
|
||||
/// <summary>方向键 →</summary>
|
||||
Right = 0x27,
|
||||
|
||||
/// <summary>方向键 ↓</summary>
|
||||
Down = 0x28,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 字母区 - 字母
|
||||
|
||||
/// <summary>A</summary>
|
||||
A = 0x41,
|
||||
|
||||
/// <summary>B</summary>
|
||||
B = 0x42,
|
||||
|
||||
/// <summary>C</summary>
|
||||
C = 0x43,
|
||||
|
||||
/// <summary>D</summary>
|
||||
D = 0x44,
|
||||
|
||||
/// <summary>E</summary>
|
||||
E = 0x45,
|
||||
|
||||
/// <summary>F</summary>
|
||||
F = 0x46,
|
||||
|
||||
/// <summary>G</summary>
|
||||
G = 0x47,
|
||||
|
||||
/// <summary>H</summary>
|
||||
H = 0x48,
|
||||
|
||||
/// <summary>I</summary>
|
||||
I = 0x49,
|
||||
|
||||
/// <summary>J</summary>
|
||||
J = 0x4A,
|
||||
|
||||
/// <summary>K</summary>
|
||||
K = 0x4B,
|
||||
|
||||
/// <summary>L</summary>
|
||||
L = 0x4C,
|
||||
|
||||
/// <summary>M</summary>
|
||||
M = 0x4D,
|
||||
|
||||
/// <summary>N</summary>
|
||||
N = 0x4E,
|
||||
|
||||
/// <summary>O</summary>
|
||||
O = 0x4F,
|
||||
|
||||
/// <summary>P</summary>
|
||||
P = 0x50,
|
||||
|
||||
/// <summary>Q</summary>
|
||||
Q = 0x51,
|
||||
|
||||
/// <summary>R</summary>
|
||||
R = 0x52,
|
||||
|
||||
/// <summary>S</summary>
|
||||
S = 0x53,
|
||||
|
||||
/// <summary>T</summary>
|
||||
T = 0x54,
|
||||
|
||||
/// <summary>U</summary>
|
||||
U = 0x55,
|
||||
|
||||
/// <summary>V</summary>
|
||||
V = 0x56,
|
||||
|
||||
/// <summary>W</summary>
|
||||
W = 0x57,
|
||||
|
||||
/// <summary>X</summary>
|
||||
X = 0x58,
|
||||
|
||||
/// <summary>Y</summary>
|
||||
Y = 0x59,
|
||||
|
||||
/// <summary>Z</summary>
|
||||
Z = 0x5A,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 字母区 - 数字
|
||||
|
||||
/// <summary>0</summary>
|
||||
D0 = 0x30,
|
||||
|
||||
/// <summary>1</summary>
|
||||
D1 = 0x31,
|
||||
|
||||
/// <summary>2</summary>
|
||||
D2 = 0x32,
|
||||
|
||||
/// <summary>3</summary>
|
||||
D3 = 0x33,
|
||||
|
||||
/// <summary>4</summary>
|
||||
D4 = 0x34,
|
||||
|
||||
/// <summary>5</summary>
|
||||
D5 = 0x35,
|
||||
|
||||
/// <summary>6</summary>
|
||||
D6 = 0x36,
|
||||
|
||||
/// <summary>7</summary>
|
||||
D7 = 0x37,
|
||||
|
||||
/// <summary>8</summary>
|
||||
D8 = 0x38,
|
||||
|
||||
/// <summary>9</summary>
|
||||
D9 = 0x39,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 字母区 - 符号
|
||||
|
||||
/// <summary>引号 '</summary>
|
||||
Apostrophe = 0xDE,
|
||||
|
||||
/// <summary>逗号 ,</summary>
|
||||
Comma = 0xBC,
|
||||
|
||||
/// <summary>连接符 -</summary>
|
||||
Minus = 0xBD,
|
||||
|
||||
/// <summary>等于号 =</summary>
|
||||
Equal = 0xBB,
|
||||
|
||||
/// <summary>句号 .</summary>
|
||||
Period = 0xBE,
|
||||
|
||||
/// <summary>斜杠 /</summary>
|
||||
Slash = 0xBF,
|
||||
|
||||
/// <summary>反斜杠 \</summary>
|
||||
Backslash = 0xE2,
|
||||
|
||||
/// <summary>分号 ;</summary>
|
||||
Semicolon = 0xBA,
|
||||
|
||||
/// <summary>左方括号 [</summary>
|
||||
LeftSquareBracket = 0xDB,
|
||||
|
||||
/// <summary>右方括号 ]</summary>
|
||||
RightSquareBracket = 0xDD,
|
||||
|
||||
/// <summary>波浪号 `</summary>
|
||||
Tilde = 0xC0,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 小键盘区
|
||||
|
||||
/// <summary>Num Lock</summary>
|
||||
NumLock = 0x90,
|
||||
|
||||
/// <summary>Num 0</summary>
|
||||
NumPad0 = 0x60,
|
||||
|
||||
/// <summary>Num 1</summary>
|
||||
NumPad1 = 0x61,
|
||||
|
||||
/// <summary>Num 2</summary>
|
||||
NumPad2 = 0x62,
|
||||
|
||||
/// <summary>Num 3</summary>
|
||||
NumPad3 = 0x63,
|
||||
|
||||
/// <summary>Num 4</summary>
|
||||
NumPad4 = 0x64,
|
||||
|
||||
/// <summary>Num 5</summary>
|
||||
NumPad5 = 0x65,
|
||||
|
||||
/// <summary>Num 6</summary>
|
||||
NumPad6 = 0x66,
|
||||
|
||||
/// <summary>Num 7</summary>
|
||||
NumPad7 = 0x67,
|
||||
|
||||
/// <summary>Num 8</summary>
|
||||
NumPad8 = 0x68,
|
||||
|
||||
/// <summary>Num 9</summary>
|
||||
NumPad9 = 0x69,
|
||||
|
||||
/// <summary>Num .</summary>
|
||||
Decimal = 0x6E,
|
||||
|
||||
/// <summary>Num /</summary>
|
||||
Divide = 0x6F,
|
||||
|
||||
/// <summary>Num *</summary>
|
||||
Multiply = 0x6A,
|
||||
|
||||
/// <summary>Num -</summary>
|
||||
Subtract = 0x6D,
|
||||
|
||||
/// <summary>Num +</summary>
|
||||
Add = 0x6B,
|
||||
|
||||
/// <summary>Num Enter</summary>
|
||||
NumEnter = 0x0E,
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
[Serializable]
|
||||
public partial class OneDragonFlowConfig : ObservableObject
|
||||
{
|
||||
// 配置名
|
||||
[ObservableProperty]
|
||||
private string _name = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 所有任务的开关状态
|
||||
/// </summary>
|
||||
public Dictionary<string, bool> TaskEnabledList { get; set; } = new();
|
||||
|
||||
// 合成树脂的国家
|
||||
[ObservableProperty]
|
||||
private string _craftingBenchCountry = "枫丹";
|
||||
|
||||
// 冒险者协会的国家
|
||||
[ObservableProperty]
|
||||
private string _adventurersGuildCountry = "枫丹";
|
||||
|
||||
// 自动战斗配置的队伍名称
|
||||
[ObservableProperty]
|
||||
private string _partyName = string.Empty;
|
||||
|
||||
// 自动战斗配置的策略名称
|
||||
[ObservableProperty]
|
||||
private string _domainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _weeklyDomainEnabled = false;
|
||||
|
||||
// 领取每日奖励的好感队伍名称
|
||||
[ObservableProperty]
|
||||
private string _dailyRewardPartyName = string.Empty;
|
||||
|
||||
|
||||
#region 每周秘境配置
|
||||
|
||||
[ObservableProperty]
|
||||
private string _mondayThursdayPartyName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _mondayThursdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _tuesdayFridayPartyName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _tuesdayFridayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _wednesdaySaturdayPartyName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _wednesdaySaturdayDomainName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _sundayPartyName = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _sundayDomainName = string.Empty;
|
||||
|
||||
// 完成后操作
|
||||
[ObservableProperty]
|
||||
private string _completionAction = string.Empty;
|
||||
|
||||
// 通过当天是哪一天来返回配置
|
||||
public (string partyName, string domainName) GetDomainConfig()
|
||||
{
|
||||
if (WeeklyDomainEnabled)
|
||||
{
|
||||
var dayOfWeek = DateTime.Now.DayOfWeek;
|
||||
return dayOfWeek switch
|
||||
{
|
||||
DayOfWeek.Monday => (MondayThursdayPartyName, MondayThursdayDomainName),
|
||||
DayOfWeek.Tuesday => (TuesdayFridayPartyName, TuesdayFridayDomainName),
|
||||
DayOfWeek.Wednesday => (WednesdaySaturdayPartyName, WednesdaySaturdayDomainName),
|
||||
DayOfWeek.Thursday => (MondayThursdayPartyName, MondayThursdayDomainName),
|
||||
DayOfWeek.Friday => (TuesdayFridayPartyName, TuesdayFridayDomainName),
|
||||
DayOfWeek.Saturday => (WednesdaySaturdayPartyName, WednesdaySaturdayDomainName),
|
||||
DayOfWeek.Sunday => (SundayPartyName, SundayDomainName),
|
||||
_ => (PartyName, DomainName)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return (PartyName, DomainName);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
|
||||
[Serializable]
|
||||
public partial class OtherConfig : ObservableObject
|
||||
{
|
||||
//调度器任务和部分独立任务,失去焦点,自动激活游戏窗口
|
||||
[ObservableProperty]
|
||||
private bool _restoreFocusOnLostEnabled = false;
|
||||
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Model;
|
||||
using BetterGenshinImpact.Model;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
[Serializable]
|
||||
public partial class PathingConditionConfig : ObservableObject
|
||||
{
|
||||
// 地图追踪条件配置
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<Condition> _partyConditions = [];
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<Condition> _avatarConditions = [];
|
||||
|
||||
// 只在传送传送点时复活
|
||||
[ObservableProperty]
|
||||
private bool _onlyInTeleportRecover = false;
|
||||
|
||||
// 使用小道具的间隔时间(ms)
|
||||
[ObservableProperty]
|
||||
private int _useGadgetIntervalMs = 0;
|
||||
|
||||
public static PathingConditionConfig Default => new()
|
||||
{
|
||||
AvatarConditions =
|
||||
[
|
||||
new Condition
|
||||
{
|
||||
Subject = "队伍中角色",
|
||||
Object = ["绮良良", "莱依拉", "茜特菈莉", "芭芭拉", "七七"],
|
||||
Result = "循环短E"
|
||||
},
|
||||
|
||||
new Condition
|
||||
{
|
||||
Subject = "队伍中角色",
|
||||
Object = ["钟离"],
|
||||
Result = "循环长E"
|
||||
},
|
||||
|
||||
new Condition
|
||||
{
|
||||
Subject = "队伍中角色",
|
||||
Object = ["迪希雅"],
|
||||
Result = "作为主要行走角色"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 找出当前应该切换的队伍名称
|
||||
/// </summary>
|
||||
/// <param name="materialName">采集物名称</param>
|
||||
/// <param name="specialActions">特殊动作</param>
|
||||
/// <returns></returns>
|
||||
public string? FilterPartyName(string? materialName, List<string?> specialActions)
|
||||
{
|
||||
if (specialActions is { Count: > 0 })
|
||||
{
|
||||
// 特殊动作匹配队伍名
|
||||
foreach (var action in specialActions)
|
||||
{
|
||||
if (string.IsNullOrEmpty(action))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ConditionDefinitions.ActionCnDic.TryGetValue(action, out var actionCn))
|
||||
{
|
||||
continue; // 不校验
|
||||
}
|
||||
|
||||
var condition = PartyConditions.FirstOrDefault(c => c.Subject == "动作" && c.Object.Contains(actionCn));
|
||||
if (condition is { Result: not null })
|
||||
{
|
||||
return condition.Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 采集物匹配队伍名
|
||||
Condition? materialCondition = null;
|
||||
if (!string.IsNullOrEmpty(materialName))
|
||||
{
|
||||
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains(materialName));
|
||||
}
|
||||
if (materialCondition is { Result: not null })
|
||||
{
|
||||
return materialCondition.Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
materialCondition = PartyConditions.FirstOrDefault(c => c.Subject == "采集物" && c.Object.Contains("全部"));
|
||||
if (materialCondition is { Result: not null })
|
||||
{
|
||||
return materialCondition.Result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过条件配置生成队伍配置
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PathingPartyConfig BuildPartyConfigByCondition(CombatScenes combatScenes)
|
||||
{
|
||||
PathingPartyConfig partyConfig = PathingPartyConfig.BuildDefault();
|
||||
// 使用最优先匹配上的条件
|
||||
foreach (var avatarCondition in AvatarConditions)
|
||||
{
|
||||
if (avatarCondition.Result == "循环短E" || avatarCondition.Result == "循环长E")
|
||||
{
|
||||
foreach (var avatar in combatScenes.Avatars)
|
||||
{
|
||||
if (avatarCondition is { Object: not null } && avatarCondition.Object.Contains(avatar.Name))
|
||||
{
|
||||
partyConfig.GuardianAvatarIndex = avatar.Index.ToString();
|
||||
if (avatarCondition.Result == "循环长E")
|
||||
{
|
||||
partyConfig.GuardianElementalSkillLongPress = true;
|
||||
partyConfig.GuardianElementalSkillSecondInterval = avatar.SkillHoldCd.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
partyConfig.GuardianElementalSkillLongPress = false;
|
||||
partyConfig.GuardianElementalSkillSecondInterval = avatar.SkillCd.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(partyConfig.GuardianAvatarIndex))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var avatarCondition in AvatarConditions)
|
||||
{
|
||||
if (avatarCondition.Result == "作为主要行走角色")
|
||||
{
|
||||
foreach (var avatar in combatScenes.Avatars)
|
||||
{
|
||||
if (avatarCondition is { Object: not null } && avatarCondition.Object.Contains(avatar.Name))
|
||||
{
|
||||
partyConfig.MainAvatarIndex = avatar.Index.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(partyConfig.MainAvatarIndex))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 默认元素力采集角色
|
||||
// var elementalCollectAvatars = ElementalCollectAvatarConfigs.Lists;
|
||||
// foreach (var avatar in combatScenes.Avatars)
|
||||
// {
|
||||
// var elementalCollectAvatar = elementalCollectAvatars.FirstOrDefault(x => x.Name == avatar.Name);
|
||||
// if (elementalCollectAvatar != null)
|
||||
// {
|
||||
// if (elementalCollectAvatar.ElementalType == ElementalType.Hydro)
|
||||
// {
|
||||
// partyConfig.HydroCollectAvatarIndex = avatar.Index.ToString();
|
||||
// }
|
||||
// else if (elementalCollectAvatar.ElementalType == ElementalType.Electro)
|
||||
// {
|
||||
// partyConfig.ElectroCollectAvatarIndex = avatar.Index.ToString();
|
||||
// }
|
||||
// else if (elementalCollectAvatar.ElementalType == ElementalType.Anemo)
|
||||
// {
|
||||
// partyConfig.AnemoCollectAvatarIndex = avatar.Index.ToString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
return partyConfig;
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.GameTask.AutoFight;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
[Serializable]
|
||||
public partial class PathingPartyConfig : ObservableObject
|
||||
{
|
||||
// 配置是否启用,不启用会使用地图追踪内的条件配置
|
||||
[ObservableProperty]
|
||||
private bool _enabled = false;
|
||||
|
||||
// 是否启用自动拾取
|
||||
[ObservableProperty]
|
||||
private bool _autoPickEnabled = true;
|
||||
// 切换到队伍的名称
|
||||
[ObservableProperty]
|
||||
private string _partyName = string.Empty;
|
||||
|
||||
// 切换队伍前是否前往须弥七天神像
|
||||
[ObservableProperty]
|
||||
private bool _isVisitStatueBeforeSwitchParty = false;
|
||||
|
||||
// 主要行走追踪的角色编号
|
||||
[ObservableProperty]
|
||||
private string _mainAvatarIndex = string.Empty;
|
||||
|
||||
// [盾角]使用元素战技的角色编号
|
||||
[ObservableProperty]
|
||||
private string _guardianAvatarIndex = string.Empty;
|
||||
|
||||
// [盾角]使用元素战技的时间间隔(s)
|
||||
[ObservableProperty]
|
||||
private string _guardianElementalSkillSecondInterval = string.Empty;
|
||||
|
||||
// [盾角]使用元素战技的方式 长按/短按
|
||||
[ObservableProperty]
|
||||
private bool _guardianElementalSkillLongPress = false;
|
||||
|
||||
// // normal_attack 配置几号位
|
||||
// [ObservableProperty]
|
||||
// private string _normalAttackAvatarIndex = string.Empty;
|
||||
//
|
||||
// // elemental_skill 配置几号位
|
||||
// [ObservableProperty]
|
||||
// private string _elementalSkillAvatarIndex = string.Empty;
|
||||
|
||||
// // hydro_collect 配置几号位
|
||||
// [ObservableProperty]
|
||||
// private string _hydroCollectAvatarIndex = string.Empty;
|
||||
//
|
||||
// // electro_collect 配置几号位
|
||||
// [ObservableProperty]
|
||||
// private string _electroCollectAvatarIndex = string.Empty;
|
||||
//
|
||||
// // anemo_collect 配置几号位
|
||||
// [ObservableProperty]
|
||||
// private string _anemoCollectAvatarIndex = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public List<string> AvatarIndexList { get; } = ["", "1", "2", "3", "4"];
|
||||
|
||||
// 只在传送传送点时复活
|
||||
[ObservableProperty]
|
||||
private bool _onlyInTeleportRecover = false;
|
||||
|
||||
//允许在jsScript脚本中使用此地图追踪配置
|
||||
[ObservableProperty]
|
||||
private bool _jsScriptUseEnabled = false;
|
||||
|
||||
//允许在此调度器中(一般在JS脚本中)调用自动战斗任务时,采用此追踪配置里的战斗策略
|
||||
[ObservableProperty]
|
||||
private bool _soloTaskUseFightEnabled = false;
|
||||
|
||||
//不在某时执行
|
||||
[ObservableProperty]
|
||||
private string _skipDuring = "";
|
||||
|
||||
// 使用小道具的间隔时间
|
||||
[ObservableProperty]
|
||||
private int _useGadgetIntervalMs = 0;
|
||||
|
||||
// 启用进入剧情自动脱离
|
||||
[ObservableProperty]
|
||||
private bool _autoSkipEnabled = true;
|
||||
|
||||
// 自动冲刺启用
|
||||
[ObservableProperty]
|
||||
private bool _autoRunEnabled = true;
|
||||
|
||||
//启用自动战斗配置
|
||||
[ObservableProperty]
|
||||
private bool _autoFightEnabled = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private AutoFightConfig _autoFightConfig = new();
|
||||
public static PathingPartyConfig BuildDefault()
|
||||
{
|
||||
// 即便是不启用的情况下也设置默认值,减少后续使用的判断
|
||||
var pathingConditionConfig = TaskContext.Instance().Config.PathingConditionConfig;
|
||||
return new PathingPartyConfig
|
||||
{
|
||||
OnlyInTeleportRecover = pathingConditionConfig.OnlyInTeleportRecover,
|
||||
UseGadgetIntervalMs = pathingConditionConfig.UseGadgetIntervalMs
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Config;
|
||||
|
||||
/// <summary>
|
||||
/// 脚本配置
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public partial class ScriptConfig : ObservableObject
|
||||
{
|
||||
// 自动更新脚本仓库周期(天)
|
||||
[ObservableProperty]
|
||||
private int _autoUpdateScriptRepoPeriod = 1;
|
||||
|
||||
// 上次更新脚本仓库时间
|
||||
[ObservableProperty]
|
||||
private DateTime _lastUpdateScriptRepoTime = DateTime.MinValue;
|
||||
|
||||
// 脚本仓库按钮红点是否展示
|
||||
[ObservableProperty]
|
||||
private bool _scriptRepoHintDotVisible = false;
|
||||
|
||||
// 已订阅的脚本路径列表
|
||||
[ObservableProperty]
|
||||
private List<string> _subscribedScriptPaths = [];
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using SharpDX.DirectInput;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Vanara.PInvoke;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Monitor;
|
||||
|
||||
@@ -12,8 +11,6 @@ public class DirectInputMonitor : IDisposable
|
||||
private bool _isRunning = true;
|
||||
|
||||
private readonly Mouse _mouse;
|
||||
|
||||
public static int Interval = 5;
|
||||
|
||||
public DirectInputMonitor()
|
||||
{
|
||||
@@ -37,8 +34,8 @@ public class DirectInputMonitor : IDisposable
|
||||
_mouse.Acquire();
|
||||
MouseState state = _mouse.GetCurrentState();
|
||||
// Debug.WriteLine($"{state.X} {state.Y} {state.Buttons[0]} {state.Buttons[1]}");
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveBy(state, Kernel32.GetTickCount());
|
||||
Thread.Sleep(Interval); // 10ms, equivalent to CLOCKS_PER_SEC/100
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveBy(state);
|
||||
Thread.Sleep(5); // 10ms, equivalent to CLOCKS_PER_SEC/100
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.Core.Recorder;
|
||||
using BetterGenshinImpact.Core.Recorder;
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.Model;
|
||||
@@ -19,10 +18,6 @@ public class MouseKeyMonitor
|
||||
/// </summary>
|
||||
private readonly Timer _fTimer = new();
|
||||
|
||||
private Keys _pickUpKey = Keys.F;
|
||||
|
||||
private User32.VK _pickUpKeyCode = User32.VK.VK_F;
|
||||
|
||||
//private readonly Random _random = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -30,10 +25,6 @@ public class MouseKeyMonitor
|
||||
/// </summary>
|
||||
private readonly Timer _spaceTimer = new();
|
||||
|
||||
private Keys _releaseControlKey = Keys.Space;
|
||||
|
||||
private User32.VK _releaseControlKeyCode = User32.VK.VK_SPACE;
|
||||
|
||||
private DateTime _firstFKeyDownTime = DateTime.MaxValue;
|
||||
|
||||
/// <summary>
|
||||
@@ -55,33 +46,27 @@ public class MouseKeyMonitor
|
||||
_globalHook.MouseDownExt += GlobalHookMouseDownExt;
|
||||
_globalHook.MouseUpExt += GlobalHookMouseUpExt;
|
||||
_globalHook.MouseMoveExt += GlobalHookMouseMoveExt;
|
||||
_globalHook.MouseWheelExt += GlobalHookMouseWheelExt;
|
||||
//_globalHook.KeyPress += GlobalHookKeyPress;
|
||||
|
||||
_pickUpKey = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToWinFormKeys();
|
||||
_pickUpKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.PickUpOrInteract.ToVK();
|
||||
_releaseControlKey = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToWinFormKeys();
|
||||
_releaseControlKeyCode = TaskContext.Instance().Config.KeyBindingsConfig.Jump.ToVK();
|
||||
|
||||
_firstSpaceKeyDownTime = DateTime.MaxValue;
|
||||
var si = TaskContext.Instance().Config.MacroConfig.SpaceFireInterval;
|
||||
_spaceTimer.Interval = si;
|
||||
_spaceTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_releaseControlKeyCode); };
|
||||
_spaceTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(User32.VK.VK_SPACE); };
|
||||
|
||||
var fi = TaskContext.Instance().Config.MacroConfig.FFireInterval;
|
||||
_fTimer.Interval = fi;
|
||||
_fTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(_pickUpKeyCode); };
|
||||
_fTimer.Elapsed += (sender, args) => { Simulation.PostMessage(_hWnd).KeyPress(User32.VK.VK_F); };
|
||||
}
|
||||
|
||||
private void GlobalHookKeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
// Debug.WriteLine("KeyDown: \t{0}", e.KeyCode);
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookKeyDown(e, Kernel32.GetTickCount());
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookKeyDown(e);
|
||||
|
||||
// 热键按下事件
|
||||
HotKeyDown(sender, e);
|
||||
|
||||
if (e.KeyCode == _releaseControlKey)
|
||||
if (e.KeyCode == Keys.Space)
|
||||
{
|
||||
if (_firstSpaceKeyDownTime == DateTime.MaxValue)
|
||||
{
|
||||
@@ -95,7 +80,7 @@ public class MouseKeyMonitor
|
||||
_spaceTimer.Start();
|
||||
}
|
||||
}
|
||||
else if (e.KeyCode == _pickUpKey)
|
||||
else if (e.KeyCode == Keys.F)
|
||||
{
|
||||
if (_firstFKeyDownTime == DateTime.MaxValue)
|
||||
{
|
||||
@@ -114,12 +99,12 @@ public class MouseKeyMonitor
|
||||
private void GlobalHookKeyUp(object? sender, KeyEventArgs e)
|
||||
{
|
||||
// Debug.WriteLine("KeyUp: \t{0}", e.KeyCode);
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookKeyUp(e, Kernel32.GetTickCount());
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookKeyUp(e);
|
||||
|
||||
// 热键松开事件
|
||||
HotKeyUp(sender, e);
|
||||
|
||||
if (e.KeyCode == _releaseControlKey)
|
||||
if (e.KeyCode == Keys.Space)
|
||||
{
|
||||
if (_firstSpaceKeyDownTime != DateTime.MaxValue)
|
||||
{
|
||||
@@ -129,7 +114,7 @@ public class MouseKeyMonitor
|
||||
_spaceTimer.Stop();
|
||||
}
|
||||
}
|
||||
else if (e.KeyCode == _pickUpKey)
|
||||
else if (e.KeyCode == Keys.F)
|
||||
{
|
||||
if (_firstFKeyDownTime != DateTime.MaxValue)
|
||||
{
|
||||
@@ -181,12 +166,6 @@ public class MouseKeyMonitor
|
||||
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t System Timestamp: {2}", e.Button, e.Location, e.Timestamp);
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookMouseMoveTo(e);
|
||||
}
|
||||
|
||||
private void GlobalHookMouseWheelExt(object? sender, MouseEventExtArgs e)
|
||||
{
|
||||
// Debug.WriteLine("MouseMove: {0}; \t Location: {1};\t Delta: {2};\t System Timestamp: {3}", e.Button, e.Location, e.Delta, e.Timestamp);
|
||||
GlobalKeyMouseRecord.Instance.GlobalHookMouseWheel(e);
|
||||
}
|
||||
|
||||
public void Unsubscribe()
|
||||
{
|
||||
@@ -197,7 +176,6 @@ public class MouseKeyMonitor
|
||||
_globalHook.MouseDownExt -= GlobalHookMouseDownExt;
|
||||
_globalHook.MouseUpExt -= GlobalHookMouseUpExt;
|
||||
_globalHook.MouseMoveExt -= GlobalHookMouseMoveExt;
|
||||
_globalHook.MouseWheelExt -= GlobalHookMouseWheelExt;
|
||||
//_globalHook.KeyPress -= GlobalHookKeyPress;
|
||||
_globalHook.Dispose();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PaddleOcrService : IOcrService
|
||||
|
||||
public PaddleOcrService()
|
||||
{
|
||||
var path = Global.Absolute(@"Assets\Model\PaddleOcr");
|
||||
var path = Global.Absolute("Assets\\Model\\PaddleOcr");
|
||||
var localDetModel = DetectionModel.FromDirectory(Path.Combine(path, "ch_PP-OCRv4_det"), ModelVersion.V4);
|
||||
var localClsModel = ClassificationModel.FromDirectory(Path.Combine(path, "ch_ppocr_mobile_v2.0_cls"));
|
||||
var localRecModel = RecognizationModel.FromDirectory(Path.Combine(path, "ch_PP-OCRv4_rec"), Path.Combine(path, "ppocr_keys_v1.txt"), ModelVersion.V4);
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
using System;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using Compunet.YoloV8;
|
||||
using OpenCvSharp;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using BetterGenshinImpact.View.Drawable;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recognition.ONNX;
|
||||
|
||||
public class BgiYoloV8Predictor(string modelRelativePath) : IDisposable
|
||||
{
|
||||
private readonly YoloV8Predictor _predictor = YoloV8Builder.CreateDefaultBuilder()
|
||||
.UseOnnxModel(Global.Absolute(modelRelativePath))
|
||||
.WithSessionOptions(BgiSessionOption.Instance.Options)
|
||||
.Build();
|
||||
|
||||
public YoloV8Predictor Predictor => _predictor;
|
||||
|
||||
/// <summary>
|
||||
/// 检测
|
||||
/// </summary>
|
||||
/// <param name="region">图像</param>
|
||||
/// <returns>类别-矩形框</returns>
|
||||
public Dictionary<string, List<Rect>> Detect(ImageRegion region)
|
||||
{
|
||||
using var memoryStream = new MemoryStream();
|
||||
region.SrcBitmap.Save(memoryStream, ImageFormat.Bmp);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
var result = _predictor.Detect(memoryStream);
|
||||
|
||||
var dict = new Dictionary<string, List<Rect>>();
|
||||
foreach (var box in result.Boxes)
|
||||
{
|
||||
if (!dict.ContainsKey(box.Class.Name))
|
||||
{
|
||||
dict[box.Class.Name] = [new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height)];
|
||||
}
|
||||
else
|
||||
{
|
||||
dict[box.Class.Name].Add(new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height));
|
||||
}
|
||||
}
|
||||
Debug.WriteLine("YOLOv8识别结果:" + JsonSerializer.Serialize(dict));
|
||||
|
||||
var list = new List<RectDrawable>();
|
||||
foreach (var box in result.Boxes)
|
||||
{
|
||||
var rect = new Rect(box.Bounds.X, box.Bounds.Y, box.Bounds.Width, box.Bounds.Height);
|
||||
list.Add(region.ToRectDrawable(rect, modelRelativePath));
|
||||
}
|
||||
|
||||
VisionContext.Instance().DrawContent.PutOrRemoveRectList(modelRelativePath, list);
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_predictor.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recognition.ONNX;
|
||||
|
||||
public class BgiYoloV8PredictorFactory
|
||||
{
|
||||
static Dictionary<string, BgiYoloV8Predictor> _predictors = new();
|
||||
|
||||
public static BgiYoloV8Predictor GetPredictor(string modelRelativePath)
|
||||
{
|
||||
if (!_predictors.ContainsKey(modelRelativePath))
|
||||
{
|
||||
_predictors[modelRelativePath] = new BgiYoloV8Predictor(modelRelativePath);
|
||||
}
|
||||
|
||||
return _predictors[modelRelativePath];
|
||||
}
|
||||
}
|
||||
@@ -23,12 +23,12 @@ public class PickTextInference : ITextInference
|
||||
|
||||
public PickTextInference()
|
||||
{
|
||||
var modelPath = Global.Absolute(@"Assets\Model\Yap\model_training.onnx");
|
||||
var modelPath = Global.Absolute("Assets\\Model\\Yap\\model_training.onnx");
|
||||
if (!File.Exists(modelPath)) throw new FileNotFoundException("Yap模型文件不存在", modelPath);
|
||||
|
||||
_session = new InferenceSession(modelPath, BgiSessionOption.Instance.Options);
|
||||
|
||||
var wordJsonPath = Global.Absolute(@"Assets\Model\Yap\index_2_word.json");
|
||||
var wordJsonPath = Global.Absolute("Assets\\Model\\Yap\\index_2_word.json");
|
||||
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("Yap字典文件不存在", wordJsonPath);
|
||||
|
||||
var json = File.ReadAllText(wordJsonPath);
|
||||
|
||||
@@ -15,12 +15,12 @@ public class Predictor
|
||||
public Predictor()
|
||||
{
|
||||
var options = new SessionOptions();
|
||||
var modelPath = Global.Absolute(@"Assets\Model\Fish\bgi_fish.onnx");
|
||||
var modelPath = Global.Absolute("Assets\\Model\\Fish\\bgi_fish.onnx");
|
||||
if (!File.Exists(modelPath)) throw new FileNotFoundException("自动钓鱼模型文件不存在", modelPath);
|
||||
|
||||
_session = new InferenceSession(modelPath, options);
|
||||
|
||||
var wordJsonPath = Global.Absolute(@"Assets\Model\Fish\label.json");
|
||||
var wordJsonPath = Global.Absolute("Assets\\Model\\Fish\\label.json");
|
||||
if (!File.Exists(wordJsonPath)) throw new FileNotFoundException("自动钓鱼模型分类文件不存在", wordJsonPath);
|
||||
|
||||
var json = File.ReadAllText(wordJsonPath);
|
||||
|
||||
@@ -7,6 +7,7 @@ using OpenCvSharp.XFeatures2D;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
|
||||
@@ -136,10 +137,10 @@ public class FeatureMatcher
|
||||
/// <summary>
|
||||
/// 合并邻近的特征点后匹配(临近特征)
|
||||
/// </summary>
|
||||
/// <param name="queryMat">查询图像的 Mat 对象。</param>
|
||||
/// <param name="queryMat">查询的图</param>
|
||||
/// <param name="prevX">上次匹配到的坐标x</param>
|
||||
/// <param name="prevY">上次匹配到的坐标y</param>
|
||||
/// <param name="queryMatMask">查询图像的 Mask,用于限定检测特征的区域。</param>
|
||||
/// <param name="queryMatMask">查询Mask</param>
|
||||
/// <returns></returns>
|
||||
public Point2f Match(Mat queryMat, float prevX, float prevY, Mat? queryMatMask = null)
|
||||
{
|
||||
@@ -150,17 +151,18 @@ public class FeatureMatcher
|
||||
Debug.WriteLine($"---------切换到新的特征块({cellRow},{cellCol}),合并特征点--------");
|
||||
_lastMergedBlock = KeyPointFeatureBlockHelper.MergeNeighboringFeatures(_blocks, _trainDescriptors, cellRow, cellCol);
|
||||
}
|
||||
|
||||
return Match(_lastMergedBlock.KeyPointArray, _lastMergedBlock.Descriptor!, queryMat, queryMatMask);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用于从训练图像和查询图像中找到匹配的特征点,计算透视变换并确定查询图像的中心点在训练图像中的位置。
|
||||
/// 普通匹配
|
||||
/// </summary>
|
||||
/// <param name="trainKeyPoints">训练图像中的关键点集合。</param>
|
||||
/// <param name="trainDescriptors">训练图像的特征描述子。</param>
|
||||
/// <param name="queryMat">查询图像的 Mat 对象。</param>
|
||||
/// <param name="queryMatMask">查询图像的 Mask,用于限定检测特征的区域。</param>
|
||||
/// <param name="matcherType">描述符匹配器的类型,默认为 DescriptorMatcherType.FlannBased</param>
|
||||
/// <param name="trainKeyPoints"></param>
|
||||
/// <param name="trainDescriptors"></param>
|
||||
/// <param name="queryMat"></param>
|
||||
/// <param name="queryMatMask"></param>
|
||||
/// <param name="matcherType"></param>
|
||||
/// <returns></returns>
|
||||
public Point2f Match(KeyPoint[] trainKeyPoints, Mat trainDescriptors, Mat queryMat, Mat? queryMatMask = null,
|
||||
DescriptorMatcherType matcherType = DescriptorMatcherType.FlannBased)
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace BetterGenshinImpact.Core.Recognition.OpenCv.FeatureMatch;
|
||||
public class FeatureStorage(string name)
|
||||
{
|
||||
private readonly string rootPath = Global.Absolute(@"Assets\Map\");
|
||||
|
||||
public void SetType(Feature2DType type)
|
||||
{
|
||||
TypeName = type.ToString();
|
||||
@@ -15,6 +16,24 @@ public class FeatureStorage(string name)
|
||||
|
||||
public string TypeName { get; set; } = "UNKNOWN";
|
||||
|
||||
// public KeyPoint[]? LoadKeyPointArray1()
|
||||
// {
|
||||
// CreateFolder();
|
||||
// string kpPath = Path.Combine(rootPath, $"{name}_{TypeName}.kp");
|
||||
// if (File.Exists(kpPath))
|
||||
// {
|
||||
// return ObjectUtils.Deserialize(File.ReadAllBytes(kpPath)) as KeyPoint[];
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public void SaveKeyPointArray1(KeyPoint[] kpArray)
|
||||
// {
|
||||
// CreateFolder();
|
||||
// string kpPath = Path.Combine(rootPath, $"{name}_{TypeName}.kp");
|
||||
// File.WriteAllBytes(kpPath, ObjectUtils.Serialize(kpArray));
|
||||
// }
|
||||
|
||||
public KeyPoint[]? LoadKeyPointArray()
|
||||
{
|
||||
CreateFolder();
|
||||
@@ -46,6 +65,32 @@ public class FeatureStorage(string name)
|
||||
}
|
||||
}
|
||||
|
||||
// public Mat? LoadDescMat1()
|
||||
// {
|
||||
// CreateFolder();
|
||||
// // 格式: Surf_336767x128.mat
|
||||
// var files = Directory.GetFiles(rootPath, $"{name}_{TypeName}_*.mat", SearchOption.AllDirectories);
|
||||
// if (files.Length == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// else if (files.Length > 1)
|
||||
// {
|
||||
// Debug.WriteLine($"[FeatureSerializer] Found multiple files: {string.Join(", ", files)}");
|
||||
// }
|
||||
// var rowColPair = Path.GetFileNameWithoutExtension(files[0])
|
||||
// .Replace($"{name}_{TypeName}_", "")
|
||||
// .Split('x');
|
||||
// if (rowColPair.Length != 2)
|
||||
// {
|
||||
// Debug.WriteLine($"[FeatureSerializer] Invalid file name: {files[0]}");
|
||||
// return null;
|
||||
// }
|
||||
// GCHandle pinnedArray = GCHandle.Alloc(ObjectUtils.Deserialize(File.ReadAllBytes(files[0])), GCHandleType.Pinned);
|
||||
// IntPtr pointer = pinnedArray.AddrOfPinnedObject();
|
||||
// return new Mat(Convert.ToInt32(rowColPair[0]), Convert.ToInt32(rowColPair[1]), MatType.CV_32FC1, pointer);
|
||||
// }
|
||||
|
||||
public Mat? LoadDescMat()
|
||||
{
|
||||
CreateFolder();
|
||||
@@ -64,6 +109,22 @@ public class FeatureStorage(string name)
|
||||
return mat;
|
||||
}
|
||||
|
||||
// public void SaveDescMat1(Mat descMat)
|
||||
// {
|
||||
// CreateFolder();
|
||||
// // 删除旧文件
|
||||
// var files = Directory.GetFiles(rootPath, $"{name}_{TypeName}_*.mat", SearchOption.AllDirectories);
|
||||
// foreach (var file in files)
|
||||
// {
|
||||
// File.Delete(file);
|
||||
// }
|
||||
//
|
||||
// var descPath = Path.Combine(rootPath, $"{name}_{TypeName}_{descMat.Rows}x{descMat.Cols}.mat");
|
||||
// var bytes = new byte[descMat.Step(0) * descMat.Rows]; // matSrcRet.Total() * matSrcRet.ElemSize()
|
||||
// Marshal.Copy(descMat.Data, bytes, 0, bytes.Length);
|
||||
// File.WriteAllBytes(descPath, ObjectUtils.Serialize(bytes));
|
||||
// }
|
||||
|
||||
public void SaveDescMat(Mat descMat)
|
||||
{
|
||||
CreateFolder();
|
||||
@@ -74,6 +135,7 @@ public class FeatureStorage(string name)
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
|
||||
var descPath = Path.Combine(rootPath, fileName);
|
||||
FileStorage fs = new(descPath, FileStorage.Modes.Write);
|
||||
fs.Write("desc", descMat);
|
||||
|
||||
@@ -144,28 +144,5 @@ public class RecognitionObject
|
||||
/// </summary>
|
||||
public List<string> RegexMatchText { get; set; } = [];
|
||||
|
||||
public static RecognitionObject Ocr(double x, double y, double w, double h)
|
||||
{
|
||||
return new RecognitionObject
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr,
|
||||
RegionOfInterest = new Rect((int)Math.Round(x), (int)Math.Round(y), (int)Math.Round(w), (int)Math.Round(h))
|
||||
};
|
||||
}
|
||||
|
||||
public static RecognitionObject Ocr(Rect rect)
|
||||
{
|
||||
return new RecognitionObject
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr,
|
||||
RegionOfInterest = rect
|
||||
};
|
||||
}
|
||||
|
||||
public static RecognitionObject OcrThis = new()
|
||||
{
|
||||
RecognitionType = RecognitionTypes.Ocr
|
||||
};
|
||||
|
||||
#endregion OCR文字识别
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
// using BetterGenshinImpact.GameTask.Common.Element.Assets;
|
||||
// using BetterGenshinImpact.GameTask.Common.Map;
|
||||
// using BetterGenshinImpact.GameTask.Model.Area;
|
||||
//
|
||||
// using BetterGenshinImpact.GameTask.Model.Enum;
|
||||
// using BetterGenshinImpact.View.Drawable;
|
||||
// using BetterGenshinImpact.ViewModel.Pages;
|
||||
// using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -8,7 +8,6 @@ using Microsoft.Extensions.Logging;
|
||||
using SharpDX.DirectInput;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
@@ -115,7 +114,7 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
|
||||
ra.Dispose();
|
||||
}
|
||||
|
||||
public void GlobalHookKeyDown(KeyEventArgs e, uint time)
|
||||
public void GlobalHookKeyDown(KeyEventArgs e)
|
||||
{
|
||||
// 排除热键
|
||||
if (e.KeyCode.ToString() == TaskContext.Instance().Config.HotKeyConfig.KeyMouseMacroRecordHotkey)
|
||||
@@ -139,10 +138,10 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
|
||||
_keyDownState.Add(e.KeyCode, true);
|
||||
}
|
||||
// Debug.WriteLine($"KeyDown: {e.KeyCode}");
|
||||
_recorder?.KeyDown(e, time);
|
||||
_recorder?.KeyDown(e);
|
||||
}
|
||||
|
||||
public void GlobalHookKeyUp(KeyEventArgs e, uint time)
|
||||
public void GlobalHookKeyUp(KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode.ToString() == TaskContext.Instance().Config.HotKeyConfig.Test1Hotkey)
|
||||
{
|
||||
@@ -153,7 +152,7 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
|
||||
{
|
||||
// Debug.WriteLine($"KeyUp: {e.KeyCode}");
|
||||
_keyDownState[e.KeyCode] = false;
|
||||
_recorder?.KeyUp(e, time);
|
||||
_recorder?.KeyUp(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,21 +177,15 @@ public class GlobalKeyMouseRecord : Singleton<GlobalKeyMouseRecord>
|
||||
// Debug.WriteLine($"MouseMove: {e.X}, {e.Y}");
|
||||
_recorder?.MouseMoveTo(e);
|
||||
}
|
||||
|
||||
public void GlobalHookMouseWheel(MouseEventExtArgs e)
|
||||
{
|
||||
// Debug.WriteLine($"MouseWheel: {e.Delta}");
|
||||
_recorder?.MouseWheel(e);
|
||||
}
|
||||
|
||||
public void GlobalHookMouseMoveBy(MouseState state, uint time)
|
||||
public void GlobalHookMouseMoveBy(MouseState state)
|
||||
{
|
||||
if (state is { X: 0, Y: 0 } || !_isInMainUi)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Debug.WriteLine($"MouseMoveBy: {state.X}, {state.Y}");
|
||||
_recorder?.MouseMoveBy(state, time);
|
||||
_recorder?.MouseMoveBy(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Fischless.WindowsInput;
|
||||
using Vanara.PInvoke;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
@@ -49,7 +48,7 @@ public class KeyMouseMacroPlayer
|
||||
public static async Task PlayMacro(List<MacroEvent> macroEvents, CancellationToken ct)
|
||||
{
|
||||
WorkingArea = PrimaryScreen.WorkingArea;
|
||||
var startTime = Kernel32.GetTickCount();
|
||||
var startTime = DateTime.UtcNow;
|
||||
foreach (var e in macroEvents)
|
||||
{
|
||||
if (ct.IsCancellationRequested)
|
||||
@@ -57,42 +56,23 @@ public class KeyMouseMacroPlayer
|
||||
return;
|
||||
}
|
||||
|
||||
var timeToWait = e.Time - (Kernel32.GetTickCount() - startTime);
|
||||
var timeToWait = (int)(e.Time - (DateTime.UtcNow - startTime).TotalMilliseconds);
|
||||
if (timeToWait < 0)
|
||||
{
|
||||
TaskControl.Logger.LogDebug("无法原速重放事件{Event},落后{TimeToWait}ms", e.Type.ToString(), (-timeToWait).ToString("F0"));
|
||||
TaskControl.Logger.LogWarning("无法原速重放事件{Event},落后{TimeToWait}ms", e.Type.ToString(), -timeToWait);
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay((int)timeToWait, ct);
|
||||
await Task.Delay(timeToWait, ct);
|
||||
}
|
||||
|
||||
switch (e.Type)
|
||||
{
|
||||
case MacroEventType.KeyDown:
|
||||
var vkDown = (User32.VK)e.KeyCode!;
|
||||
if (InputBuilder.IsExtendedKey(vkDown))
|
||||
{
|
||||
Simulation.SendInput.Keyboard.KeyDown(false, vkDown);
|
||||
}
|
||||
else
|
||||
{
|
||||
Simulation.SendInput.Keyboard.KeyDown(vkDown);
|
||||
}
|
||||
|
||||
Simulation.SendInput.Keyboard.KeyDown((User32.VK)e.KeyCode!);
|
||||
break;
|
||||
|
||||
case MacroEventType.KeyUp:
|
||||
|
||||
var vkUp = (User32.VK)e.KeyCode!;
|
||||
if (InputBuilder.IsExtendedKey(vkUp))
|
||||
{
|
||||
Simulation.SendInput.Keyboard.KeyUp(false, vkUp);
|
||||
}
|
||||
else
|
||||
{
|
||||
Simulation.SendInput.Keyboard.KeyUp(vkUp);
|
||||
}
|
||||
|
||||
Simulation.SendInput.Keyboard.KeyUp((User32.VK)e.KeyCode!);
|
||||
break;
|
||||
|
||||
case MacroEventType.MouseDown:
|
||||
@@ -165,21 +145,11 @@ public class KeyMouseMacroPlayer
|
||||
Simulation.SendInput.Mouse.MoveMouseTo(ToVirtualDesktopX(e.MouseX), ToVirtualDesktopY(e.MouseY));
|
||||
break;
|
||||
|
||||
case MacroEventType.MouseWheel:
|
||||
var num = (int)(e.MouseY / 120.0);
|
||||
if (num != 0)
|
||||
{
|
||||
// 不支持多次的场景,但是不会出现这种情况
|
||||
Simulation.SendInput.Mouse.VerticalScroll(num);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MacroEventType.MouseMoveBy:
|
||||
if (e.CameraOrientation != null)
|
||||
{
|
||||
var cao = CameraOrientation.Compute(TaskControl.CaptureToRectArea().SrcMat);
|
||||
var diff = ((int)Math.Round(cao) - (int)e.CameraOrientation + 180) % 360 - 180;
|
||||
var cao = CameraOrientation.Compute(TaskControl.CaptureToRectArea().SrcGreyMat);
|
||||
var diff = (cao - (int)e.CameraOrientation + 180) % 360 - 180;
|
||||
diff += diff < -180 ? 360 : 0;
|
||||
//过滤一下特别大的角度偏差
|
||||
if (diff != 0 && diff < 8 && diff > -8)
|
||||
@@ -188,7 +158,6 @@ public class KeyMouseMacroPlayer
|
||||
e.MouseX -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
Simulation.SendInput.Mouse.MoveMouseBy(e.MouseX, e.MouseY);
|
||||
break;
|
||||
|
||||
@@ -209,4 +178,4 @@ public class KeyMouseMacroPlayer
|
||||
{
|
||||
return y * 65535 * 1d / WorkingArea.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Windows.Forms;
|
||||
using Vanara.PInvoke;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Recorder;
|
||||
|
||||
@@ -17,7 +16,7 @@ public class KeyMouseRecorder
|
||||
{
|
||||
public List<MacroEvent> MacroEvents { get; } = [];
|
||||
|
||||
public uint StartTime { get; set; } = Kernel32.GetTickCount();
|
||||
public DateTime StartTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime LastOrientationDetection { get; set; } = DateTime.UtcNow;
|
||||
|
||||
@@ -35,11 +34,6 @@ public class KeyMouseRecorder
|
||||
|
||||
public string ToJsonMacro()
|
||||
{
|
||||
// MacroEvents 需要以实际时间进行排序
|
||||
MacroEvents.Sort((a, b) => a.Time.CompareTo(b.Time));
|
||||
// 删除为负数的时间
|
||||
MacroEvents.RemoveAll(m => m.Time < 0);
|
||||
|
||||
var rect = TaskContext.Instance().SystemInfo.CaptureAreaRect;
|
||||
// 合并鼠标移动事件
|
||||
var mergedMacroEvents = new List<MacroEvent>();
|
||||
@@ -95,10 +89,6 @@ public class KeyMouseRecorder
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (currentMerge != null)
|
||||
{
|
||||
mergedMacroEvents.Add(currentMerge);
|
||||
}
|
||||
KeyMouseScript keyMouseScript = new()
|
||||
{
|
||||
MacroEvents = mergedMacroEvents,
|
||||
@@ -114,23 +104,23 @@ public class KeyMouseRecorder
|
||||
return JsonSerializer.Serialize(keyMouseScript, JsonOptions);
|
||||
}
|
||||
|
||||
public void KeyDown(KeyEventArgs e, uint time)
|
||||
public void KeyDown(KeyEventArgs e)
|
||||
{
|
||||
MacroEvents.Add(new MacroEvent
|
||||
{
|
||||
Type = MacroEventType.KeyDown,
|
||||
KeyCode = e.KeyValue,
|
||||
Time = time - StartTime
|
||||
Time = (DateTime.UtcNow - StartTime).TotalMilliseconds
|
||||
});
|
||||
}
|
||||
|
||||
public void KeyUp(KeyEventArgs e, uint time)
|
||||
public void KeyUp(KeyEventArgs e)
|
||||
{
|
||||
MacroEvents.Add(new MacroEvent
|
||||
{
|
||||
Type = MacroEventType.KeyUp,
|
||||
KeyCode = e.KeyValue,
|
||||
Time = time - StartTime
|
||||
Time = (DateTime.UtcNow - StartTime).TotalMilliseconds
|
||||
});
|
||||
}
|
||||
|
||||
@@ -142,7 +132,7 @@ public class KeyMouseRecorder
|
||||
MouseX = e.X,
|
||||
MouseY = e.Y,
|
||||
MouseButton = e.Button.ToString(),
|
||||
Time = e.Timestamp - StartTime
|
||||
Time = (DateTime.UtcNow - StartTime).TotalMilliseconds
|
||||
});
|
||||
}
|
||||
|
||||
@@ -154,7 +144,7 @@ public class KeyMouseRecorder
|
||||
MouseX = e.X,
|
||||
MouseY = e.Y,
|
||||
MouseButton = e.Button.ToString(),
|
||||
Time = e.Timestamp - StartTime
|
||||
Time = (DateTime.UtcNow - StartTime).TotalMilliseconds
|
||||
});
|
||||
}
|
||||
|
||||
@@ -165,40 +155,28 @@ public class KeyMouseRecorder
|
||||
Type = MacroEventType.MouseMoveTo,
|
||||
MouseX = e.X,
|
||||
MouseY = e.Y,
|
||||
Time = e.Timestamp - StartTime
|
||||
});
|
||||
}
|
||||
|
||||
public void MouseWheel(MouseEventExtArgs e)
|
||||
{
|
||||
MacroEvents.Add(new MacroEvent
|
||||
{
|
||||
Type = MacroEventType.MouseWheel,
|
||||
MouseY = e.Delta, // 120 的倍率
|
||||
Time = e.Timestamp - StartTime
|
||||
Time = (DateTime.UtcNow - StartTime).TotalMilliseconds
|
||||
});
|
||||
}
|
||||
|
||||
public void MouseMoveBy(MouseState state, uint time)
|
||||
public void MouseMoveBy(MouseState state)
|
||||
{
|
||||
|
||||
var now = DateTime.UtcNow;
|
||||
int? cao = null;
|
||||
if (TaskContext.Instance().Config.RecordConfig.IsRecordCameraOrientation)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
if ((now - LastOrientationDetection).TotalMilliseconds > 100.0)
|
||||
{
|
||||
LastOrientationDetection = now;
|
||||
cao = (int)Math.Round(CameraOrientation.Compute(TaskControl.CaptureToRectArea().SrcMat));
|
||||
cao = CameraOrientation.Compute(TaskControl.CaptureToRectArea().SrcGreyMat);
|
||||
}
|
||||
}
|
||||
|
||||
MacroEvents.Add(new MacroEvent
|
||||
{
|
||||
Type = MacroEventType.MouseMoveBy,
|
||||
MouseX = state.X,
|
||||
MouseY = state.Y,
|
||||
Time = time - 5 - StartTime,
|
||||
Time = (now - StartTime).TotalMilliseconds,
|
||||
CameraOrientation = cao,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,15 +9,6 @@ public class KeyMouseScriptInfo
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public string? Author { get; set; }
|
||||
|
||||
public string? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 制作时 BetterGI 的版本,用于兼容性检查
|
||||
/// </summary>
|
||||
public string? BgiVersion { get; set; }
|
||||
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int Width { get; set; }
|
||||
|
||||
@@ -22,6 +22,5 @@ public enum MacroEventType
|
||||
MouseMoveTo,
|
||||
MouseMoveBy,
|
||||
MouseDown,
|
||||
MouseUp,
|
||||
MouseWheel
|
||||
MouseUp
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Text.Json;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
internal class AutoPathing(string rootPath)
|
||||
{
|
||||
public async Task Run(string json)
|
||||
{
|
||||
var task = JsonSerializer.Deserialize<PathingTask>(json);
|
||||
if (task == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
await new PathExecutor(CancellationContext.Instance.Cts).Pathing(task);
|
||||
}
|
||||
|
||||
public async Task RunFile(string path)
|
||||
{
|
||||
var json = await new LimitedFile(rootPath).ReadText(path);
|
||||
await Run(json);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using BetterGenshinImpact.GameTask.AutoPathing;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
public class AutoPathingScript
|
||||
{
|
||||
private object? _config = null;
|
||||
private string _rootPath;
|
||||
public AutoPathingScript(string rootPath, object? config) {
|
||||
|
||||
_config = config;
|
||||
_rootPath = rootPath;
|
||||
}
|
||||
|
||||
public async Task Run(string json)
|
||||
{
|
||||
var task = PathingTask.BuildFromJson(json);
|
||||
var pathExecutor = new PathExecutor(CancellationContext.Instance.Cts.Token);
|
||||
if (_config != null && _config is PathingPartyConfig patyConfig ) {
|
||||
pathExecutor.PartyConfig = patyConfig;
|
||||
}
|
||||
await pathExecutor.Pathing(task);
|
||||
}
|
||||
|
||||
public async Task RunFile(string path)
|
||||
{
|
||||
var json = await new LimitedFile(_rootPath).ReadText(path);
|
||||
await Run(json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从已订阅的内容中获取文件
|
||||
/// </summary>
|
||||
/// <param name="path">在 `\User\AutoPathing` 目录下获取文件</param>
|
||||
public async Task RunFileFromUser(string path)
|
||||
{
|
||||
var json = await new LimitedFile(Global.Absolute(@"User\AutoPathing")).ReadText(path);
|
||||
await Run(json);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,11 @@
|
||||
using BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.ViewModel.Pages;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.AutoDomain;
|
||||
using BetterGenshinImpact.GameTask.AutoFishing;
|
||||
using BetterGenshinImpact.GameTask.AutoWood;
|
||||
using BetterGenshinImpact.GameTask.AutoGeniusInvokation;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Handler;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
public class Dispatcher
|
||||
{
|
||||
private object _config = null;
|
||||
public Dispatcher(object config)
|
||||
{
|
||||
_config = config;
|
||||
}
|
||||
public void RunTask()
|
||||
{
|
||||
}
|
||||
@@ -41,76 +29,4 @@ public class Dispatcher
|
||||
|
||||
TaskTriggerDispatcher.Instance().AddTrigger(realtimeTimer.Name, realtimeTimer.Config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 运行独立任务
|
||||
/// </summary>
|
||||
/// <param name="soloTask">
|
||||
/// 支持的任务名称:
|
||||
/// - AutoGeniusInvokation: 启动自动七圣召唤任务
|
||||
/// - AutoWood: 启动自动伐木任务
|
||||
/// - AutoFight: 启动自动战斗任务
|
||||
/// - AutoDomain: 启动自动秘境任务
|
||||
/// </param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public async Task RunTask(SoloTask soloTask)
|
||||
{
|
||||
if (soloTask == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(soloTask), "独立任务对象不能为空");
|
||||
}
|
||||
var taskSettingsPageViewModel = App.GetService<TaskSettingsPageViewModel>();
|
||||
if (taskSettingsPageViewModel == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(taskSettingsPageViewModel), "内部视图模型对象为空");
|
||||
}
|
||||
|
||||
// 根据名称执行任务
|
||||
switch (soloTask.Name)
|
||||
{
|
||||
case "AutoGeniusInvokation":
|
||||
if (taskSettingsPageViewModel.GetTcgStrategy(out var content))
|
||||
{
|
||||
return;
|
||||
}
|
||||
await new AutoGeniusInvokationTask(new GeniusInvokationTaskParam(content)).Start(CancellationContext.Instance.Cts.Token);
|
||||
break;
|
||||
|
||||
case "AutoWood":
|
||||
await new AutoWoodTask(new WoodTaskParam(taskSettingsPageViewModel.AutoWoodRoundNum, taskSettingsPageViewModel.AutoWoodDailyMaxCount)).Start(CancellationContext.Instance.Cts.Token);
|
||||
break;
|
||||
|
||||
case "AutoFight":
|
||||
|
||||
/*if (taskSettingsPageViewModel.GetFightStrategy(out var path1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var autoFightConfig = TaskContext.Instance().Config.AutoFightConfig;
|
||||
var param = new AutoFightParam(path1, autoFightConfig);
|
||||
await new AutoFightTask(param).Start(CancellationContext.Instance.Cts.Token);*/
|
||||
await new AutoFightHandler().RunAsyncByScript(CancellationContext.Instance.Cts.Token, null, _config);
|
||||
break;
|
||||
|
||||
case "AutoDomain":
|
||||
if (taskSettingsPageViewModel.GetFightStrategy(out var path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
await new AutoDomainTask(new AutoDomainParam(0, path)).Start(CancellationContext.Instance.Cts.Token);
|
||||
break;
|
||||
|
||||
// case "AutoMusicGame":
|
||||
// taskSettingsPageViewModel.SwitchAutoMusicGameCommand.Execute(null);
|
||||
// break;
|
||||
|
||||
case "AutoFishing":
|
||||
await new AutoFishingTask(AutoFishingTaskParam.BuildFromSoloTaskConfig(soloTask.Config)).Start(CancellationContext.Instance.Cts.Token);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ArgumentException($"未知的任务名称: {soloTask.Name}", nameof(soloTask.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,167 +1,19 @@
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.GameTask.AutoTrackPath;
|
||||
using BetterGenshinImpact.GameTask.AutoTrackPath;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.Common.Job;
|
||||
using Vanara.PInvoke;
|
||||
using BetterGenshinImpact.GameTask.AutoFishing;
|
||||
using BetterGenshinImpact.ViewModel.Pages;
|
||||
using System;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
public class Genshin
|
||||
{
|
||||
private RECT captureAreaRect = TaskContext.Instance().SystemInfo.CaptureAreaRect;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏宽度
|
||||
/// </summary>
|
||||
public int Width => captureAreaRect.Width;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏高度
|
||||
/// </summary>
|
||||
public int Height => captureAreaRect.Height;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏窗口大小相比1080P的缩放比例
|
||||
/// </summary>
|
||||
public double ScaleTo1080PRatio { get; } = TaskContext.Instance().SystemInfo.ScaleTo1080PRatio;
|
||||
|
||||
/// <summary>
|
||||
/// 系统屏幕的DPI缩放比例
|
||||
/// </summary>
|
||||
public double ScreenDpiScale => TaskContext.Instance().DpiScale;
|
||||
|
||||
/// <summary>
|
||||
/// 传送到指定位置
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
public async Task Tp(double x, double y)
|
||||
{
|
||||
await new TpTask(CancellationContext.Instance.Cts.Token).Tp(x, y);
|
||||
await new TpTask(CancellationContext.Instance.Cts).Tp(x, y);
|
||||
}
|
||||
|
||||
public async Task Tp(double x, double y, bool force)
|
||||
{
|
||||
await new TpTask(CancellationContext.Instance.Cts.Token).Tp(x, y, force);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 传送到指定位置
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
public async Task Tp(string x, string y)
|
||||
{
|
||||
double.TryParse(x, out var dx);
|
||||
double.TryParse(y, out var dy);
|
||||
await Tp(dx, dy);
|
||||
}
|
||||
|
||||
public async Task Tp(string x, string y, bool force)
|
||||
{
|
||||
double.TryParse(x, out var dx);
|
||||
double.TryParse(y, out var dy);
|
||||
await Tp(dx, dy, force);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换队伍
|
||||
/// </summary>
|
||||
/// <param name="partyName">队伍界面自定义的队伍名称</param>
|
||||
/// <returns></returns>
|
||||
public async Task SwitchParty(string partyName)
|
||||
{
|
||||
await new SwitchPartyTask().Start(partyName, CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自动点击空月祝福
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task BlessingOfTheWelkinMoon()
|
||||
{
|
||||
await new BlessingOfTheWelkinMoonTask().Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 持续对话并选择目标选项
|
||||
/// </summary>
|
||||
/// <param name="option">选项文本</param>
|
||||
/// <param name="skipTimes">跳过次数</param>
|
||||
/// <param name="isOrange">是否为橙色选项</param>
|
||||
/// <returns></returns>
|
||||
public async Task ChooseTalkOption(string option, int skipTimes = 10, bool isOrange = false)
|
||||
{
|
||||
await new ChooseTalkOptionTask().SingleSelectText(option, CancellationContext.Instance.Cts.Token, skipTimes, isOrange);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一键领取纪行奖励
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task ClaimBattlePassRewards()
|
||||
{
|
||||
await new ClaimBattlePassRewardsTask().Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 领取长效历练点奖励
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task ClaimEncounterPointsRewards()
|
||||
{
|
||||
await new ClaimEncounterPointsRewardsTask().Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前往冒险家协会领取奖励
|
||||
/// </summary>
|
||||
/// <param name="country">国家名称</param>
|
||||
/// <returns></returns>
|
||||
public async Task GoToAdventurersGuild(string country)
|
||||
{
|
||||
await new GoToAdventurersGuildTask().Start(country, CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 前往合成台
|
||||
/// </summary>
|
||||
/// <param name="country">国家名称</param>
|
||||
/// <returns></returns>
|
||||
public async Task GoToCraftingBench(string country)
|
||||
{
|
||||
await new GoToCraftingBenchTask().Start(country, CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回主界面
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task ReturnMainUi()
|
||||
{
|
||||
await new ReturnMainUiTask().Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 钓鱼
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task AutoFishing(int fishingTimePolicy = 0)
|
||||
{
|
||||
var taskSettingsPageViewModel = App.GetService<TaskSettingsPageViewModel>();
|
||||
if (taskSettingsPageViewModel == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(taskSettingsPageViewModel), "内部视图模型对象为空");
|
||||
}
|
||||
|
||||
var param = AutoFishingTaskParam.BuildFromConfig(TaskContext.Instance().Config.AutoFishingConfig, taskSettingsPageViewModel.SaveScreenshotOnKeyTick);
|
||||
param.FishingTimePolicy = (FishingTimePolicy)fishingTimePolicy;
|
||||
await new AutoFishingTask(param).Start(CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,4 @@
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using Vanara.PInvoke;
|
||||
using static Vanara.PInvoke.User32;
|
||||
using BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.ViewModel.Pages;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
@@ -19,202 +8,4 @@ public class GlobalMethod
|
||||
{
|
||||
await Task.Delay(millisecondsTimeout, CancellationContext.Instance.Cts.Token);
|
||||
}
|
||||
|
||||
#region 键盘操作
|
||||
|
||||
public static void KeyDown(string key)
|
||||
{
|
||||
var vk = KeyBindingsSettingsPageViewModel.MappingKey(ToVk(key));
|
||||
switch (key)
|
||||
{
|
||||
case "VK_LBUTTON":
|
||||
Simulation.SendInput.Mouse.LeftButtonDown();
|
||||
break;
|
||||
case "VK_RBUTTON":
|
||||
Simulation.SendInput.Mouse.RightButtonDown();
|
||||
break;
|
||||
case "VK_MBUTTON":
|
||||
Simulation.SendInput.Mouse.MiddleButtonDown();
|
||||
break;
|
||||
case "VK_XBUTTON1":
|
||||
Simulation.SendInput.Mouse.XButtonDown(0x0001);
|
||||
break;
|
||||
case "VK_XBUTTON2":
|
||||
Simulation.SendInput.Mouse.XButtonDown(0x0001);
|
||||
break;
|
||||
default:
|
||||
Simulation.SendInput.Keyboard.KeyDown(vk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void KeyUp(string key)
|
||||
{
|
||||
var vk = KeyBindingsSettingsPageViewModel.MappingKey(ToVk(key));
|
||||
switch (key)
|
||||
{
|
||||
case "VK_LBUTTON":
|
||||
Simulation.SendInput.Mouse.LeftButtonUp();
|
||||
break;
|
||||
case "VK_RBUTTON":
|
||||
Simulation.SendInput.Mouse.RightButtonUp();
|
||||
break;
|
||||
case "VK_MBUTTON":
|
||||
Simulation.SendInput.Mouse.MiddleButtonUp();
|
||||
break;
|
||||
case "VK_XBUTTON1":
|
||||
Simulation.SendInput.Mouse.XButtonUp(0x0001);
|
||||
break;
|
||||
case "VK_XBUTTON2":
|
||||
Simulation.SendInput.Mouse.XButtonUp(0x0001);
|
||||
break;
|
||||
default:
|
||||
Simulation.SendInput.Keyboard.KeyUp(vk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void KeyPress(string key)
|
||||
{
|
||||
var vk = KeyBindingsSettingsPageViewModel.MappingKey(ToVk(key));
|
||||
switch (key)
|
||||
{
|
||||
case "VK_LBUTTON":
|
||||
Simulation.SendInput.Mouse.LeftButtonClick();
|
||||
break;
|
||||
case "VK_RBUTTON":
|
||||
Simulation.SendInput.Mouse.RightButtonClick();
|
||||
break;
|
||||
case "VK_MBUTTON":
|
||||
Simulation.SendInput.Mouse.MiddleButtonClick();
|
||||
break;
|
||||
case "VK_XBUTTON1":
|
||||
Simulation.SendInput.Mouse.XButtonClick(0x0001);
|
||||
break;
|
||||
case "VK_XBUTTON2":
|
||||
Simulation.SendInput.Mouse.XButtonClick(0x0001);
|
||||
break;
|
||||
default:
|
||||
Simulation.SendInput.Keyboard.KeyPress(vk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static User32.VK ToVk(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
return User32Helper.ToVk(key);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new ArgumentException($"键盘编码必须是VirtualKeyCodes枚举中的值,当前传入的 {key} 不合法");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion 键盘操作
|
||||
|
||||
#region 鼠标操作
|
||||
|
||||
private static int _gameWidth = 1920;
|
||||
private static int _gameHeight = 1080;
|
||||
private static double _dpi = 1;
|
||||
|
||||
public static void SetGameMetrics(int width, int height, double dpi = 1)
|
||||
{
|
||||
// 必须16:9 的分辨率
|
||||
if (width * 9 != height * 16)
|
||||
{
|
||||
throw new ArgumentException("游戏分辨率必须是16:9的分辨率");
|
||||
}
|
||||
|
||||
_gameWidth = width;
|
||||
_gameHeight = height;
|
||||
_dpi = dpi;
|
||||
}
|
||||
|
||||
public static void MoveMouseBy(int x, int y)
|
||||
{
|
||||
var realDpi = TaskContext.Instance().DpiScale;
|
||||
x = (int)(x * realDpi / _dpi);
|
||||
y = (int)(y * realDpi / _dpi);
|
||||
Simulation.SendInput.Mouse.MoveMouseBy(x, y);
|
||||
}
|
||||
|
||||
public static void MoveMouseTo(int x, int y)
|
||||
{
|
||||
if (x < 0 || x > _gameWidth || y < 0 || y > _gameHeight)
|
||||
{
|
||||
throw new ArgumentException("鼠标坐标超出游戏窗口范围");
|
||||
}
|
||||
|
||||
GameCaptureRegion.GameRegionMove((size, s2) =>
|
||||
{
|
||||
var scale = 1920.0 / _gameWidth;
|
||||
return (x * scale * s2, y * scale * s2);
|
||||
});
|
||||
}
|
||||
|
||||
public static void Click(int x, int y)
|
||||
{
|
||||
MoveMouseTo(x, y);
|
||||
LeftButtonClick();
|
||||
}
|
||||
|
||||
public static void LeftButtonClick()
|
||||
{
|
||||
Simulation.SendInput.Mouse.LeftButtonDown().Sleep(60).LeftButtonUp();
|
||||
}
|
||||
|
||||
public static void LeftButtonDown()
|
||||
{
|
||||
Simulation.SendInput.Mouse.LeftButtonDown();
|
||||
}
|
||||
|
||||
public static void LeftButtonUp()
|
||||
{
|
||||
Simulation.SendInput.Mouse.LeftButtonUp();
|
||||
}
|
||||
|
||||
public static void RightButtonClick()
|
||||
{
|
||||
Simulation.SendInput.Mouse.RightButtonDown().Sleep(60).RightButtonUp();
|
||||
}
|
||||
|
||||
public static void RightButtonDown()
|
||||
{
|
||||
Simulation.SendInput.Mouse.RightButtonDown();
|
||||
}
|
||||
|
||||
public static void RightButtonUp()
|
||||
{
|
||||
Simulation.SendInput.Mouse.RightButtonUp();
|
||||
}
|
||||
|
||||
public static void MiddleButtonClick()
|
||||
{
|
||||
Simulation.SendInput.Mouse.MiddleButtonClick();
|
||||
}
|
||||
|
||||
public static void MiddleButtonDown()
|
||||
{
|
||||
Simulation.SendInput.Mouse.MiddleButtonDown();
|
||||
}
|
||||
|
||||
public static void MiddleButtonUp()
|
||||
{
|
||||
Simulation.SendInput.Mouse.MiddleButtonUp();
|
||||
}
|
||||
|
||||
#endregion 鼠标操作
|
||||
|
||||
#region 识图操作
|
||||
|
||||
public static ImageRegion CaptureGameRegion()
|
||||
{
|
||||
return TaskControl.CaptureToRectArea();
|
||||
}
|
||||
|
||||
#endregion 识图操作
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
using BetterGenshinImpact.Core.Script.Dependence.Model.TimerConfig;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
|
||||
/// <summary>
|
||||
/// 实时任务触发器
|
||||
@@ -32,13 +29,4 @@ public class RealtimeTimer
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public RealtimeTimer(string name, dynamic config)
|
||||
{
|
||||
Name = name;
|
||||
if (Name == "AutoPick")
|
||||
{
|
||||
Config = ScriptObjectConverter.ConvertTo<AutoPickExternalConfig>(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using Microsoft.ClearScript;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
|
||||
/// <summary>
|
||||
/// 独立任务
|
||||
/// </summary>
|
||||
public class SoloTask
|
||||
{
|
||||
/// <summary>
|
||||
/// 独立任务名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 独立任务配置
|
||||
/// </summary>
|
||||
public object? Config { get; set; }
|
||||
|
||||
public SoloTask(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public SoloTask(string name, ScriptObject config)
|
||||
{
|
||||
Name = name;
|
||||
Config = config;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using BetterGenshinImpact.Core.Simulator;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using System;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using Vanara.PInvoke;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Dependence.Simulator;
|
||||
|
||||
public class PostMessage
|
||||
{
|
||||
private readonly PostMessageSimulator _postMessageSimulator = TaskContext.Instance().PostMessageSimulator;
|
||||
|
||||
public void KeyDown(string key)
|
||||
{
|
||||
_postMessageSimulator.KeyDownBackground(ToVk(key));
|
||||
}
|
||||
|
||||
public void KeyUp(string key)
|
||||
{
|
||||
_postMessageSimulator.KeyUpBackground(ToVk(key));
|
||||
}
|
||||
|
||||
public void KeyPress(string key)
|
||||
{
|
||||
_postMessageSimulator.KeyPressBackground(ToVk(key));
|
||||
}
|
||||
|
||||
public void Click()
|
||||
{
|
||||
_postMessageSimulator.LeftButtonClick();
|
||||
}
|
||||
|
||||
private static User32.VK ToVk(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
return User32Helper.ToVk(key);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new ArgumentException($"键盘编码必须是VirtualKeyCodes枚举中的值,当前传入的 {key} 不合法");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,31 @@
|
||||
using BetterGenshinImpact.Core.Script.Dependence;
|
||||
using BetterGenshinImpact.Core.Script.Dependence.Model;
|
||||
using Microsoft.ClearScript;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using OpenCvSharp;
|
||||
using BetterGenshinImpact.Core.Recognition;
|
||||
using BetterGenshinImpact.GameTask.Model.Area;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script;
|
||||
|
||||
public class EngineExtend
|
||||
{
|
||||
/// <summary>
|
||||
/// !!! 注意:这个方法会添加一些全局方法和对象,不要随便添加,以免安全风险!!!
|
||||
/// </summary>
|
||||
/// <param name="engine"></param>
|
||||
/// <param name="workDir"></param>
|
||||
/// <param name="searchPaths"></param>
|
||||
public static void InitHost(IScriptEngine engine, string workDir, string[]? searchPaths = null, object? config = null)
|
||||
public static void InitHost(IScriptEngine engine, string workDir, string[]? searchPaths = null)
|
||||
{
|
||||
// engine.AddHostObject("xHost", new ExtendedHostFunctions()); // 有越权的安全风险
|
||||
|
||||
// 添加我的自定义实例化对象
|
||||
engine.AddHostObject("keyMouseScript", new KeyMouseScript(workDir));
|
||||
engine.AddHostObject("pathingScript", new AutoPathingScript(workDir, config));
|
||||
engine.AddHostObject("autoPathing", new AutoPathing(workDir));
|
||||
engine.AddHostObject("genshin", new Dependence.Genshin());
|
||||
engine.AddHostObject("log", new Log());
|
||||
engine.AddHostObject("file", new LimitedFile(workDir)); // 限制文件访问
|
||||
|
||||
// 任务调度器
|
||||
engine.AddHostObject("dispatcher", new Dispatcher(config));
|
||||
// 实时任务调度器
|
||||
engine.AddHostObject("dispatcher", new Dispatcher());
|
||||
engine.AddHostType("RealtimeTimer", typeof(RealtimeTimer));
|
||||
engine.AddHostType("SoloTask", typeof(SoloTask));
|
||||
|
||||
// PostMessage 作为类型实例化
|
||||
engine.AddHostType("PostMessage", typeof(Dependence.Simulator.PostMessage));
|
||||
|
||||
// 直接添加方法
|
||||
AddAllGlobalMethod(engine);
|
||||
|
||||
// 识图模块相关
|
||||
engine.AddHostType("Mat", typeof(Mat));
|
||||
engine.AddHostType("RecognitionObject", typeof(RecognitionObject));
|
||||
engine.AddHostType("DesktopRegion", typeof(DesktopRegion));
|
||||
engine.AddHostType("GameCaptureRegion", typeof(GameCaptureRegion));
|
||||
engine.AddHostType("ImageRegion", typeof(ImageRegion));
|
||||
engine.AddHostType("Region", typeof(Region));
|
||||
#pragma warning disable CS8974 // Converting method group to non-delegate type
|
||||
engine.AddHostObject("sleep", GlobalMethod.Sleep);
|
||||
#pragma warning restore CS8974 // Converting method group to non-delegate type
|
||||
|
||||
// 添加C#的类型
|
||||
engine.AddHostType(typeof(Task));
|
||||
@@ -60,38 +39,4 @@ public class EngineExtend
|
||||
engine.DocumentSettings.SearchPath = string.Join(';', searchPaths);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddAllGlobalMethod(IScriptEngine engine)
|
||||
{
|
||||
// // 获取GlobalMethod类的所有静态方法
|
||||
// var methods = typeof(GlobalMethod).GetMethods(BindingFlags.Static | BindingFlags.Public);
|
||||
//
|
||||
// foreach (var method in methods)
|
||||
// {
|
||||
// // 使用方法名首字母小写作为HostObject的名称
|
||||
// var methodName = char.ToLowerInvariant(method.Name[0]) + method.Name[1..];
|
||||
// engine.AddHostObject(methodName, method);
|
||||
// }
|
||||
|
||||
#pragma warning disable CS8974 // Converting method group to non-delegate type
|
||||
engine.AddHostObject("sleep", GlobalMethod.Sleep);
|
||||
engine.AddHostObject("keyDown", GlobalMethod.KeyDown);
|
||||
engine.AddHostObject("keyUp", GlobalMethod.KeyUp);
|
||||
engine.AddHostObject("keyPress", GlobalMethod.KeyPress);
|
||||
engine.AddHostObject("setGameMetrics", GlobalMethod.SetGameMetrics);
|
||||
engine.AddHostObject("moveMouseBy", GlobalMethod.MoveMouseBy);
|
||||
engine.AddHostObject("moveMouseTo", GlobalMethod.MoveMouseTo);
|
||||
engine.AddHostObject("click", GlobalMethod.Click);
|
||||
engine.AddHostObject("leftButtonClick", GlobalMethod.LeftButtonClick);
|
||||
engine.AddHostObject("leftButtonDown", GlobalMethod.LeftButtonDown);
|
||||
engine.AddHostObject("leftButtonUp", GlobalMethod.LeftButtonUp);
|
||||
engine.AddHostObject("rightButtonClick", GlobalMethod.RightButtonClick);
|
||||
engine.AddHostObject("rightButtonDown", GlobalMethod.RightButtonDown);
|
||||
engine.AddHostObject("rightButtonUp", GlobalMethod.RightButtonUp);
|
||||
engine.AddHostObject("middleButtonClick", GlobalMethod.MiddleButtonClick);
|
||||
engine.AddHostObject("middleButtonDown", GlobalMethod.MiddleButtonDown);
|
||||
engine.AddHostObject("middleButtonUp", GlobalMethod.MiddleButtonUp);
|
||||
engine.AddHostObject("captureGameRegion", GlobalMethod.CaptureGameRegion);
|
||||
#pragma warning restore CS8974 // Converting method group to non-delegate type
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,12 @@
|
||||
using BetterGenshinImpact.Service;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Group;
|
||||
|
||||
/// <summary>
|
||||
/// 调度器 配置组
|
||||
/// </summary>
|
||||
public partial class ScriptGroup : ObservableObject
|
||||
{
|
||||
public int Index { get; set; }
|
||||
@@ -18,9 +14,6 @@ public partial class ScriptGroup : ObservableObject
|
||||
[ObservableProperty]
|
||||
private string _name = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private ScriptGroupConfig _config = new();
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<ScriptGroupProject> _projects = [];
|
||||
|
||||
@@ -41,22 +34,6 @@ public partial class ScriptGroup : ObservableObject
|
||||
|
||||
public static ScriptGroup FromJson(string json)
|
||||
{
|
||||
var group = Newtonsoft.Json.JsonConvert.DeserializeObject<ScriptGroup>(json) ?? throw new Exception("解析配置组JSON配置失败");
|
||||
ResetGroupInfo(group);
|
||||
return group;
|
||||
}
|
||||
|
||||
public static void ResetGroupInfo(ScriptGroup group)
|
||||
{
|
||||
foreach (var project in group.Projects)
|
||||
{
|
||||
project.GroupInfo = group;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddProject(ScriptGroupProject project)
|
||||
{
|
||||
project.GroupInfo = this;
|
||||
Projects.Add(project);
|
||||
return JsonSerializer.Deserialize<ScriptGroup>(json, ConfigService.JsonOptions) ?? throw new Exception("解析配置组JSON配置失败");
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Group;
|
||||
|
||||
[Serializable]
|
||||
public partial class ScriptGroupConfig : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private PathingPartyConfig _pathingConfig = new();
|
||||
}
|
||||
@@ -12,7 +12,6 @@ using System.Dynamic;
|
||||
using System.IO;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.GameTask.Shell;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Group;
|
||||
|
||||
@@ -63,21 +62,8 @@ public partial class ScriptGroupProject : ObservableObject
|
||||
[JsonIgnore]
|
||||
public ScriptProject? Project { get; set; }
|
||||
|
||||
|
||||
public ExpandoObject? JsScriptSettingsObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属配置组
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public ScriptGroup? GroupInfo { get; set; }
|
||||
/// <summary>
|
||||
/// 下一个从此执行标志
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[ObservableProperty]
|
||||
public bool? _nextFlag = false;
|
||||
|
||||
public ScriptGroupProject()
|
||||
{
|
||||
}
|
||||
@@ -113,11 +99,6 @@ public partial class ScriptGroupProject : ObservableObject
|
||||
return new ScriptGroupProject(name, name, "KeyMouse");
|
||||
}
|
||||
|
||||
public static ScriptGroupProject BuildShellProject(string command)
|
||||
{
|
||||
return new ScriptGroupProject(command, "", "Shell");
|
||||
}
|
||||
|
||||
public static ScriptGroupProject BuildPathingProject(string name, string folder)
|
||||
{
|
||||
return new ScriptGroupProject(name, folder, "Pathing");
|
||||
@@ -143,38 +124,24 @@ public partial class ScriptGroupProject : ObservableObject
|
||||
{
|
||||
throw new Exception("JS脚本未初始化");
|
||||
}
|
||||
JsScriptSettingsObject ??= new ExpandoObject();
|
||||
|
||||
var pathingPartyConfig = GroupInfo?.Config.PathingConfig;
|
||||
if (!(pathingPartyConfig is {Enabled:true,JsScriptUseEnabled:true}))
|
||||
{
|
||||
pathingPartyConfig = null;
|
||||
}
|
||||
|
||||
await Project.ExecuteAsync(JsScriptSettingsObject,pathingPartyConfig);
|
||||
await Project.ExecuteAsync(JsScriptSettingsObject);
|
||||
}
|
||||
else if (Type == "KeyMouse")
|
||||
if (Type == "KeyMouse")
|
||||
{
|
||||
// 加载并执行
|
||||
var json = await File.ReadAllTextAsync(Global.Absolute(@$"User\KeyMouseScript\{Name}"));
|
||||
await KeyMouseMacroPlayer.PlayMacro(json, CancellationContext.Instance.Cts.Token, false);
|
||||
}
|
||||
else if (Type == "Pathing")
|
||||
if (Type == "Pathing")
|
||||
{
|
||||
// 加载并执行
|
||||
var task = PathingTask.BuildFromFilePath(Path.Combine(MapPathingViewModel.PathJsonPath, FolderName, Name));
|
||||
var pathingTask = new PathExecutor(CancellationContext.Instance.Cts.Token);
|
||||
pathingTask.PartyConfig = GroupInfo?.Config.PathingConfig;
|
||||
if (pathingTask.PartyConfig is null || pathingTask.PartyConfig.AutoPickEnabled)
|
||||
{
|
||||
TaskTriggerDispatcher.Instance().AddTrigger("AutoPick", null);
|
||||
}
|
||||
await pathingTask.Pathing(task);
|
||||
TaskTriggerDispatcher.Instance().AddTrigger("AutoPick", null);
|
||||
await new PathExecutor(CancellationContext.Instance.Cts).Pathing(task);
|
||||
}
|
||||
else if (Type == "Shell")
|
||||
else
|
||||
{
|
||||
var task = ShellExecutor.BuildFromShellName(Name);
|
||||
await task.Execute();
|
||||
//throw new Exception("不支持的脚本类型");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +167,7 @@ public class ScriptGroupProjectExtensions
|
||||
{
|
||||
{ "Javascript", "JS脚本" },
|
||||
{ "KeyMouse", "键鼠脚本" },
|
||||
{ "Pathing", "地图追踪" },
|
||||
{ "Shell", "Shell" }
|
||||
{ "Pathing", "路径追踪" }
|
||||
};
|
||||
|
||||
public static readonly Dictionary<string, string> StatusDescriptions = new()
|
||||
|
||||
@@ -4,9 +4,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Common;
|
||||
using BetterGenshinImpact.Model;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Project;
|
||||
|
||||
@@ -16,7 +14,6 @@ public class Manifest
|
||||
public int ManifestVersion { get; set; } = 1;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Version { get; set; } = string.Empty;
|
||||
public string? BgiVersion { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public List<Author> Authors { get; set; } = [];
|
||||
public string Main { get; set; } = string.Empty;
|
||||
@@ -51,12 +48,6 @@ public class Manifest
|
||||
{
|
||||
throw new FileNotFoundException("main js file not found.");
|
||||
}
|
||||
|
||||
// 比较版本号大小 BgiVersion
|
||||
if (!string.IsNullOrWhiteSpace(BgiVersion) && Global.IsNewVersion(BgiVersion))
|
||||
{
|
||||
TaskControl.Logger.LogError("脚本 {Name} 版本号要求 {BgiVersion} 大于当前 BetterGI 版本号 {CurrentVersion} , 脚本可能无法正常工作,请更新 BetterGI 版本!", Name, BgiVersion, Global.Version);
|
||||
}
|
||||
}
|
||||
|
||||
public List<SettingItem> LoadSettingItems(string path)
|
||||
@@ -73,7 +64,6 @@ public class Manifest
|
||||
var json = File.ReadAllText(settingFile);
|
||||
settingItems = JsonSerializer.Deserialize<List<SettingItem>>(json, ConfigService.JsonOptions) ?? [];
|
||||
}
|
||||
|
||||
return settingItems;
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,7 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using BetterGenshinImpact.Core.Script.Dependence;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.Project;
|
||||
|
||||
@@ -24,31 +22,24 @@ public class ScriptProject
|
||||
{
|
||||
FolderName = folderName;
|
||||
ProjectPath = Path.Combine(Global.ScriptPath(), folderName);
|
||||
if (!Directory.Exists(ProjectPath))
|
||||
{
|
||||
throw new DirectoryNotFoundException("脚本文件夹不存在:" + ProjectPath);
|
||||
}
|
||||
ManifestFile = Path.GetFullPath(Path.Combine(ProjectPath, "manifest.json"));
|
||||
if (!File.Exists(ManifestFile))
|
||||
{
|
||||
throw new FileNotFoundException("manifest.json文件不存在,请确认此脚本是JS脚本类型。" + ManifestFile);
|
||||
throw new FileNotFoundException("manifest.json file not found.");
|
||||
}
|
||||
|
||||
Manifest = Manifest.FromJson(File.ReadAllText(ManifestFile));
|
||||
Manifest.Validate(ProjectPath);
|
||||
}
|
||||
|
||||
public ScrollViewer? LoadSettingUi(dynamic context)
|
||||
public StackPanel? LoadSettingUi(dynamic context)
|
||||
{
|
||||
var settingItems = Manifest.LoadSettingItems(ProjectPath);
|
||||
if (settingItems.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var stackPanel = new StackPanel
|
||||
{
|
||||
Margin = new Thickness(0, 0, 20, 0) // 给右侧滚动条留出位置
|
||||
};
|
||||
var stackPanel = new StackPanel();
|
||||
foreach (var item in settingItems)
|
||||
{
|
||||
var controls = item.ToControl(context);
|
||||
@@ -58,30 +49,20 @@ public class ScriptProject
|
||||
}
|
||||
}
|
||||
|
||||
var scrollViewer = new ScrollViewer
|
||||
{
|
||||
Content = stackPanel,
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
|
||||
MaxHeight = 350 // 设置最大高度
|
||||
};
|
||||
|
||||
return scrollViewer;
|
||||
return stackPanel;
|
||||
}
|
||||
|
||||
public IScriptEngine BuildScriptEngine(PathingPartyConfig? partyConfig = null)
|
||||
public IScriptEngine BuildScriptEngine()
|
||||
{
|
||||
IScriptEngine engine = new V8ScriptEngine(V8ScriptEngineFlags.UseCaseInsensitiveMemberBinding | V8ScriptEngineFlags.EnableTaskPromiseConversion);
|
||||
EngineExtend.InitHost(engine, ProjectPath, Manifest.Library,partyConfig);
|
||||
EngineExtend.InitHost(engine, ProjectPath, Manifest.Library);
|
||||
return engine;
|
||||
}
|
||||
|
||||
public async Task ExecuteAsync(dynamic? context = null, PathingPartyConfig? partyConfig=null)
|
||||
public async Task ExecuteAsync(dynamic? context = null)
|
||||
{
|
||||
// 默认值
|
||||
GlobalMethod.SetGameMetrics(1920, 1080);
|
||||
// 加载代码
|
||||
var code = await LoadCode();
|
||||
var engine = BuildScriptEngine(partyConfig);
|
||||
var engine = BuildScriptEngine();
|
||||
if (context != null)
|
||||
{
|
||||
// 写入配置的内容
|
||||
|
||||
@@ -1,525 +0,0 @@
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.Core.Script.WebView;
|
||||
using BetterGenshinImpact.GameTask;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using BetterGenshinImpact.Helpers.Http;
|
||||
using BetterGenshinImpact.Model;
|
||||
using BetterGenshinImpact.View.Controls.Webview;
|
||||
using BetterGenshinImpact.ViewModel.Pages;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using Vanara.PInvoke;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script;
|
||||
|
||||
public class ScriptRepoUpdater : Singleton<ScriptRepoUpdater>
|
||||
{
|
||||
private readonly ILogger<ScriptRepoUpdater> _logger = App.GetLogger<ScriptRepoUpdater>();
|
||||
|
||||
private static readonly HttpClient _httpClient = new() { Timeout = TimeSpan.FromSeconds(30) };
|
||||
|
||||
// 仓储位置
|
||||
public static readonly string ReposPath = Global.Absolute("Repos");
|
||||
|
||||
// 仓储临时目录 用于下载与解压
|
||||
public static readonly string ReposTempPath = Path.Combine(ReposPath, "Temp");
|
||||
|
||||
// 中央仓库信息地址
|
||||
public static readonly List<string> CenterRepoInfoUrls =
|
||||
[
|
||||
"https://raw.githubusercontent.com/babalae/bettergi-scripts-list/refs/heads/main/repo.json",
|
||||
"https://r2-script.bettergi.com/github_mirror/repo.json",
|
||||
];
|
||||
|
||||
// 中央仓库解压后文件夹名
|
||||
public static readonly string CenterRepoUnzipName = "bettergi-scripts-list-main";
|
||||
|
||||
public static readonly string CenterRepoPath = Path.Combine(ReposPath, CenterRepoUnzipName);
|
||||
|
||||
public static readonly Dictionary<string, string> PathMapper = new Dictionary<string, string>
|
||||
{
|
||||
{ "pathing", Global.Absolute("User\\AutoPathing") },
|
||||
{ "js", Global.Absolute("User\\JsScript") },
|
||||
{ "combat", Global.Absolute("User\\AutoFight") },
|
||||
{ "tcg", Global.Absolute("User\\AutoGeniusInvokation") },
|
||||
};
|
||||
|
||||
private WebpageWindow? _webWindow;
|
||||
|
||||
public void AutoUpdate()
|
||||
{
|
||||
var scriptConfig = TaskContext.Instance().Config.ScriptConfig;
|
||||
|
||||
if (!Directory.Exists(ReposPath))
|
||||
{
|
||||
Directory.CreateDirectory(ReposPath);
|
||||
}
|
||||
|
||||
// 判断更新周期是否到达
|
||||
if (DateTime.Now - scriptConfig.LastUpdateScriptRepoTime >= TimeSpan.FromDays(scriptConfig.AutoUpdateScriptRepoPeriod))
|
||||
{
|
||||
// 更新仓库
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var (repoPath, updated) = await UpdateCenterRepo();
|
||||
Debug.WriteLine($"脚本仓库更新完成,路径:{repoPath}");
|
||||
scriptConfig.LastUpdateScriptRepoTime = DateTime.Now;
|
||||
if (updated)
|
||||
{
|
||||
scriptConfig.ScriptRepoHintDotVisible = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogDebug(e, $"脚本仓库更新失败:{e.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<(string, bool)> UpdateCenterRepo()
|
||||
{
|
||||
// 测速并获取信息
|
||||
var (fastUrl, jsonString) = await ProxySpeedTester.GetFastestUrlAsync(CenterRepoInfoUrls);
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
throw new Exception("从互联网下载最新的仓库信息失败");
|
||||
}
|
||||
|
||||
var (time, url, file) = ParseJson(jsonString);
|
||||
|
||||
var updated = false;
|
||||
|
||||
// 检查仓库是否存在,不存在则下载
|
||||
var needDownload = false;
|
||||
if (Directory.Exists(CenterRepoPath))
|
||||
{
|
||||
var p = Directory.GetFiles(CenterRepoPath, "repo.json", SearchOption.AllDirectories).FirstOrDefault();
|
||||
if (p is null)
|
||||
{
|
||||
needDownload = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
needDownload = true;
|
||||
}
|
||||
|
||||
if (needDownload)
|
||||
{
|
||||
await DownloadRepoAndUnzip(url);
|
||||
updated = true;
|
||||
}
|
||||
|
||||
// 搜索本地的 repo.json
|
||||
var localRepoJsonPath = Directory.GetFiles(CenterRepoPath, file, SearchOption.AllDirectories).FirstOrDefault();
|
||||
if (localRepoJsonPath is null)
|
||||
{
|
||||
throw new Exception("本地仓库缺少 repo.json");
|
||||
}
|
||||
|
||||
var (time2, url2, file2) = ParseJson(await File.ReadAllTextAsync(localRepoJsonPath));
|
||||
|
||||
// 检查是否需要更新
|
||||
if (long.Parse(time) > long.Parse(time2))
|
||||
{
|
||||
await DownloadRepoAndUnzip(url2);
|
||||
updated = true;
|
||||
}
|
||||
|
||||
// 获取与 localRepoJsonPath 同名(无扩展名)的文件夹路径
|
||||
var folderName = Path.GetFileNameWithoutExtension(localRepoJsonPath);
|
||||
var folderPath = Path.Combine(Path.GetDirectoryName(localRepoJsonPath)!, folderName);
|
||||
if (!Directory.Exists(folderPath))
|
||||
{
|
||||
throw new Exception("本地仓库文件夹不存在");
|
||||
}
|
||||
|
||||
return (folderPath, updated);
|
||||
}
|
||||
|
||||
public string FindCenterRepoPath()
|
||||
{
|
||||
var localRepoJsonPath = Directory.GetFiles(CenterRepoPath, "repo.json", SearchOption.AllDirectories).FirstOrDefault();
|
||||
if (localRepoJsonPath is null)
|
||||
{
|
||||
throw new Exception("本地仓库缺少 repo.json");
|
||||
}
|
||||
|
||||
// 获取与 localRepoJsonPath 同名(无扩展名)的文件夹路径
|
||||
var folderName = Path.GetFileNameWithoutExtension(localRepoJsonPath);
|
||||
var folderPath = Path.Combine(Path.GetDirectoryName(localRepoJsonPath)!, folderName);
|
||||
if (!Directory.Exists(folderPath))
|
||||
{
|
||||
throw new Exception("本地仓库文件夹不存在");
|
||||
}
|
||||
|
||||
return folderPath;
|
||||
}
|
||||
|
||||
private (string time, string url, string file) ParseJson(string jsonString)
|
||||
{
|
||||
var json = JObject.Parse(jsonString);
|
||||
var time = json["time"]?.ToString();
|
||||
var url = json["url"]?.ToString();
|
||||
var file = json["file"]?.ToString();
|
||||
// 检查是否有空值
|
||||
if (time is null || url is null || file is null)
|
||||
{
|
||||
throw new Exception("repo.json 解析失败");
|
||||
}
|
||||
|
||||
return (time, url, file);
|
||||
}
|
||||
|
||||
public async Task DownloadRepoAndUnzip(string url)
|
||||
{
|
||||
// 下载
|
||||
var res = await _httpClient.GetAsync(url);
|
||||
if (!res.IsSuccessStatusCode)
|
||||
{
|
||||
throw new Exception("下载失败");
|
||||
}
|
||||
|
||||
var bytes = await res.Content.ReadAsByteArrayAsync();
|
||||
|
||||
// 获取文件名
|
||||
var contentDisposition = res.Content.Headers.ContentDisposition;
|
||||
var fileName = contentDisposition is { FileName: not null } ? contentDisposition.FileName.Trim('"') : "temp.zip";
|
||||
|
||||
// 创建临时目录
|
||||
if (!Directory.Exists(ReposTempPath))
|
||||
{
|
||||
Directory.CreateDirectory(ReposTempPath);
|
||||
}
|
||||
|
||||
// 保存下载的文件
|
||||
var zipPath = Path.Combine(ReposTempPath, fileName);
|
||||
await File.WriteAllBytesAsync(zipPath, bytes);
|
||||
|
||||
// 删除旧文件夹
|
||||
if (Directory.Exists(CenterRepoPath))
|
||||
{
|
||||
DirectoryHelper.DeleteReadOnlyDirectory(CenterRepoPath);
|
||||
}
|
||||
|
||||
// 使用 System.IO.Compression 解压
|
||||
ZipFile.ExtractToDirectory(zipPath, ReposPath, true);
|
||||
}
|
||||
|
||||
public async Task ImportScriptFromClipboard()
|
||||
{
|
||||
// 获取剪切板内容
|
||||
try
|
||||
{
|
||||
if (Clipboard.ContainsText())
|
||||
{
|
||||
string clipboardText = Clipboard.GetText();
|
||||
await ImportScriptFromUri(clipboardText, true);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// 剪切板内容可能获取会失败
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ImportScriptFromUri(string uri, bool formClipboard)
|
||||
{
|
||||
// 检查剪切板内容是否符合特定的URL格式
|
||||
if (!string.IsNullOrEmpty(uri) && uri.Trim().ToLower().StartsWith("bettergi://script?import="))
|
||||
{
|
||||
Debug.WriteLine($"脚本订购内容:{uri}");
|
||||
// 执行相关操作
|
||||
var pathJson = ParseUri(uri);
|
||||
if (!string.IsNullOrEmpty(pathJson))
|
||||
{
|
||||
var uiMessageBox = new Wpf.Ui.Controls.MessageBox
|
||||
{
|
||||
Title = "脚本订阅",
|
||||
Content = $"检测到{(formClipboard ? "剪切板上存在" : "")}脚本订阅链接,解析后需要导入的脚本为:{pathJson}。\n是否导入并覆盖此文件或者文件夹下的脚本?",
|
||||
CloseButtonText = "关闭",
|
||||
PrimaryButtonText = "确认导入",
|
||||
Owner = Application.Current.MainWindow,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
|
||||
var result = await uiMessageBox.ShowDialogAsync();
|
||||
if (result == Wpf.Ui.Controls.MessageBoxResult.Primary)
|
||||
{
|
||||
await ImportScriptFromPathJson(pathJson);
|
||||
}
|
||||
|
||||
// ContentDialog dialog = new()
|
||||
// {
|
||||
// Title = "脚本订阅",
|
||||
// Content = $"检测到{(formClipboard ? "剪切板上存在" : "")}脚本订阅链接,解析后需要导入的脚本为:{pathJson}。\n是否导入并覆盖此文件或者文件夹下的脚本?",
|
||||
// CloseButtonText = "关闭",
|
||||
// PrimaryButtonText = "确认导入",
|
||||
// };
|
||||
//
|
||||
// var result = await dialog.ShowAsync();
|
||||
// if (result == ContentDialogResult.Primary)
|
||||
// {
|
||||
// await ImportScriptFromPathJson(pathJson);
|
||||
// }
|
||||
}
|
||||
|
||||
if (formClipboard)
|
||||
{
|
||||
// 清空剪切板内容
|
||||
Clipboard.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string? ParseUri(string uriString)
|
||||
{
|
||||
var uri = new Uri(uriString);
|
||||
|
||||
// 获取 query 参数
|
||||
string query = uri.Query;
|
||||
Debug.WriteLine($"Query: {query}");
|
||||
|
||||
// 解析 query 参数
|
||||
var queryParams = System.Web.HttpUtility.ParseQueryString(query);
|
||||
var import = queryParams["import"];
|
||||
if (string.IsNullOrEmpty(import))
|
||||
{
|
||||
Debug.WriteLine("未找到 import 参数");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Base64 解码后再使用url解码
|
||||
byte[] data = Convert.FromBase64String(import);
|
||||
return System.Web.HttpUtility.UrlDecode(System.Text.Encoding.UTF8.GetString(data));
|
||||
}
|
||||
|
||||
public async Task ImportScriptFromPathJson(string pathJson)
|
||||
{
|
||||
var paths = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(pathJson);
|
||||
if (paths is null || paths.Count == 0)
|
||||
{
|
||||
Toast.Warning("订阅脚本路径为空");
|
||||
return;
|
||||
}
|
||||
|
||||
// 保存订阅信息
|
||||
var scriptConfig = TaskContext.Instance().Config.ScriptConfig;
|
||||
scriptConfig.SubscribedScriptPaths.AddRange(paths);
|
||||
|
||||
Toast.Information("获取最新仓库信息中...");
|
||||
|
||||
// 更新仓库
|
||||
string repoPath;
|
||||
try
|
||||
{
|
||||
(repoPath, _) = await Task.Run(UpdateCenterRepo);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Toast.Warning("获取最新仓库信息失败,尝试使用本地已有仓库信息");
|
||||
try
|
||||
{
|
||||
repoPath = FindCenterRepoPath();
|
||||
}
|
||||
catch
|
||||
{
|
||||
await MessageBox.ErrorAsync("本地无仓库信息,请至少成功更新一次脚本仓库信息!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(repoPath))
|
||||
{
|
||||
await MessageBox.ErrorAsync("本地无仓库信息,请至少成功更新一次脚本仓库信息!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// // 收集将被覆盖的文件和文件夹
|
||||
// var filesToOverwrite = new List<string>();
|
||||
// foreach (var path in paths)
|
||||
// {
|
||||
// var first = GetFirstFolder(path);
|
||||
// if (PathMapper.TryGetValue(first, out var userPath))
|
||||
// {
|
||||
// var scriptPath = Path.Combine(repoPath, path);
|
||||
// var destPath = Path.Combine(userPath, path.Replace(first, ""));
|
||||
// if (Directory.Exists(scriptPath))
|
||||
// {
|
||||
// if (Directory.Exists(destPath))
|
||||
// {
|
||||
// filesToOverwrite.Add(destPath);
|
||||
// }
|
||||
// }
|
||||
// else if (File.Exists(scriptPath))
|
||||
// {
|
||||
// if (File.Exists(destPath))
|
||||
// {
|
||||
// filesToOverwrite.Add(destPath);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Toast.Warning($"未知的脚本路径:{path}");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 提示用户确认
|
||||
// if (filesToOverwrite.Count > 0)
|
||||
// {
|
||||
// var message = "以下文件和文件夹将被覆盖:\n" + string.Join("\n", filesToOverwrite) + "\n是否覆盖所有文件和文件夹?";
|
||||
// var uiMessageBox = new Wpf.Ui.Controls.MessageBox
|
||||
// {
|
||||
// Title = "确认覆盖",
|
||||
// Content = message,
|
||||
// CloseButtonText = "取消",
|
||||
// PrimaryButtonText = "确认覆盖",
|
||||
// WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
// Owner = Application.Current.MainWindow,
|
||||
// };
|
||||
//
|
||||
// var result = await uiMessageBox.ShowDialogAsync();
|
||||
// if (result != Wpf.Ui.Controls.MessageBoxResult.Primary)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 拷贝文件
|
||||
foreach (var path in paths)
|
||||
{
|
||||
var (first, remainingPath) = GetFirstFolderAndRemainingPath(path);
|
||||
if (PathMapper.TryGetValue(first, out var userPath))
|
||||
{
|
||||
var scriptPath = Path.Combine(repoPath, path);
|
||||
var destPath = Path.Combine(userPath, remainingPath);
|
||||
if (Directory.Exists(scriptPath))
|
||||
{
|
||||
if (Directory.Exists(destPath))
|
||||
{
|
||||
DirectoryHelper.DeleteDirectoryWithReadOnlyCheck(destPath);
|
||||
}
|
||||
|
||||
CopyDirectory(scriptPath, destPath);
|
||||
|
||||
// 图标处理
|
||||
DealWithIconFolder(destPath);
|
||||
}
|
||||
else if (File.Exists(scriptPath))
|
||||
{
|
||||
// 目标文件所在文件夹不存在时创建它
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destPath)!);
|
||||
|
||||
if (File.Exists(destPath))
|
||||
{
|
||||
File.Delete(destPath);
|
||||
}
|
||||
|
||||
File.Copy(scriptPath, destPath, true);
|
||||
}
|
||||
|
||||
Toast.Success("脚本订阅链接导入完成");
|
||||
}
|
||||
else
|
||||
{
|
||||
Toast.Warning($"未知的脚本路径:{path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyDirectory(string sourceDir, string destDir)
|
||||
{
|
||||
// 创建目标目录
|
||||
Directory.CreateDirectory(destDir);
|
||||
|
||||
// 拷贝文件
|
||||
foreach (var file in Directory.GetFiles(sourceDir))
|
||||
{
|
||||
var destFile = Path.Combine(destDir, Path.GetFileName(file));
|
||||
File.Copy(file, destFile, true);
|
||||
}
|
||||
|
||||
// 拷贝子目录
|
||||
foreach (var dir in Directory.GetDirectories(sourceDir))
|
||||
{
|
||||
var destSubDir = Path.Combine(destDir, Path.GetFileName(dir));
|
||||
CopyDirectory(dir, destSubDir);
|
||||
// 图标处理
|
||||
DealWithIconFolder(destSubDir);
|
||||
}
|
||||
}
|
||||
|
||||
private static (string firstFolder, string remainingPath) GetFirstFolderAndRemainingPath(string path)
|
||||
{
|
||||
// 检查路径是否为空或仅包含部分字符
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return (string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
// 使用路径分隔符分割路径
|
||||
string[] parts = path.Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
// 返回第一个文件夹和剩余路径
|
||||
return parts.Length > 0 ? (parts[0], string.Join(Path.DirectorySeparatorChar, parts.Skip(1))) : (string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
public void OpenLocalRepoInWebView()
|
||||
{
|
||||
if (_webWindow is not { IsVisible: true })
|
||||
{
|
||||
_webWindow = new WebpageWindow
|
||||
{
|
||||
Title = "Genshin Copilot Scripts | BetterGI 脚本本地中央仓库",
|
||||
Width = 1366,
|
||||
Height = 768,
|
||||
};
|
||||
_webWindow.Closed += (s, e) => _webWindow = null;
|
||||
_webWindow.Panel!.DownloadFolderPath = MapPathingViewModel.PathJsonPath;
|
||||
_webWindow.NavigateToFile(Global.Absolute(@"Assets\Web\ScriptRepo\index.html"));
|
||||
_webWindow.Panel!.OnWebViewInitializedAction = () => _webWindow.Panel!.WebView.CoreWebView2.AddHostObjectToScript("repoWebBridge", new RepoWebBridge());
|
||||
_webWindow.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
_webWindow.Activate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理带有 icon.ico 和 desktop.ini 的文件夹
|
||||
/// </summary>
|
||||
/// <param name="folderPath"></param>
|
||||
private void DealWithIconFolder(string folderPath)
|
||||
{
|
||||
if (Directory.Exists(folderPath)
|
||||
&& File.Exists(Path.Combine(folderPath, "desktop.ini")))
|
||||
{
|
||||
// 使用 Vanara 库中的 SetFileAttributes 函数设置文件夹属性
|
||||
if (Kernel32.SetFileAttributes(folderPath, FileFlagsAndAttributes.FILE_ATTRIBUTE_READONLY))
|
||||
{
|
||||
Debug.WriteLine($"成功将文件夹设置为只读: {folderPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.WriteLine($"无法设置文件夹为只读: {folderPath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Policy;
|
||||
using System.Threading.Tasks;
|
||||
using BetterGenshinImpact.ViewModel.Message;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Wpf.Ui.Violeta.Controls;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Script.WebView;
|
||||
|
||||
/// <summary>
|
||||
/// 给 WebView 提供的桥接类
|
||||
/// 用于调用 C# 方法
|
||||
/// </summary>
|
||||
[ClassInterface(ClassInterfaceType.AutoDual)]
|
||||
[ComVisible(true)]
|
||||
public class RepoWebBridge
|
||||
{
|
||||
public async Task<string> GetRepoJson()
|
||||
{
|
||||
try
|
||||
{
|
||||
await ScriptRepoUpdater.Instance.UpdateCenterRepo();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Toast.Warning($"更新仓库信息失败:{e.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(ScriptRepoUpdater.CenterRepoPath))
|
||||
{
|
||||
throw new Exception("仓库文件夹不存在,请至少成功更新一次仓库!");
|
||||
}
|
||||
|
||||
var localRepoJsonPath = Directory.GetFiles(ScriptRepoUpdater.CenterRepoPath, "repo.json", SearchOption.AllDirectories).FirstOrDefault();
|
||||
if (localRepoJsonPath is null)
|
||||
{
|
||||
throw new Exception("repo.json 仓库索引文件不存在,请至少成功更新一次仓库!");
|
||||
}
|
||||
|
||||
var json = await File.ReadAllTextAsync(localRepoJsonPath);
|
||||
return json;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await MessageBox.ShowAsync(e.Message, "获取仓库信息失败");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public async void ImportUri(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
await ScriptRepoUpdater.Instance.ImportScriptFromUri(url, false);
|
||||
WeakReferenceMessenger.Default.Send(new RefreshDataMessage("Refresh"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await MessageBox.ShowAsync(e.Message, "订阅脚本链接失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,270 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BetterGenshinImpact.Core.Simulator.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// 模拟按键类型
|
||||
/// </summary>
|
||||
public enum KeyType
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 单击按键(KeyPress)
|
||||
/// </summary>
|
||||
KeyPress,
|
||||
|
||||
/// <summary>
|
||||
/// 按住按键(KeyDown)
|
||||
/// </summary>
|
||||
KeyDown,
|
||||
|
||||
/// <summary>
|
||||
/// 释放按键(KeyUp)
|
||||
/// </summary>
|
||||
KeyUp,
|
||||
|
||||
/// <summary>
|
||||
/// 长按1s
|
||||
/// </summary>
|
||||
Hold,
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原神按键动作
|
||||
/// </summary>
|
||||
public enum GIActions
|
||||
{
|
||||
/// <summary>
|
||||
/// 向前移动
|
||||
/// </summary>
|
||||
MoveForward,
|
||||
|
||||
/// <summary>
|
||||
/// 向后移动
|
||||
/// </summary>
|
||||
MoveBackward,
|
||||
|
||||
/// <summary>
|
||||
/// 向左移动
|
||||
/// </summary>
|
||||
MoveLeft,
|
||||
|
||||
/// <summary>
|
||||
/// 向右移动
|
||||
/// </summary>
|
||||
MoveRight,
|
||||
|
||||
/// <summary>
|
||||
/// 切换走/跑;特定操作模式下向下移动
|
||||
/// </summary>
|
||||
SwitchToWalkOrRun,
|
||||
|
||||
/// <summary>
|
||||
/// 普通攻击
|
||||
/// </summary>
|
||||
NormalAttack,
|
||||
|
||||
/// <summary>
|
||||
/// 元素战技
|
||||
/// </summary>
|
||||
ElementalSkill,
|
||||
|
||||
/// <summary>
|
||||
/// 元素爆发
|
||||
/// </summary>
|
||||
ElementalBurst,
|
||||
|
||||
/// <summary>
|
||||
/// 冲刺(键盘)
|
||||
/// </summary>
|
||||
SprintKeyboard,
|
||||
|
||||
/// <summary>
|
||||
/// 冲刺(鼠标)
|
||||
/// </summary>
|
||||
SprintMouse,
|
||||
|
||||
/// <summary>
|
||||
/// 切换瞄准模式
|
||||
/// </summary>
|
||||
SwitchAimingMode,
|
||||
|
||||
/// <summary>
|
||||
/// 跳跃;特定操作模式下向上移动
|
||||
/// </summary>
|
||||
Jump,
|
||||
|
||||
/// <summary>
|
||||
/// 落下
|
||||
/// </summary>
|
||||
Drop,
|
||||
|
||||
/// <summary>
|
||||
/// 拾取/交互(自动拾取由AutoPick模块管理)
|
||||
/// </summary>
|
||||
PickUpOrInteract,
|
||||
|
||||
/// <summary>
|
||||
/// 快捷使用小道具
|
||||
/// </summary>
|
||||
QuickUseGadget,
|
||||
|
||||
/// <summary>
|
||||
/// 特定玩法内交互操作
|
||||
/// </summary>
|
||||
InteractionInSomeMode,
|
||||
|
||||
/// <summary>
|
||||
/// 开启任务追踪
|
||||
/// </summary>
|
||||
QuestNavigation,
|
||||
|
||||
/// <summary>
|
||||
/// 中断挑战
|
||||
/// </summary>
|
||||
AbandonChallenge,
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色1
|
||||
/// </summary>
|
||||
SwitchMember1,
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色2
|
||||
/// </summary>
|
||||
SwitchMember2,
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色3
|
||||
/// </summary>
|
||||
SwitchMember3,
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色4
|
||||
/// </summary>
|
||||
SwitchMember4,
|
||||
|
||||
/// <summary>
|
||||
/// 切换小队角色5
|
||||
/// </summary>
|
||||
SwitchMember5,
|
||||
|
||||
/// <summary>
|
||||
/// 呼出快捷轮盘
|
||||
/// </summary>
|
||||
ShortcutWheel,
|
||||
|
||||
/// <summary>
|
||||
/// 打开背包
|
||||
/// </summary>
|
||||
OpenInventory,
|
||||
|
||||
/// <summary>
|
||||
/// 打开角色界面
|
||||
/// </summary>
|
||||
OpenCharacterScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开地图
|
||||
/// </summary>
|
||||
OpenMap,
|
||||
|
||||
/// <summary>
|
||||
/// 打开派蒙界面
|
||||
/// </summary>
|
||||
OpenPaimonMenu,
|
||||
|
||||
/// <summary>
|
||||
/// 打开冒险之证界面
|
||||
/// </summary>
|
||||
OpenAdventurerHandbook,
|
||||
|
||||
/// <summary>
|
||||
/// 打开多人游戏界面
|
||||
/// </summary>
|
||||
OpenCoOpScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开祈愿界面
|
||||
/// </summary>
|
||||
OpenWishScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开纪行界面
|
||||
/// </summary>
|
||||
OpenBattlePassScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开活动面板
|
||||
/// </summary>
|
||||
OpenTheEventsMenu,
|
||||
|
||||
/// <summary>
|
||||
/// 打开玩法系统界面(尘歌壶内猫尾酒馆内)
|
||||
/// </summary>
|
||||
OpenTheSettingsMenu,
|
||||
|
||||
/// <summary>
|
||||
/// 打开摆设界面(尘歌壶内)
|
||||
/// </summary>
|
||||
OpenTheFurnishingScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开星之归还(条件符合期间生效)
|
||||
/// </summary>
|
||||
OpenStellarReunion,
|
||||
|
||||
/// <summary>
|
||||
/// 开关任务菜单
|
||||
/// </summary>
|
||||
OpenQuestMenu,
|
||||
|
||||
/// <summary>
|
||||
/// 打开通知详情
|
||||
/// </summary>
|
||||
OpenNotificationDetails,
|
||||
|
||||
/// <summary>
|
||||
/// 打开聊天界面
|
||||
/// </summary>
|
||||
OpenChatScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开特殊环境说明
|
||||
/// </summary>
|
||||
OpenSpecialEnvironmentInformation,
|
||||
|
||||
/// <summary>
|
||||
/// 查看教程详情
|
||||
/// </summary>
|
||||
CheckTutorialDetails,
|
||||
|
||||
/// <summary>
|
||||
/// 长按打开元素视野
|
||||
/// </summary>
|
||||
ElementalSight,
|
||||
|
||||
/// <summary>
|
||||
/// 呼出鼠标
|
||||
/// </summary>
|
||||
ShowCursor,
|
||||
|
||||
/// <summary>
|
||||
/// 打开队伍配置界面
|
||||
/// </summary>
|
||||
OpenPartySetupScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 打开好友界面
|
||||
/// </summary>
|
||||
OpenFriendsScreen,
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏主界面
|
||||
/// </summary>
|
||||
HideUI,
|
||||
|
||||
}
|
||||