From a44b6e9d1001e2525c7deb7af45aa71b8e4c9c65 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:50:36 +0200 Subject: [PATCH 1/2] Add slider tail mises to perfcalc gui --- PerformanceCalculatorGUI/RulesetHelper.cs | 12 +++++++---- .../Screens/SimulateScreen.cs | 20 ++++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/PerformanceCalculatorGUI/RulesetHelper.cs b/PerformanceCalculatorGUI/RulesetHelper.cs index e32f8a6bb..05a9f1af4 100644 --- a/PerformanceCalculatorGUI/RulesetHelper.cs +++ b/PerformanceCalculatorGUI/RulesetHelper.cs @@ -15,6 +15,7 @@ using osu.Game.Rulesets.Mania; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu; +using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko; using osu.Game.Rulesets.Taiko.Objects; @@ -103,11 +104,11 @@ public static int AdjustManiaScore(int score, IReadOnlyList mods) return (int)Math.Round(1000000 * scoreMultiplier); } - public static Dictionary GenerateHitResultsForRuleset(RulesetInfo ruleset, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses) + public static Dictionary GenerateHitResultsForRuleset(RulesetInfo ruleset, bool hasSliderAccuracy, double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) { return ruleset.OnlineID switch { - 0 => generateOsuHitResults(accuracy, beatmap, countMiss, countMeh, countGood, countLargeTickMisses), + 0 => generateOsuHitResults(accuracy, hasSliderAccuracy, beatmap, countMiss, countMeh, countGood, countLargeTickMisses, countSliderTailMisses), 1 => generateTaikoHitResults(accuracy, beatmap, countMiss, countGood), 2 => generateCatchHitResults(accuracy, beatmap, countMiss, countMeh, countGood), 3 => generateManiaHitResults(accuracy, beatmap, countMiss), @@ -115,7 +116,7 @@ public static Dictionary GenerateHitResultsForRuleset(RulesetInf }; } - private static Dictionary generateOsuHitResults(double accuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses) + private static Dictionary generateOsuHitResults(double accuracy, bool hasSliderAccuracy, IBeatmap beatmap, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses) { int countGreat; @@ -191,12 +192,15 @@ private static Dictionary generateOsuHitResults(double accuracy, countGreat = (int)(totalResultCount - countGood - countMeh - countMiss); } + int sliderTailHits = beatmap.HitObjects.Count(x => x is Slider) - countSliderTailMisses; + return new Dictionary { { HitResult.Great, countGreat }, { HitResult.Ok, countGood ?? 0 }, { HitResult.Meh, countMeh ?? 0 }, - { HitResult.LargeTickMiss, countLargeTickMisses ?? 0 }, + { HitResult.LargeTickMiss, countLargeTickMisses }, + { hasSliderAccuracy ? HitResult.SliderTailHit : HitResult.SmallTickHit, sliderTailHits }, { HitResult.Miss, countMiss } }; } diff --git a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs index 2d70fc141..3c29337e6 100644 --- a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs +++ b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs @@ -28,6 +28,7 @@ using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Screens.Play.HUD; @@ -53,6 +54,7 @@ public partial class SimulateScreen : PerformanceCalculatorScreen private LimitedLabelledNumberBox missesTextBox; private LimitedLabelledNumberBox largeTickMissesTextBox; + private LimitedLabelledNumberBox sliderTailMissesTextBox; private LimitedLabelledNumberBox comboTextBox; private LimitedLabelledNumberBox scoreTextBox; @@ -269,6 +271,7 @@ private void load(OsuColour osuColour) AutoSizeAxes = Axes.Y, ColumnDimensions = new[] { + new Dimension(), new Dimension(), new Dimension() }, @@ -292,6 +295,14 @@ private void load(OsuColour osuColour) Label = "Large Tick Misses", PlaceholderText = "0", MinValue = 0 + }, + sliderTailMissesTextBox = new LimitedLabelledNumberBox + { + RelativeSizeAxes = Axes.X, + Anchor = Anchor.TopLeft, + Label = "Slider Tail Misses", + PlaceholderText = "0", + MinValue = 0 } } } @@ -472,6 +483,7 @@ private void load(OsuColour osuColour) mehsTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); missesTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); largeTickMissesTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); + sliderTailMissesTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); comboTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); scoreTextBox.Value.BindValueChanged(_ => debouncedCalculatePerformance()); @@ -660,10 +672,13 @@ private void calculatePerformance() var accuracy = accuracyTextBox.Value.Value / 100.0; Dictionary statistics = new Dictionary(); + + if (ruleset.Value.OnlineID != -1) { // official rulesets can generate more precise hits from accuracy - statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value); + bool hasSliderAccuracy = !appliedMods.Value.Any(x => x is OsuModClassic cl && cl.NoSliderHeadAccuracy.Value); + statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, hasSliderAccuracy, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value, sliderTailMissesTextBox.Value.Value); accuracy = RulesetHelper.GetAccuracyForRuleset(ruleset.Value, statistics); } @@ -700,6 +715,7 @@ private void populateScoreParams() comboTextBox.Hide(); missesTextBox.Hide(); largeTickMissesTextBox.Hide(); + sliderTailMissesTextBox.Hide(); scoreTextBox.Hide(); if (ruleset.Value.ShortName == "osu" || ruleset.Value.ShortName == "taiko" || ruleset.Value.ShortName == "fruits") @@ -714,6 +730,7 @@ private void populateScoreParams() if (ruleset.Value.ShortName == "osu") { largeTickMissesTextBox.Show(); + sliderTailMissesTextBox.Show(); } } else if (ruleset.Value.ShortName == "mania") @@ -736,6 +753,7 @@ private void populateScoreParams() comboTextBox.Show(); missesTextBox.Show(); largeTickMissesTextBox.Show(); + sliderTailMissesTextBox.Show(); scoreTextBox.Text = string.Empty; scoreTextBox.Show(); From a8d74f3fb6d8b6e506f118c860b2fa29550f4254 Mon Sep 17 00:00:00 2001 From: minisbett <39670899+minisbett@users.noreply.github.com> Date: Sun, 13 Oct 2024 12:04:05 +0200 Subject: [PATCH 2/2] Update hasSliderAccuracy statement --- PerformanceCalculatorGUI/Screens/SimulateScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs index 3c29337e6..746a01710 100644 --- a/PerformanceCalculatorGUI/Screens/SimulateScreen.cs +++ b/PerformanceCalculatorGUI/Screens/SimulateScreen.cs @@ -677,7 +677,7 @@ private void calculatePerformance() if (ruleset.Value.OnlineID != -1) { // official rulesets can generate more precise hits from accuracy - bool hasSliderAccuracy = !appliedMods.Value.Any(x => x is OsuModClassic cl && cl.NoSliderHeadAccuracy.Value); + bool hasSliderAccuracy = !appliedMods.Value.OfType().All(m => m.NoSliderHeadAccuracy.Value); statistics = RulesetHelper.GenerateHitResultsForRuleset(ruleset.Value, hasSliderAccuracy, accuracyTextBox.Value.Value / 100.0, beatmap, missesTextBox.Value.Value, countMeh, countGood, largeTickMissesTextBox.Value.Value, sliderTailMissesTextBox.Value.Value); accuracy = RulesetHelper.GetAccuracyForRuleset(ruleset.Value, statistics);