mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-17 09:26:50 +08:00
可以选择当前的地图追踪方式
This commit is contained in:
@@ -12,6 +12,9 @@ namespace BetterGenshinImpact.Core.Config;
|
||||
[Serializable]
|
||||
public partial class PathingConditionConfig : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string _mapPathingType = "SIFT";
|
||||
|
||||
// 地图追踪条件配置
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<Condition> _partyConditions = [];
|
||||
|
||||
@@ -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))
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -539,6 +539,41 @@
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ui:CardExpander>
|
||||
|
||||
<!-- 地图追踪设置 -->
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon DataTreemap24}">
|
||||
<ui:CardControl.Header>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
Text="地图追踪优先使用的特征匹配方式"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
Text="影响所有地图追踪功能,重启后生效"
|
||||
TextWrapping="Wrap" />
|
||||
<ComboBox Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,36,0"
|
||||
MinWidth="120"
|
||||
ItemsSource="{Binding MapPathingTypes}"
|
||||
SelectedItem="{Binding Config.PathingConditionConfig.MapPathingType}"
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
</ui:CardControl.Header>
|
||||
</ui:CardControl>
|
||||
|
||||
<!-- 大地图传送相关设置 -->
|
||||
<ui:CardExpander Margin="0,0,0,12" ContentPadding="0">
|
||||
|
||||
@@ -65,6 +65,8 @@ public partial class CommonSettingsPageViewModel : ViewModel
|
||||
public AllConfig Config { get; set; }
|
||||
public ObservableCollection<string> CountryList { get; } = new();
|
||||
public ObservableCollection<string> Areas { get; } = new();
|
||||
|
||||
public ObservableCollection<string> MapPathingTypes { get; } = ["SIFT", "TemplateMatch"];
|
||||
|
||||
[ObservableProperty] private FrozenDictionary<string, string> _languageDict =
|
||||
new string[] { "zh-Hans", "zh-Hant", "en", "fr" }
|
||||
|
||||
Reference in New Issue
Block a user