diff --git a/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs b/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs index 0bc714cf..b8fd8468 100644 --- a/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs +++ b/BetterGenshinImpact/Core/Config/PathingConditionConfig.cs @@ -12,6 +12,9 @@ namespace BetterGenshinImpact.Core.Config; [Serializable] public partial class PathingConditionConfig : ObservableObject { + [ObservableProperty] + private string _mapPathingType = "SIFT"; + // 地图追踪条件配置 [ObservableProperty] private ObservableCollection _partyConditions = []; diff --git a/BetterGenshinImpact/GameTask/Common/Map/Maps/MapManager.cs b/BetterGenshinImpact/GameTask/Common/Map/Maps/MapManager.cs index 961885b1..c26e7d2d 100644 --- a/BetterGenshinImpact/GameTask/Common/Map/Maps/MapManager.cs +++ b/BetterGenshinImpact/GameTask/Common/Map/Maps/MapManager.cs @@ -42,14 +42,29 @@ public static class MapManager private static ISceneMap CreateMap(MapTypes mapType) { - return mapType switch + if (TaskContext.Instance().Config.PathingConditionConfig.MapPathingType == "SIFT") { - MapTypes.Teyvat => new TeyvatMapTest(), - MapTypes.TheChasm => new TheChasmMapTest(), - MapTypes.Enkanomiya => new EnkanomiyaMapTest(), - MapTypes.AncientSacredMountain => new AncientSacredMountainMap(), - MapTypes.SeaOfBygoneEras => new SeaOfBygoneErasMap(), - _ => throw new System.ArgumentException($"未知的地图类型: {mapType}", nameof(mapType)) - }; + return mapType switch + { + MapTypes.Teyvat => new TeyvatMap(), + MapTypes.TheChasm => new TheChasmMap(), + MapTypes.Enkanomiya => new EnkanomiyaMap(), + MapTypes.AncientSacredMountain => new AncientSacredMountainMap(), + MapTypes.SeaOfBygoneEras => new SeaOfBygoneErasMap(), + _ => throw new System.ArgumentException($"未知的地图类型: {mapType}", nameof(mapType)) + }; + } + else + { + return mapType switch + { + MapTypes.Teyvat => new TeyvatMapTest(), + MapTypes.TheChasm => new TheChasmMapTest(), + MapTypes.Enkanomiya => new EnkanomiyaMapTest(), + MapTypes.AncientSacredMountain => new AncientSacredMountainMap(), + MapTypes.SeaOfBygoneEras => new SeaOfBygoneErasMap(), + _ => throw new System.ArgumentException($"未知的地图类型: {mapType}", nameof(mapType)) + }; + } } } \ No newline at end of file diff --git a/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml b/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml index 5cfa6a2f..f0c1b0bf 100644 --- a/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml +++ b/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml @@ -539,6 +539,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs b/BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs index 088b02e3..273d66cc 100644 --- a/BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs +++ b/BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs @@ -65,6 +65,8 @@ public partial class CommonSettingsPageViewModel : ViewModel public AllConfig Config { get; set; } public ObservableCollection CountryList { get; } = new(); public ObservableCollection Areas { get; } = new(); + + public ObservableCollection MapPathingTypes { get; } = ["SIFT", "TemplateMatch"]; [ObservableProperty] private FrozenDictionary _languageDict = new string[] { "zh-Hans", "zh-Hant", "en", "fr" }