diff --git a/Vermintide Analyzer/Controls/FilterDisplay.xaml b/Vermintide Analyzer/Controls/FilterDisplay.xaml index 01395eb..2d550e5 100644 --- a/Vermintide Analyzer/Controls/FilterDisplay.xaml +++ b/Vermintide Analyzer/Controls/FilterDisplay.xaml @@ -47,6 +47,15 @@ AllValues="{Binding GameVersionValues}" SelectionChanged="MultiSelectComboBox_SelectionChanged" /> + + diff --git a/Vermintide Analyzer/Controls/FilterDisplay.xaml.cs b/Vermintide Analyzer/Controls/FilterDisplay.xaml.cs index 12c2aa2..83180bd 100644 --- a/Vermintide Analyzer/Controls/FilterDisplay.xaml.cs +++ b/Vermintide Analyzer/Controls/FilterDisplay.xaml.cs @@ -48,6 +48,7 @@ public GameFilter Filter public IEnumerable SavedFilters => GameRepository.Instance.GameFilters.Keys.OrderBy(str => str); + public List RoundResultStrings { get; set; } = new List(); public List CareerStrings { get; set; } = new List(); public List DifficultyStrings { get; set; } = new List(); public List MissionStrings { get; set; } = new List(); @@ -56,6 +57,7 @@ public GameFilter Filter public string MinutesString { get; set; } = ""; public List GameVersionValues => GameRepository.Instance.GameVersions.ToList(); + public List RoundResultValues => GameFilter.FilterOptions(typeof(ROUND_RESULT)).ToList(); public List CareerFilterValues => GameFilter.FilterOptions(typeof(CAREER)).ToList(); public List DifficultyFilterValues => GameFilter.FilterOptions(typeof(DIFFICULTY)).ToList(); public List MissionFilterValues => GameFilter.FilterOptions(typeof(MISSION)).ToList(); @@ -102,6 +104,7 @@ public void ResetFilter() EmpoweredDropdown.SelectedItem = "Either"; GameVersionDropdown.ResetSelection(); + ResultDropdown.ResetSelection(); DaysTextBox.Text = ""; MinutesTextBox.Text = ""; CareerDropdown.ResetSelection(); @@ -113,6 +116,7 @@ public void ResetFilter() private void RefreshBindingLists() { GameVersionDropdown.SyncSelection(Filter.GameVersion.ToList()); + ResultDropdown.SyncSelection(Filter.Result.Select(c => c.ForDisplay()).ToList()); CareerDropdown.SyncSelection(Filter.Career.Select(c => c.ForDisplay()).ToList()); DifficultyDropdown.SyncSelection(Filter.Difficulty.Select(d => d.ForDisplay()).ToList()); MissionDropdown.SyncSelection(Filter.Mission.Select(m => m.ForDisplay()).ToList()); @@ -124,6 +128,7 @@ public void RefreshDisplay() RefreshBindingLists(); GameVersionDropdown.GetBindingExpression(MultiSelectComboBox.SelectedProperty).UpdateTarget(); + ResultDropdown.GetBindingExpression(MultiSelectComboBox.SelectedProperty).UpdateTarget(); OlderYoungerComboBox.GetBindingExpression(ComboBox.SelectedItemProperty).UpdateTarget(); LongerShorterComboBox.GetBindingExpression(ComboBox.SelectedItemProperty).UpdateTarget(); DaysString = Filter.Days.HasValue ? Filter.Days.ToString() : ""; @@ -142,7 +147,12 @@ public void RefreshDisplay() private void MultiSelectComboBox_SelectionChanged(MultiSelectComboBox source, List newSelection) { - if (source == CareerDropdown) + if(source == ResultDropdown) + { + Filter.Result.Clear(); + Filter.Result.AddRange(RoundResultStrings.Select(str => str.FromDisplay())); + } + else if (source == CareerDropdown) { Filter.Career.Clear(); Filter.Career.AddRange(CareerStrings.Select(str => str.FromDisplay())); diff --git a/Vermintide Analyzer/GameData/GameFilter.cs b/Vermintide Analyzer/GameData/GameFilter.cs index 8dc59e4..dca91a4 100644 --- a/Vermintide Analyzer/GameData/GameFilter.cs +++ b/Vermintide Analyzer/GameData/GameFilter.cs @@ -19,6 +19,17 @@ public List GameVersion } } + private List mResult = new List(); + public List Result + { + get => mResult; + set + { + mResult = value; + OnFilterChange?.Invoke(nameof(Result)); + } + } + private List mDifficulty = new List(); public List Difficulty { @@ -136,6 +147,7 @@ public uint? Minutes public bool IsMatch(GameHeader gh) => MatchGameVersion(gh) && + MatchGameResult(gh) && MatchGameLength(gh) && MatchWithinDays(gh) && MatchDifficulty(gh) && @@ -146,6 +158,7 @@ public bool IsMatch(GameHeader gh) => MatchMission(gh); private bool MatchGameVersion(GameHeader gh) => GameVersion.Contains(gh.GameVersion); + private bool MatchGameResult(GameHeader gh) => Result.Contains(gh.Result); private bool MatchWithinDays(GameHeader gh) { if (!Days.HasValue || Days.Value == 0) return true; @@ -189,6 +202,11 @@ public override string ToString() { output.Add(version); } + var result = RoundResultToString(); + if(result != null) + { + output.Add(result); + } var diff = DifficultyToString(); if (diff != null) { @@ -246,6 +264,9 @@ public void UpdateFromString(string input) GameVersion.Clear(); GameVersion.AddRange(ReadGameVersion(input)); + Result.Clear(); + Result.AddRange(ReadRoundResult(input)); + (Longer, Minutes) = ReadMinutesLong(input) ?? (true, null); (Older, Days) = ReadWithinDays(input) ?? (true, null); @@ -274,6 +295,9 @@ private string GameVersionToString() return $"Game Version in ({GetFilterSetString(GameVersion)})"; } + + private string RoundResultToString() => EnumListToString(nameof(Result), Result); + private string MinutesLongToString() { if (!Minutes.HasValue) return null; @@ -335,6 +359,9 @@ private static List ReadGameVersion(string filterString) } return result; } + + private static List ReadRoundResult(string filterString) => ReadEnumList(filterString, nameof(Result)); + private static (bool longer, uint? minutes)? ReadMinutesLong(string filterString) { var match = Regex.Match(filterString, $@"((?:Longer)|(?:Shorter)) than (\d+) Minutes"); diff --git a/Vermintide Analyzer/Properties/AssemblyInfo.cs b/Vermintide Analyzer/Properties/AssemblyInfo.cs index 71e12c6..5f8ea65 100644 --- a/Vermintide Analyzer/Properties/AssemblyInfo.cs +++ b/Vermintide Analyzer/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.11.0")] -[assembly: AssemblyFileVersion("1.1.11.0")] +[assembly: AssemblyVersion("1.1.13.0")] +[assembly: AssemblyFileVersion("1.1.13.0")]