diff --git a/DeFRaG_Helper/ToDo.txt b/DeFRaG_Helper/ToDo.txt index 78f42bd..1d922a5 100644 --- a/DeFRaG_Helper/ToDo.txt +++ b/DeFRaG_Helper/ToDo.txt @@ -1,10 +1,8 @@ - Search -> v1.>0 - Language -> v1.>0 -- Edit maps -> v1.>0 - Config editor -> v1.>0 - Records -> v1.>0 -- clear filters - auto record - personal best (playername) diff --git a/DeFRaG_Helper/ViewModels/MapViewModel.cs b/DeFRaG_Helper/ViewModels/MapViewModel.cs index a23bb8c..f6aa6e0 100644 --- a/DeFRaG_Helper/ViewModels/MapViewModel.cs +++ b/DeFRaG_Helper/ViewModels/MapViewModel.cs @@ -24,7 +24,8 @@ public class MapViewModel : INotifyPropertyChanged public event EventHandler MapsBatchLoaded; public ObservableCollection Maps { get; set; } private static readonly object _lock = new object(); - + private bool _showVQ3; + private bool _showCPM; public List FilteredMaps { get; private set; } private bool dataLoaded = false; @@ -52,6 +53,8 @@ private void ClearFilters(object parameter) ShowFavorites = false; ShowInstalled = false; ShowDownloaded = false; + ShowVQ3 = false; + ShowCPM = false; SelectedTags.Clear(); TagBarViewModel.Instance.ClearSelectedTags(); @@ -185,7 +188,11 @@ await Task.Run(() => map.Weapons.Contains(tag) || map.Items.Contains(tag) || map.Functions.Contains(tag) || - map.Tags.Contains(tag))) + map.Tags.Contains(tag))) && + (!ShowVQ3 && !ShowCPM || // If neither VQ3 nor CPM is selected, include all maps + (ShowVQ3 && (map.Physics == 1 || map.Physics == 3)) || // Include VQ3 maps + (ShowCPM && (map.Physics == 2 || map.Physics == 3)) // Include CPM maps + ) ).OrderByDescending(map => map.Releasedate).ToList(); } @@ -218,6 +225,9 @@ await Task.Run(() => + + + public void LoadDisplayedMapsSubset(List sourceMaps, int startIndex, int count) { for (int i = startIndex; i < Math.Min(startIndex + count, sourceMaps.Count); i++) @@ -236,7 +246,26 @@ public void LoadDisplayedMapsSubset(List sourceMaps, int startIndex, int co - + public bool ShowVQ3 + { + get => _showVQ3; + set + { + _showVQ3 = value; + OnPropertyChanged(nameof(ShowVQ3)); + ApplyFilters(); + } + } + public bool ShowCPM + { + get => _showCPM; + set + { + _showCPM = value; + OnPropertyChanged(nameof(ShowCPM)); + ApplyFilters(); + } + } diff --git a/DeFRaG_Helper/Views/Maps.xaml b/DeFRaG_Helper/Views/Maps.xaml index 60c21d2..63e5d40 100644 --- a/DeFRaG_Helper/Views/Maps.xaml +++ b/DeFRaG_Helper/Views/Maps.xaml @@ -29,14 +29,18 @@ + + - - - - -