From e2f84f7edd2f9e27e57f0c24acd70e5ccc4ccbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Mon, 4 May 2026 20:47:21 +0800 Subject: [PATCH] =?UTF-8?q?JS=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E5=9C=A8?= =?UTF-8?q?=E5=B0=8F=E5=9C=B0=E5=9B=BE=E4=B8=8A=E7=9A=84=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=9D=90=E6=A0=87=20=E6=96=B0=E5=A2=9E=20matchingMethod=20?= =?UTF-8?q?=E7=9A=84=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Script/Dependence/Genshin.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BetterGenshinImpact/Core/Script/Dependence/Genshin.cs b/BetterGenshinImpact/Core/Script/Dependence/Genshin.cs index 5e9c8b0d..0c325211 100644 --- a/BetterGenshinImpact/Core/Script/Dependence/Genshin.cs +++ b/BetterGenshinImpact/Core/Script/Dependence/Genshin.cs @@ -216,6 +216,11 @@ public class Genshin { return GetPositionFromMap(MapTypes.Teyvat.ToString()); } + + public Point2f? GetPositionFromMap(string matchingMethod) + { + return GetPositionFromMap(nameof(MapTypes.Teyvat), matchingMethod); + } public float GetCameraOrientation() { @@ -230,14 +235,18 @@ public class Genshin /// 缓存时间,单位毫秒,默认900ms /// 包含X和Y坐标的Point2f结构体 public Point2f? GetPositionFromMap(string mapName, int cacheTimeMs = 900) + { + var matchingMethod = TaskContext.Instance().Config.PathingConditionConfig.MapMatchingMethod; + return GetPositionFromMap(mapName,matchingMethod, cacheTimeMs); + } + + public Point2f? GetPositionFromMap(string mapName, string matchingMethod, int cacheTimeMs = 900) { var imageRegion = CaptureToRectArea(); if (!Bv.IsInMainUi(imageRegion)) { throw new InvalidOperationException("不在主界面,无法识别小地图坐标"); } - - var matchingMethod = TaskContext.Instance().Config.PathingConditionConfig.MapMatchingMethod; return MapManager.GetMap(mapName, matchingMethod) .ConvertImageCoordinatesToGenshinMapCoordinates(LazyNavigationInstance.Value .GetPositionStableByCache(imageRegion, mapName, matchingMethod, cacheTimeMs));