From f8a5ce0cd2df5e5247ed0affe00ec4d6e8ffc1a7 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 2 Feb 2023 22:32:33 +0900 Subject: [PATCH 001/567] Use stable sort for catch hyperdash generation --- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index ab61b14ac4..c51d3d5c70 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -209,7 +209,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps } } - palpableObjects.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime)); + palpableObjects = palpableObjects.OrderBy(h => h.StartTime).ToList(); double halfCatcherWidth = Catcher.CalculateCatchWidth(beatmap.Difficulty) / 2; From 491ba13b6f1a9dc15c80474fd60970cb66926c3f Mon Sep 17 00:00:00 2001 From: ekrctb Date: Fri, 3 Feb 2023 14:07:21 +0900 Subject: [PATCH 002/567] Factor out palpable obejct enumeration logic --- .../Beatmaps/CatchBeatmap.cs | 21 ++++++++++++++++ .../Beatmaps/CatchBeatmapProcessor.cs | 24 ++++--------------- .../Difficulty/CatchDifficultyCalculator.cs | 8 +++---- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmap.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmap.cs index f009c10a9c..1f05d66b86 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmap.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmap.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Catch.Beatmaps { @@ -38,5 +39,25 @@ namespace osu.Game.Rulesets.Catch.Beatmaps } }; } + + /// + /// Enumerate all s, sorted by their start times. + /// + /// + /// If multiple objects have the same start time, the ordering is preserved (it is a stable sorting). + /// + public static IEnumerable GetPalpableObjects(IEnumerable hitObjects) + { + return hitObjects.SelectMany(selectPalpableObjects).OrderBy(h => h.StartTime); + + IEnumerable selectPalpableObjects(HitObject h) + { + if (h is PalpableCatchHitObject palpable) + yield return palpable; + + foreach (var nested in h.NestedHitObjects.OfType()) + yield return nested; + } + } } } diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index c51d3d5c70..32134912f1 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; @@ -192,24 +191,9 @@ namespace osu.Game.Rulesets.Catch.Beatmaps private static void initialiseHyperDash(IBeatmap beatmap) { - List palpableObjects = new List(); - - foreach (var currentObject in beatmap.HitObjects) - { - if (currentObject is Fruit fruitObject) - palpableObjects.Add(fruitObject); - - if (currentObject is JuiceStream) - { - foreach (var juice in currentObject.NestedHitObjects) - { - if (juice is PalpableCatchHitObject palpableObject && !(juice is TinyDroplet)) - palpableObjects.Add(palpableObject); - } - } - } - - palpableObjects = palpableObjects.OrderBy(h => h.StartTime).ToList(); + var palpableObjects = CatchBeatmap.GetPalpableObjects(beatmap.HitObjects) + .Where(h => h is Fruit || (h is Droplet && h is not TinyDroplet)) + .ToArray(); double halfCatcherWidth = Catcher.CalculateCatchWidth(beatmap.Difficulty) / 2; @@ -221,7 +205,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps int lastDirection = 0; double lastExcess = halfCatcherWidth; - for (int i = 0; i < palpableObjects.Count - 1; i++) + for (int i = 0; i < palpableObjects.Length - 1; i++) { var currentObject = palpableObjects[i]; var nextObject = palpableObjects[i + 1]; diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs index 42cfde268e..959f4830dd 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Beatmaps; using osu.Game.Rulesets.Catch.Difficulty.Preprocessing; using osu.Game.Rulesets.Catch.Difficulty.Skills; using osu.Game.Rulesets.Catch.Mods; @@ -54,13 +55,10 @@ namespace osu.Game.Rulesets.Catch.Difficulty List objects = new List(); // In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream. - foreach (var hitObject in beatmap.HitObjects - .SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects.AsEnumerable() : new[] { obj }) - .Cast() - .OrderBy(x => x.StartTime)) + foreach (var hitObject in CatchBeatmap.GetPalpableObjects(beatmap.HitObjects)) { // We want to only consider fruits that contribute to the combo. - if (hitObject is BananaShower || hitObject is TinyDroplet) + if (hitObject is Banana || hitObject is TinyDroplet) continue; if (lastObject != null) From 3c76cb2fb0cc67763e50770670a0c890c1755cd9 Mon Sep 17 00:00:00 2001 From: Zyf Date: Sat, 8 Jul 2023 17:54:23 +0200 Subject: [PATCH 003/567] Scoring : Use square-root of combo --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 35a7dfe369..0760a89b90 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -293,7 +293,7 @@ namespace osu.Game.Rulesets.Scoring protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type); - protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * (1 + result.ComboAfterJudgement / 10d); + protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, 0.5); protected virtual void ApplyScoreChange(JudgementResult result) { From 175bd3b5782e5858a4445f0de44a412b86788e8d Mon Sep 17 00:00:00 2001 From: Zyf Date: Sat, 8 Jul 2023 19:05:56 +0200 Subject: [PATCH 004/567] Scoring : Move some of the accuracy weight to ComboScore (edited) --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 0760a89b90..ea1140ef71 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -317,8 +317,8 @@ namespace osu.Game.Rulesets.Scoring protected virtual double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 700000 * comboProgress + - 300000 * Math.Pow(Accuracy.Value, 10) * accuracyProgress + + return 700000 * Accuracy.Value * comboProgress + + 300000 * Math.Pow(Accuracy.Value, 8) * accuracyProgress + bonusPortion; } From ecb633f8fbd616b30fbeae5724f86659034ca2eb Mon Sep 17 00:00:00 2001 From: Zyf Date: Sat, 15 Jul 2023 14:55:43 +0200 Subject: [PATCH 005/567] Scoring : Remove ComputeTotalScore overide in OsuScoreProcessor --- osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index f97be0d7ff..dfdf3c58fd 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -17,12 +17,5 @@ namespace osu.Game.Rulesets.Osu.Scoring protected override HitEvent CreateHitEvent(JudgementResult result) => base.CreateHitEvent(result).With((result as OsuHitCircleJudgementResult)?.CursorPositionAtHit); - - protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) - { - return 700000 * comboProgress - + 300000 * Math.Pow(Accuracy.Value, 10) * accuracyProgress - + bonusPortion; - } } } From b672b49e02b6d650f9b207ab908edfd3f4886dc3 Mon Sep 17 00:00:00 2001 From: Zyf Date: Sat, 15 Jul 2023 23:20:49 +0200 Subject: [PATCH 006/567] Scoring : Implement v1 to v3 conversion. --- .../Difficulty/OsuLegacyScoreSimulator.cs | 10 ++- .../StandardisedScoreMigrationTools.cs | 69 +++++++++++++++++-- .../Difficulty/DifficultyAttributes.cs | 10 +++ .../Rulesets/Scoring/ILegacyScoreSimulator.cs | 12 +++- 4 files changed, 92 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs index 980d86e4ad..78245f903a 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs @@ -20,9 +20,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty public int ComboScore { get; private set; } - public double BonusScoreRatio => legacyBonusScore == 0 ? 0 : (double)modernBonusScore / legacyBonusScore; + public int LegacyBonusScore { get; private set; } + + public int MaxCombo { get; private set; } + + public double BonusScoreRatio => LegacyBonusScore == 0 ? 0 : (double)modernBonusScore / LegacyBonusScore; - private int legacyBonusScore; private int modernBonusScore; private int combo; @@ -77,6 +80,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty foreach (var obj in playableBeatmap.HitObjects) simulateHit(obj); + MaxCombo = combo; } private void simulateHit(HitObject hitObject) @@ -164,7 +168,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty if (isBonus) { - legacyBonusScore += scoreIncrease; + LegacyBonusScore += scoreIncrease; modernBonusScore += Judgement.ToNumericResult(bonusResult); } else diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 60530c31cb..61f0d1f195 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -218,7 +218,9 @@ namespace osu.Game.Database { LegacyAccuracyScore = sv1Simulator.AccuracyScore, LegacyComboScore = sv1Simulator.ComboScore, - LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio + LegacyBonusScoreRatio = sv1Simulator.BonusScoreRatio, + LegacyBonusScore = sv1Simulator.LegacyBonusScore, + LegacyMaxCombo = sv1Simulator.MaxCombo, }); } @@ -240,13 +242,16 @@ namespace osu.Game.Database int maximumLegacyAccuracyScore = attributes.LegacyAccuracyScore; int maximumLegacyComboScore = attributes.LegacyComboScore; double maximumLegacyBonusRatio = attributes.LegacyBonusScoreRatio; + int maximumLegacyBonusScore = attributes.LegacyBonusScore; + int maximumLegacyCombo = attributes.LegacyMaxCombo; double modMultiplier = score.Mods.Select(m => m.ScoreMultiplier).Aggregate(1.0, (c, n) => c * n); // The part of total score that doesn't include bonus. int maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; + int maximumLegacyTotalScore = maximumLegacyBaseScore + maximumLegacyBonusScore; - // The combo proportion is calculated as a proportion of maximumLegacyBaseScore. - double comboProportion = Math.Min(1, (double)score.LegacyTotalScore / maximumLegacyBaseScore); + // The combo proportion is calculated as a proportion of maximumLegacyTotalScore. + double comboProportion = (double)score.LegacyTotalScore / maximumLegacyTotalScore; // The bonus proportion makes up the rest of the score that exceeds maximumLegacyBaseScore. double bonusProportion = Math.Max(0, ((long)score.LegacyTotalScore - maximumLegacyBaseScore) * maximumLegacyBonusRatio); @@ -254,9 +259,63 @@ namespace osu.Game.Database switch (score.Ruleset.OnlineID) { case 0: + if(score.MaxCombo == 0 || score.Accuracy == 0) + return (long)Math.Round(( + 0 + + 300000 * Math.Pow(score.Accuracy, 8) + + bonusProportion) * modMultiplier); + + double v3exp = 0.5; // Scorev3 combo exponent + + // Assumption : + // - sliders and slider-ticks are uniformly spread arround the beatmap + // thus we can ignore them without losing much precision (consider a map of hit-circles only !) + // - the Ok/Meh hit results are uniformly spread in the score + // thus we can simplify and consider each hit result to be score.Accuracy without losing much precision + // What is strippedV1/strippedV3 : + // This is the ComboScore of v1/v3 were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), + // based on the previous assumptions. For Scorev1, this is basically the sum of squared combos (because without sliders: object_count == combo). + double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2); + double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + v3exp); + + double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy; + + double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2); + double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + v3exp); + + // Compute approximate lower estimate scorev3 for that play + // That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo) + // And didn't combo anything in the reminder of the map + double possibleMaxComboRepeat = Math.Floor(strippedV1 / strippedV1FromMaxCombo); + double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo; + double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat; + double remainingCombo = Math.Sqrt(remainingStrippedV1); + double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + v3exp); + + double newLowerStrippedV3 = (possibleMaxComboRepeat * strippedV3FromMaxCombo) + remainingStrippedV3; + + // Compute approximate upper estimate scorev3 for that play + // That is, a play were all combos were equal (except MaxCombo) + remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo; + double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; + double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0; + remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, v3exp); + + double newUpperStrippedV3 = strippedV3FromMaxCombo + remainingStrippedV3; + + // Approximate by combining lower and upper estimates + // As the lower-estimate is very pessimistic, we use a 30/70 ratio + // And cap it with 1.2 times the middle-point to avoid overstimates + double strippedV3 = Math.Min( + 0.3 * newLowerStrippedV3 + 0.7 * newUpperStrippedV3, + 1.2 * (newLowerStrippedV3 + newUpperStrippedV3) / 2 + ); + + double newComboScoreProportion = (strippedV3 / maxStrippedV3) * score.Accuracy; + return (long)Math.Round(( - 700000 * comboProportion - + 300000 * Math.Pow(score.Accuracy, 10) + 700000 * newComboScoreProportion * score.Accuracy + + 300000 * Math.Pow(score.Accuracy, 8) + bonusProportion) * modMultiplier); case 1: diff --git a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs index 5a01faa417..69345872c6 100644 --- a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs +++ b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs @@ -64,6 +64,16 @@ namespace osu.Game.Rulesets.Difficulty /// public double LegacyBonusScoreRatio { get; set; } + /// + /// The bonus portion of the legacy (ScoreV1) total score. + /// + public int LegacyBonusScore { get; set; } + + /// + /// The maximum combo of the legacy (ScoreV1) total score. + /// + public int LegacyMaxCombo { get; set; } + /// /// Creates new . /// diff --git a/osu.Game/Rulesets/Scoring/ILegacyScoreSimulator.cs b/osu.Game/Rulesets/Scoring/ILegacyScoreSimulator.cs index 7240f0d73e..68ace15b20 100644 --- a/osu.Game/Rulesets/Scoring/ILegacyScoreSimulator.cs +++ b/osu.Game/Rulesets/Scoring/ILegacyScoreSimulator.cs @@ -23,9 +23,19 @@ namespace osu.Game.Rulesets.Scoring int ComboScore { get; } /// - /// A ratio of new_bonus_score / old_bonus_score for converting the bonus score of legacy scores to the new scoring. + /// The bonus portion of the legacy (ScoreV1) total score. /// This is made up of all judgements that would be or . /// + int LegacyBonusScore { get; } + + /// + /// The maximum combo of the legacy (ScoreV1) total score. + /// + int MaxCombo { get; } + + /// + /// A ratio of new_bonus_score / old_bonus_score for converting the bonus score of legacy scores to the new scoring. + /// double BonusScoreRatio { get; } /// From a97915180f37a87ac5716acdb0bfcafffe9e6452 Mon Sep 17 00:00:00 2001 From: Zyf Date: Sat, 15 Jul 2023 23:30:59 +0200 Subject: [PATCH 007/567] Scoring : Adds fields to Catch/Mania/Taiko Simulators too --- .../Difficulty/CatchLegacyScoreSimulator.cs | 10 +++++++--- .../Difficulty/ManiaLegacyScoreSimulator.cs | 3 +++ .../Difficulty/TaikoLegacyScoreSimulator.cs | 10 +++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index c79fd36d96..284fd23aea 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -20,9 +20,12 @@ namespace osu.Game.Rulesets.Catch.Difficulty public int ComboScore { get; private set; } - public double BonusScoreRatio => legacyBonusScore == 0 ? 0 : (double)modernBonusScore / legacyBonusScore; + public int LegacyBonusScore { get; private set; } + + public int MaxCombo { get; private set; } + + public double BonusScoreRatio => LegacyBonusScore == 0 ? 0 : (double)modernBonusScore / LegacyBonusScore; - private int legacyBonusScore; private int modernBonusScore; private int combo; @@ -74,6 +77,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty foreach (var obj in playableBeatmap.HitObjects) simulateHit(obj); + MaxCombo = combo; } private void simulateHit(HitObject hitObject) @@ -129,7 +133,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty if (isBonus) { - legacyBonusScore += scoreIncrease; + LegacyBonusScore += scoreIncrease; modernBonusScore += Judgement.ToNumericResult(bonusResult); } else diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs index e544428979..f09c911b98 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs @@ -14,6 +14,8 @@ namespace osu.Game.Rulesets.Mania.Difficulty { public int AccuracyScore => 0; public int ComboScore { get; private set; } + public int LegacyBonusScore => 0; + public int MaxCombo { get; private set; } public double BonusScoreRatio => 0; public void Simulate(IWorkingBeatmap workingBeatmap, IBeatmap playableBeatmap, IReadOnlyList mods) @@ -23,6 +25,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty .Aggregate(1.0, (c, n) => c * n); ComboScore = (int)(1000000 * multiplier); + MaxCombo = playableBeatmap.GetMaxCombo(); } } } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index e77327d622..239ec5765c 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -20,9 +20,12 @@ namespace osu.Game.Rulesets.Taiko.Difficulty public int ComboScore { get; private set; } - public double BonusScoreRatio => legacyBonusScore == 0 ? 0 : (double)modernBonusScore / legacyBonusScore; + public int LegacyBonusScore { get; private set; } + + public int MaxCombo { get; private set; } + + public double BonusScoreRatio => LegacyBonusScore == 0 ? 0 : (double)modernBonusScore / LegacyBonusScore; - private int legacyBonusScore; private int modernBonusScore; private int combo; @@ -80,6 +83,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty foreach (var obj in playableBeatmap.HitObjects) simulateHit(obj); + MaxCombo = combo; } private void simulateHit(HitObject hitObject) @@ -189,7 +193,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty if (isBonus) { - legacyBonusScore += scoreIncrease; + LegacyBonusScore += scoreIncrease; modernBonusScore += Judgement.ToNumericResult(bonusResult); } else From bbe4635a5080befefc78cccdf61d196d0941bc5d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Aug 2023 16:07:48 +0900 Subject: [PATCH 008/567] Remove unused usings --- osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index dfdf3c58fd..97980c6d18 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; From 5dee43815c2051cd2bae237082f0307f68e1a283 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Aug 2023 16:13:01 +0900 Subject: [PATCH 009/567] Bump version to allow migration to re-run --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index fbc53b9d70..7a77434f23 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -26,7 +26,7 @@ namespace osu.Game.Database if (score.IsLegacyScore) return false; - if (score.TotalScoreVersion > 30000002) + if (score.TotalScoreVersion > 30000003) return false; // Recalculate the old-style standardised score to see if this was an old lazer score. diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 6868c89d26..a1f984484e 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -30,9 +30,10 @@ namespace osu.Game.Scoring.Legacy /// 30000001: Appends to the end of scores. /// 30000002: Score stored to replay calculated using the Score V2 algorithm. Legacy scores on this version are candidate to Score V1 -> V2 conversion. /// 30000003: First version after converting legacy total score to standardised. + /// 30000004: First version after converting legacy total score to standardised (with combo exponent adjustment). /// /// - public const int LATEST_VERSION = 30000003; + public const int LATEST_VERSION = 30000004; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From 5ddb10281b06ad3696582a4b13706d710b30c284 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 24 Aug 2023 14:55:24 +0900 Subject: [PATCH 010/567] Move combo exponent to shared constant --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 12 +++++------- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 10 +++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 7a77434f23..92290fcf1c 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -270,14 +270,12 @@ namespace osu.Game.Database switch (score.Ruleset.OnlineID) { case 0: - if(score.MaxCombo == 0 || score.Accuracy == 0) + if (score.MaxCombo == 0 || score.Accuracy == 0) return (long)Math.Round(( 0 + 300000 * Math.Pow(score.Accuracy, 8) + bonusProportion) * modMultiplier); - double v3exp = 0.5; // Scorev3 combo exponent - // Assumption : // - sliders and slider-ticks are uniformly spread arround the beatmap // thus we can ignore them without losing much precision (consider a map of hit-circles only !) @@ -287,12 +285,12 @@ namespace osu.Game.Database // This is the ComboScore of v1/v3 were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), // based on the previous assumptions. For Scorev1, this is basically the sum of squared combos (because without sliders: object_count == combo). double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2); - double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + v3exp); + double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy; double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2); - double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + v3exp); + double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); // Compute approximate lower estimate scorev3 for that play // That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo) @@ -301,7 +299,7 @@ namespace osu.Game.Database double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo; double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat; double remainingCombo = Math.Sqrt(remainingStrippedV1); - double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + v3exp); + double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT); double newLowerStrippedV3 = (possibleMaxComboRepeat * strippedV3FromMaxCombo) + remainingStrippedV3; @@ -310,7 +308,7 @@ namespace osu.Game.Database remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo; double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0; - remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, v3exp); + remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, ScoreProcessor.COMBO_EXPONENT); double newUpperStrippedV3 = strippedV3FromMaxCombo + remainingStrippedV3; diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index ea1140ef71..514630b351 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -21,6 +21,14 @@ namespace osu.Game.Rulesets.Scoring { public partial class ScoreProcessor : JudgementProcessor { + /// + /// The exponent applied to combo in the default implementation of . + /// + /// + /// If a custom implementation overrides this may not be relevant. + /// + public const double COMBO_EXPONENT = 0.5; + public const double MAX_SCORE = 1000000; private const double accuracy_cutoff_x = 1; @@ -293,7 +301,7 @@ namespace osu.Game.Rulesets.Scoring protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type); - protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, 0.5); + protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); protected virtual void ApplyScoreChange(JudgementResult result) { From ed886a4dc3e8cd7c0f722471dae0f42fd557b927 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 24 Aug 2023 16:49:42 +0300 Subject: [PATCH 011/567] Added a true AR/OD display when using DT/HT --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index a383298faa..c88bb2cb77 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -126,6 +126,22 @@ namespace osu.Game.Screens.Select.Details mod.ApplyToDifficulty(adjustedDifficulty); } + if (baseDifficulty != null && mods.Value.Any(m => m is ModRateAdjust)) + { + adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.Value.OfType()) + { + double speedChange = (float)mod.SpeedChange.Value; + + double preempt = (int)IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450) / speedChange; + adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); + + float hitwindow300 = (80.0f - 6 * adjustedDifficulty.OverallDifficulty) / (float)speedChange; + adjustedDifficulty.OverallDifficulty = (80.0f - hitwindow300) / 6; + } + } + switch (BeatmapInfo?.Ruleset.OnlineID) { case 3: From a885bf6ebf5081c52cf3c0eaa36d13ccafe1d5b0 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 21:05:40 +0200 Subject: [PATCH 012/567] feat(editor/checks): check for delayed hitsounds I really just borrowed the implementation from MapsetVerifier --- .../Checks/CheckDelayedHitsoundsTest.cs | 97 ++++++++++++ .../Samples/hitsound-consequent-delay.wav | Bin 0 -> 49994 bytes .../Resources/Samples/hitsound-delay.wav | Bin 0 -> 49274 bytes .../Samples/hitsound-minor-delay.wav | Bin 0 -> 48562 bytes .../Resources/Samples/hitsound-no-delay.wav | Bin 0 -> 48210 bytes osu.Game/Rulesets/Edit/BeatmapVerifier.cs | 1 + .../Edit/Checks/CheckDelayedHitsounds.cs | 138 ++++++++++++++++++ 7 files changed, 236 insertions(+) create mode 100644 osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs create mode 100644 osu.Game.Tests/Resources/Samples/hitsound-consequent-delay.wav create mode 100644 osu.Game.Tests/Resources/Samples/hitsound-delay.wav create mode 100644 osu.Game.Tests/Resources/Samples/hitsound-minor-delay.wav create mode 100644 osu.Game.Tests/Resources/Samples/hitsound-no-delay.wav create mode 100644 osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs diff --git a/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs new file mode 100644 index 0000000000..5be76327b3 --- /dev/null +++ b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs @@ -0,0 +1,97 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.IO; +using System.Linq; +using ManagedBass; +using Moq; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Models; +using osu.Game.Rulesets.Edit; +using osu.Game.Rulesets.Edit.Checks; +using osu.Game.Rulesets.Objects; +using osu.Game.Tests.Beatmaps; +using osu.Game.Tests.Resources; +using osuTK.Audio; + +namespace osu.Game.Tests.Editing.Checks +{ + [TestFixture] + public class CheckDelayedHitsoundsTest + { + private CheckDelayedHitsounds check = null!; + private IBeatmap beatmap = null!; + + [SetUp] + public void SetUp() + { + check = new CheckDelayedHitsounds(); + beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BeatmapSet = new BeatmapSetInfo + { + Files = + { + new RealmNamedFileUsage(new RealmFile { Hash = "abcdef" }, "normal-hitnormal.wav"), + } + } + } + }; + + if (!Bass.Init(0) && Bass.LastError != Errors.Already) + throw new AudioException("Could not initialize Bass."); + } + + [Test] + public void TestNoDelayedHitsounds() + { + using var resourceStream = TestResources.OpenResource("Samples/hitsound-no-delay.wav"); + Assert.IsEmpty(check.Run(getContext(resourceStream))); + } + + [Test] + public void TestMinorDelayedHitsounds() + { + using (var resourceStream = TestResources.OpenResource("Samples/hitsound-minor-delay.wav")) + { + var issues = check.Run(getContext(resourceStream)).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckDelayedHitsounds.IssuTemplateMinorDelay); + } + } + + [Test] + public void TestDelayedHitsounds() + { + using var resourceStream = TestResources.OpenResource("Samples/hitsound-delay.wav"); + + var issues = check.Run(getContext(resourceStream)).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckDelayedHitsounds.IssueTemplateDelay); + } + + [Test] + public void TestConsequentlyDelayedHitsounds() + { + using var resourceStream = TestResources.OpenResource("Samples/hitsound-consequent-delay.wav"); + + var issues = check.Run(getContext(resourceStream)).ToList(); + + Assert.That(issues, Has.Count.EqualTo(1)); + Assert.That(issues.Single().Template is CheckDelayedHitsounds.IssueTemplateConsequentDelay); + } + + private BeatmapVerifierContext getContext(Stream? resourceStream) + { + var mockWorkingBeatmap = new Mock(beatmap, null, null); + mockWorkingBeatmap.Setup(w => w.GetStream(It.IsAny())).Returns(resourceStream); + + return new BeatmapVerifierContext(beatmap, mockWorkingBeatmap.Object); + } + } +} diff --git a/osu.Game.Tests/Resources/Samples/hitsound-consequent-delay.wav b/osu.Game.Tests/Resources/Samples/hitsound-consequent-delay.wav new file mode 100644 index 0000000000000000000000000000000000000000..049e54c62f62e0c42f6b8445c3aa3ee77d773146 GIT binary patch literal 49994 zcmeFTgK| z=0f8CUMZpfY8&4EJN{jXlHyT->@*9Ikvfzt`3gvs1ms_dlXXV`xzt@ij&26zoGs}8 z`1rf(R52ue_k~2yVUXxIga40@zcPmX`!;L`BqRsmf1&~8=M;o|RS3uly1#Y-iTy_+ zBueJK0p#%gf9L);{{QuXl01QlAmP1^A$q@y`Y>4X*Dg+S1R(7y5VCzcK)%cRcjaHX z=PDrQKl>Xs@}K9w+Q@&j(~T34Kw{QgNYovM#Lw|O@vQ?Sg2Fm({F|2x(;bsSx*#M= z*u46i6U#V24sitJv;sh$|L|zXzuB04JnlJ|w0#HnpFC5CdBW`)B+l1BB329kv+sX% zJktge-bzS}Bu9?`mI9I|+TVo4hg_bh z(m-PK5cWT|UPmVf_Ur)jKf86l-LVXid9P4%Rw^Llj$owoV?b`oo^g8Ej}I?M!#4J9 zm*G+GXKUs|qR*zk(WI>m+Mpi65xv47p+kgA!s~B@En%mNQ|$+|-t-vxr-?cLvw!{S z;&8Z=&u#ZWW*YDT-W|DD7!Y^NW5c-gnDiL+xcm;zi+4mHT)Sn?)di4PJRK4pr)n41 zjt>|unG_dOu&}~6Wad08n~7PnrUXCdZ3`>>iss~bCru0VEgw@8u{ykV;Us5B+;L}# zm;R7g?+A%7B_vkkkf?=_=q`iAPe1#$^a%MhjwtO1iQhpyvC0V&2_BGm(+(1|Izr-h zFG%zs3W)<_S1-*TUEc0M{8)YJg2t~r;gSvss}~%R@DUON8#u!32??JC|7H#n;-!$7 zHwF^%9U&2B1&MAfB-S-TVq_5{w&X+NOx^UgI7|z>(tu=$D=mM|_J3{v<+ye(PasSF&i>2$$HRDH>_|xDuHgymEs%&`bKUpdlAUjI zC)%Dk)E6Ody908h1(5lbfV}kyC7rGTvgCi*@GmFu|EW2Q#K?7r0Es>U&{jItmhF20)@|7)R8`L*l`Bo|rdc%BI-PkQgGXUO2Jpx>Nr1 z>}$P_|KB>p{^Rd&E&sLrzyAL23L!h30;KzkclUb!8D3msex}Y+W^>zIQ(a3vCx?Z5 zz8}!nMLr==xpS-s-7coSyddP&hdqkmr_nmA`}>M#-P-i>!cCvU;kN*peh(!>9|Cg4 z69H-e43LqpaB}v0K=%Cx$n~X`?d$bu_9R7}!>nM{2yPH0nx{dc?;@V)wg?jS(;zXX zKTibtLgE&L#Hmt9y#4@*pj0>$J`?m(enFX@l?kuHEc?kqB_R8HAY_3zAPHBL6iNa4 zuo)pQenCjZT%J zi4AS{{-F$zuJtInCnmvak;BkmtlILvrZ!6}259Q4 zuj}0#j&OCdB87c7H@^c@ZF)y-oi-8@mTAcHnE4~e&6w9U%0A(>-@ftoVDXUe-_$+o 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%0A7^^2*RBR6Fw))0YRq>W0zE%~VDXS@eA8}W7 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

&C8fOT$VJ9O|+WN9Jbxc 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 literal 0 HcmV?d00001 diff --git a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs index 6782c4324a..dcf5eb4da9 100644 --- a/osu.Game/Rulesets/Edit/BeatmapVerifier.cs +++ b/osu.Game/Rulesets/Edit/BeatmapVerifier.cs @@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Edit new CheckFewHitsounds(), new CheckTooShortAudioFiles(), new CheckAudioInVideo(), + new CheckDelayedHitsounds(), // Files new CheckZeroByteFiles(), diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs new file mode 100644 index 0000000000..b4fe6c70ef --- /dev/null +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -0,0 +1,138 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using osu.Framework.Audio.Track; +using osu.Game.Audio; +using osu.Game.Extensions; +using osu.Game.Rulesets.Edit.Checks.Components; + +namespace osu.Game.Rulesets.Edit.Checks +{ + public class CheckDelayedHitsounds : ICheck + { + ///

+ /// Threshold at which point the sample is considered silent. + /// + private const float silence_threshold = 0.001f; + + private const float falloff_factor = 0.95f; + private const int delay_threshold = 5; + private const int delay_threshold_negligible = 1; + + private readonly string[] audioExtensions = { "mp3", "ogg", "wav" }; + private readonly string[] sampleBankPrefixes = { HitSampleInfo.BANK_NORMAL, HitSampleInfo.BANK_SOFT, HitSampleInfo.BANK_DRUM }; + + public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Audio, "Delayed hit sounds."); + + public IEnumerable PossibleTemplates => new IssueTemplate[] + { + new IssueTemplateConsequentDelay(this), + new IssueTemplateDelay(this), + new IssuTemplateMinorDelay(this) + }; + + private float getAverageAmplitude(Waveform.Point point) => (point.AmplitudeLeft + point.AmplitudeRight) / 2; + + public IEnumerable Run(BeatmapVerifierContext context) + { + var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet; + + if (beatmapSet == null) + yield break; + + foreach (var file in beatmapSet.Files) + { + using (Stream stream = context.WorkingBeatmap.GetStream(file.File.GetStoragePath())) + { + if (stream == null) + continue; + + if (!hasAudioExtension(file.Filename)) + continue; + + if (!isHitSound(file.Filename)) + continue; + + Waveform waveform = new Waveform(stream); + + var points = waveform.GetPoints(); + + // Skip muted samples + if (points.Length == 0 || points.Sum(getAverageAmplitude) <= silence_threshold) + continue; + + float maxAmplitude = points.Select(getAverageAmplitude).Max(); + + int consequentDelay = 0; + int delay = 0; + float amplitude = 0; + + while (delay + consequentDelay < points.Length) + { + amplitude += getAverageAmplitude(points[delay]); + + // Reached peak amplitude/transient + if (amplitude >= maxAmplitude) + break; + + amplitude *= falloff_factor; + + if (amplitude < silence_threshold) + { + amplitude = 0; + consequentDelay++; + } + + delay++; + } + + if (consequentDelay >= delay_threshold) + yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); + else if (consequentDelay + delay >= delay_threshold) + yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); + else if (consequentDelay + delay >= delay_threshold_negligible) + yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + } + } + } + + private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLowerInvariant().EndsWith); + private bool isHitSound(string filename) => sampleBankPrefixes.Select(p => p + "-").Any(filename.ToLowerInvariant().StartsWith); + + public class IssueTemplateConsequentDelay : IssueTemplate + { + public IssueTemplateConsequentDelay(ICheck check) + : base(check, IssueType.Error, + "\"{0}\" has a {1:0.##} ms period of complete silence at the start.") + { + } + + public Issue Create(string filename, int pureDelay) => new Issue(this, filename, pureDelay); + } + + public class IssueTemplateDelay : IssueTemplate + { + public IssueTemplateDelay(ICheck check) + : base(check, IssueType.Warning, + "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") + { + } + + public Issue Create(string filename, int pureDelay, int delay) => new Issue(this, filename, delay, pureDelay); + } + + public class IssuTemplateMinorDelay : IssueTemplate + { + public IssuTemplateMinorDelay(ICheck check) + : base(check, IssueType.Negligible, + "\"{0}\"has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") + { + } + + public Issue Create(string filename, int pureDelay, int delay) => new Issue(this, filename, delay, pureDelay); + } + } +} From df55a2f6839e399fb530476327086713c840f177 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 21:31:04 +0200 Subject: [PATCH 013/567] style(editor/checks): fix inconsistent argument names --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index b4fe6c70ef..0591ad866d 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Edit.Checks public class IssueTemplateConsequentDelay : IssueTemplate { public IssueTemplateConsequentDelay(ICheck check) - : base(check, IssueType.Error, + : base(check, IssueType.Problem, "\"{0}\" has a {1:0.##} ms period of complete silence at the start.") { } @@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Edit.Checks { } - public Issue Create(string filename, int pureDelay, int delay) => new Issue(this, filename, delay, pureDelay); + public Issue Create(string filename, int consequentDelay, int delay) => new Issue(this, filename, delay, consequentDelay); } public class IssuTemplateMinorDelay : IssueTemplate @@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Edit.Checks { } - public Issue Create(string filename, int pureDelay, int delay) => new Issue(this, filename, delay, pureDelay); + public Issue Create(string filename, int consequentDelay, int delay) => new Issue(this, filename, delay, consequentDelay); } } } From 208e94e9be533129024b500b996bb48b41931368 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 21:33:54 +0200 Subject: [PATCH 014/567] style(editor/checks): add type nullability for `Stream` --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 0591ad866d..6afc8d7a5d 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Edit.Checks foreach (var file in beatmapSet.Files) { - using (Stream stream = context.WorkingBeatmap.GetStream(file.File.GetStoragePath())) + using (Stream? stream = context.WorkingBeatmap.GetStream(file.File.GetStoragePath())) { if (stream == null) continue; From 273593a0eefecf091ed64674ceacc286d965023b Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 23:25:42 +0200 Subject: [PATCH 015/567] style: typo --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 6afc8d7a5d..1c2ef94815 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -128,7 +128,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public IssuTemplateMinorDelay(ICheck check) : base(check, IssueType.Negligible, - "\"{0}\"has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") + "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") { } From f7599c5bc4d89a96b4d204e091098ea7b3caff77 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 23:41:56 +0200 Subject: [PATCH 016/567] style: reword --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 1c2ef94815..3064a41eef 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -117,7 +117,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public IssueTemplateDelay(ICheck check) : base(check, IssueType.Warning, - "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") + "\"{0}\" has its transient delayed by ~{1:0.##} ms, preceded by {2:0.##} ms of complete silence.") { } @@ -128,7 +128,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public IssuTemplateMinorDelay(ICheck check) : base(check, IssueType.Negligible, - "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") + "\"{0}\" has its transient delayed by ~{1:0.##} ms, preceded by {2:0.##} ms of complete silence.") { } From 50dbf564a58d75b096fa0e76673f0c845db12168 Mon Sep 17 00:00:00 2001 From: tsrk Date: Thu, 24 Aug 2023 23:51:34 +0200 Subject: [PATCH 017/567] revert: use old wording This makes more sense wrt to the complete silence thing. Refs: f7599c5b --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 3064a41eef..1c2ef94815 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -117,7 +117,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public IssueTemplateDelay(ICheck check) : base(check, IssueType.Warning, - "\"{0}\" has its transient delayed by ~{1:0.##} ms, preceded by {2:0.##} ms of complete silence.") + "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") { } @@ -128,7 +128,7 @@ namespace osu.Game.Rulesets.Edit.Checks { public IssuTemplateMinorDelay(ICheck check) : base(check, IssueType.Negligible, - "\"{0}\" has its transient delayed by ~{1:0.##} ms, preceded by {2:0.##} ms of complete silence.") + "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") { } From 17b9b1649a0434b41df43a0ffe24363efbb9ac2e Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 25 Aug 2023 00:58:26 +0300 Subject: [PATCH 018/567] Fixed "works only for std" problem 1) Now it use AR/OD calculation from Ruleset class 2) Implemented needed functions in each of default rulesets --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 4 ++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 4 ++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 7 +++++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 3 +++ osu.Game/Rulesets/Ruleset.cs | 8 ++++++++ osu.Game/Screens/Select/Details/AdvancedStats.cs | 8 +++----- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index bd6b857fe8..a63e604204 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -232,5 +232,9 @@ namespace osu.Game.Rulesets.Catch }), }; } + + public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); + public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 4507015169..181e932788 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -427,6 +427,10 @@ namespace osu.Game.Rulesets.Mania public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection(); public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); + + public override double HitwindowFromOd(float OD) => 64.0 - 3 * OD; + public override float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; + public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); } public enum PlayfieldType diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 220dc53705..fa575192c6 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -328,5 +328,12 @@ namespace osu.Game.Rulesets.Osu } public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); + + public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); + public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public override double HitwindowFromOd(float OD) => 80.0 - 6 * OD; + public override float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; + public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); + public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 584a91bfdc..23d732645e 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -263,5 +263,8 @@ namespace osu.Game.Rulesets.Taiko }), true) }; } + public override double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; + public override float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); + public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); } } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index be0d757e06..ed4bc0ea7a 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -389,5 +389,13 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. ///
public virtual DifficultySection? CreateEditorDifficultySection() => null; + + public virtual double PreemptFromAr(float AR) => 0; + public virtual float ArFromPreempt(double preempt) => 5; + public virtual double HitwindowFromOd(float OD) => 0; + public virtual float OdFromHitwindow(double hitwindow300) => 0; + + public virtual float ChangeArFromRate(float AR, double rate) => AR; + public virtual float ChangeOdFromRate(float OD, double rate) => OD; } } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index c88bb2cb77..2f97c9ddf8 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -133,12 +133,10 @@ namespace osu.Game.Screens.Select.Details foreach (var mod in mods.Value.OfType()) { double speedChange = (float)mod.SpeedChange.Value; + Ruleset ruleset = gameRuleset.Value.CreateInstance(); - double preempt = (int)IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450) / speedChange; - adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); - - float hitwindow300 = (80.0f - 6 * adjustedDifficulty.OverallDifficulty) / (float)speedChange; - adjustedDifficulty.OverallDifficulty = (80.0f - hitwindow300) / 6; + adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(adjustedDifficulty.ApproachRate, speedChange); + adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, speedChange); } } From 772633178ca95956fbc75ceea4870f1bc755c9a0 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 25 Aug 2023 01:02:12 +0300 Subject: [PATCH 019/567] Moved ruleset decl in right place --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 2f97c9ddf8..5e698204ae 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -129,11 +129,11 @@ namespace osu.Game.Screens.Select.Details if (baseDifficulty != null && mods.Value.Any(m => m is ModRateAdjust)) { adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + Ruleset ruleset = gameRuleset.Value.CreateInstance(); foreach (var mod in mods.Value.OfType()) { double speedChange = (float)mod.SpeedChange.Value; - Ruleset ruleset = gameRuleset.Value.CreateInstance(); adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(adjustedDifficulty.ApproachRate, speedChange); adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, speedChange); From f05659a1c0e3f542c9aa9cd5975fe0c4fb7f6b5b Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 25 Aug 2023 00:10:21 +0200 Subject: [PATCH 020/567] test: explicit samples timings --- .../Editing/Checks/CheckDelayedHitsoundsTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs index 5be76327b3..912b916a84 100644 --- a/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs @@ -55,6 +55,9 @@ namespace osu.Game.Tests.Editing.Checks [Test] public void TestMinorDelayedHitsounds() { + // 1 ms of silence -> 1 ms of noise at 0.3 amplitude -> hitsound transient + // => The transient is delayed by 2 ms + // Waveform: https://github.com/ppy/osu/assets/39100084/d5b9edbe-0ba2-401d-94b0-6d57228bdbd3 using (var resourceStream = TestResources.OpenResource("Samples/hitsound-minor-delay.wav")) { var issues = check.Run(getContext(resourceStream)).ToList(); @@ -67,6 +70,9 @@ namespace osu.Game.Tests.Editing.Checks [Test] public void TestDelayedHitsounds() { + // 3 ms of silence -> 3 ms of noise at 0.3 amplitude -> hitsound transient + // => The transient is delayed by 6 ms + // Waveform: https://github.com/ppy/osu/assets/39100084/2509ff35-d908-414b-b7b9-583681348772 using var resourceStream = TestResources.OpenResource("Samples/hitsound-delay.wav"); var issues = check.Run(getContext(resourceStream)).ToList(); @@ -78,6 +84,8 @@ namespace osu.Game.Tests.Editing.Checks [Test] public void TestConsequentlyDelayedHitsounds() { + // The hitsound is delayed by 10 ms + // Waveform: https://github.com/ppy/osu/assets/39100084/3a7ede0d-8523-4b99-a222-3624cd208267 using var resourceStream = TestResources.OpenResource("Samples/hitsound-consequent-delay.wav"); var issues = check.Run(getContext(resourceStream)).ToList(); From d5ac93f631dd5b9ef7e4f753a21224921efddc9a Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 25 Aug 2023 01:25:12 +0300 Subject: [PATCH 021/567] Added "value is rate changed" indication Now if AR or OD value is not "true" and changed through rate - it will appear with symbol `*` Instead of `11` it wil show as `11*` --- .../Screens/Select/Details/AdvancedStats.cs | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 5e698204ae..4b7eee380d 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -44,6 +44,9 @@ namespace osu.Game.Screens.Select.Details protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; private readonly StatisticRow starDifficulty; + private bool isArRateAdjusted { get; set; } + private bool isOdRateAdjusted { get; set; } + private IBeatmapInfo beatmapInfo; public IBeatmapInfo BeatmapInfo @@ -117,6 +120,8 @@ namespace osu.Game.Screens.Select.Details { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; + isArRateAdjusted = false; + isOdRateAdjusted = false; if (baseDifficulty != null && mods.Value.Any(m => m is IApplicableToDifficulty)) { @@ -135,8 +140,14 @@ namespace osu.Game.Screens.Select.Details { double speedChange = (float)mod.SpeedChange.Value; - adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(adjustedDifficulty.ApproachRate, speedChange); - adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, speedChange); + float ar = adjustedDifficulty.ApproachRate; + float od = adjustedDifficulty.OverallDifficulty; + + adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(ar, speedChange); + adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(od, speedChange); + + if (adjustedDifficulty.ApproachRate != ar) isArRateAdjusted = true; + if (adjustedDifficulty.OverallDifficulty != od) isOdRateAdjusted = true; } } @@ -146,18 +157,18 @@ namespace osu.Game.Screens.Select.Details // Account for mania differences locally for now // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes FirstValue.Title = BeatmapsetsStrings.ShowStatsCsMania; - FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null); + FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null, false); break; default: FirstValue.Title = BeatmapsetsStrings.ShowStatsCs; - FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize); + FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize, false); break; } - HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate); - Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty); - ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate); + HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate, false); + Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, isOdRateAdjusted); + ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, isArRateAdjusted); updateStarDifficulty(); } @@ -191,7 +202,7 @@ namespace osu.Game.Screens.Select.Details if (normalDifficulty == null || moddedDifficulty == null) return; - starDifficulty.Value = ((float)normalDifficulty.Value.Stars, (float)moddedDifficulty.Value.Stars); + starDifficulty.Value = ((float)normalDifficulty.Value.Stars, (float)moddedDifficulty.Value.Stars, false); }), starDifficultyCancellationSource.Token, TaskContinuationOptions.OnlyOnRanToCompletion, TaskScheduler.Current); }); @@ -222,11 +233,11 @@ namespace osu.Game.Screens.Select.Details set => name.Text = value; } - private (float baseValue, float? adjustedValue)? value; + private (float baseValue, float? adjustedValue, bool isRateAdjusted)? value; - public (float baseValue, float? adjustedValue) Value + public (float baseValue, float? adjustedValue, bool isRateAdjusted) Value { - get => value ?? (0, null); + get => value ?? (0, null, false); set { if (value == this.value) @@ -237,6 +248,7 @@ namespace osu.Game.Screens.Select.Details bar.Length = value.baseValue / maxValue; valueText.Text = (value.adjustedValue ?? value.baseValue).ToString(forceDecimalPlaces ? "0.00" : "0.##"); + if (value.isRateAdjusted) valueText.Text += "*"; ModBar.Length = (value.adjustedValue ?? 0) / maxValue; if (Precision.AlmostEquals(value.baseValue, value.adjustedValue ?? value.baseValue, 0.05f)) From 4c32e9a479b411df17649b52a7f0f4c6f528dff1 Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 25 Aug 2023 00:37:45 +0200 Subject: [PATCH 022/567] style: use more rigorous hitsound filtering --- .../Edit/Checks/CheckDelayedHitsounds.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 1c2ef94815..124a549088 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -23,7 +23,8 @@ namespace osu.Game.Rulesets.Edit.Checks private const int delay_threshold_negligible = 1; private readonly string[] audioExtensions = { "mp3", "ogg", "wav" }; - private readonly string[] sampleBankPrefixes = { HitSampleInfo.BANK_NORMAL, HitSampleInfo.BANK_SOFT, HitSampleInfo.BANK_DRUM }; + private readonly string[] bankNames = { HitSampleInfo.BANK_NORMAL, HitSampleInfo.BANK_SOFT, HitSampleInfo.BANK_DRUM }; + private readonly string[] sampleSets = { HitSampleInfo.HIT_NORMAL, HitSampleInfo.HIT_WHISTLE, HitSampleInfo.HIT_FINISH, HitSampleInfo.HIT_CLAP }; public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Audio, "Delayed hit sounds."); @@ -100,7 +101,20 @@ namespace osu.Game.Rulesets.Edit.Checks } private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLowerInvariant().EndsWith); - private bool isHitSound(string filename) => sampleBankPrefixes.Select(p => p + "-").Any(filename.ToLowerInvariant().StartsWith); + + private bool isHitSound(string filename) + { + // - + string[] parts = filename.ToLowerInvariant().Split('-'); + + if (parts.Length != 2) + return false; + + string bank = parts[0]; + string sampleSet = parts[1]; + + return bankNames.Contains(bank) && sampleSets.Any(sampleSet.StartsWith); + } public class IssueTemplateConsequentDelay : IssueTemplate { From 29a46f5b368273e8acf874a8c7182a93293b35fd Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 25 Aug 2023 11:46:09 +0200 Subject: [PATCH 023/567] style(editor/checks): add issues for delays with no silence --- .../Edit/Checks/CheckDelayedHitsounds.cs | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 124a549088..323888a450 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -32,7 +32,9 @@ namespace osu.Game.Rulesets.Edit.Checks { new IssueTemplateConsequentDelay(this), new IssueTemplateDelay(this), - new IssuTemplateMinorDelay(this) + new IssueTemplateDelayNoSilence(this), + new IssuTemplateMinorDelay(this), + new IssuTemplateMinorDelayNoSilence(this), }; private float getAverageAmplitude(Waveform.Point point) => (point.AmplitudeLeft + point.AmplitudeRight) / 2; @@ -93,9 +95,19 @@ namespace osu.Game.Rulesets.Edit.Checks if (consequentDelay >= delay_threshold) yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); else if (consequentDelay + delay >= delay_threshold) - yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); + { + if (consequentDelay > 0) + yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssueTemplateDelayNoSilence(this).Create(file.Filename, delay); + } else if (consequentDelay + delay >= delay_threshold_negligible) - yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + { + if (consequentDelay > 0) + yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssuTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); + } } } } @@ -138,6 +150,17 @@ namespace osu.Game.Rulesets.Edit.Checks public Issue Create(string filename, int consequentDelay, int delay) => new Issue(this, filename, delay, consequentDelay); } + public class IssueTemplateDelayNoSilence : IssueTemplate + { + public IssueTemplateDelayNoSilence(ICheck check) + : base(check, IssueType.Warning, + "\"{0}\" has a transient delay of ~{1:0.##} ms.") + { + } + + public Issue Create(string filename, int delay) => new Issue(this, filename, delay); + } + public class IssuTemplateMinorDelay : IssueTemplate { public IssuTemplateMinorDelay(ICheck check) @@ -148,5 +171,16 @@ namespace osu.Game.Rulesets.Edit.Checks public Issue Create(string filename, int consequentDelay, int delay) => new Issue(this, filename, delay, consequentDelay); } + + public class IssuTemplateMinorDelayNoSilence : IssueTemplate + { + public IssuTemplateMinorDelayNoSilence(ICheck check) + : base(check, IssueType.Negligible, + "\"{0}\" has a transient delay of ~{1:0.##} ms.") + { + } + + public Issue Create(string filename, int delay) => new Issue(this, filename, delay); + } } } From 290f8db341c7dc168bf7a93a80a364199bc19dcc Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 26 Aug 2023 02:13:14 +0300 Subject: [PATCH 024/567] fixed stated problems removed functions from `Ruleset.cs` and added a `GetEffectiveDifficulty()` instead --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 40 ++++++++++++++-- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 38 +++++++++++++-- osu.Game.Rulesets.Osu/OsuRuleset.cs | 46 ++++++++++++++++--- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 37 +++++++++++++-- osu.Game/Rulesets/Ruleset.cs | 9 +--- .../Screens/Select/Details/AdvancedStats.cs | 37 ++------------- 6 files changed, 152 insertions(+), 55 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index a63e604204..4f499cee62 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Linq; using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; @@ -233,8 +234,41 @@ namespace osu.Game.Rulesets.Catch }; } - public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; - public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); + public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); + public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); + + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + { + BeatmapDifficulty? adjustedDifficulty = null; + isRateAdjusted = (false, false); + + if (mods.Any(m => m is IApplicableToDifficulty)) + { + adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + mod.ApplyToDifficulty(adjustedDifficulty); + } + + if (mods.Any(m => m is ModRateAdjust)) + { + adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + { + double speedChange = (float)mod.SpeedChange.Value; + + float ar = adjustedDifficulty.ApproachRate; + float od = adjustedDifficulty.OverallDifficulty; + + adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); + + if (adjustedDifficulty.ApproachRate != ar) isRateAdjusted.AR = true; + } + } + + return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + } } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 181e932788..7d16806397 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -428,9 +428,41 @@ namespace osu.Game.Rulesets.Mania public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); - public override double HitwindowFromOd(float OD) => 64.0 - 3 * OD; - public override float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; - public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public double HitwindowFromOd(float OD) => 64.0 - 3 * OD; + public float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; + public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + { + BeatmapDifficulty? adjustedDifficulty = null; + isRateAdjusted = (false, false); + + if (mods.Any(m => m is IApplicableToDifficulty)) + { + adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + mod.ApplyToDifficulty(adjustedDifficulty); + } + + if (mods.Any(m => m is ModRateAdjust)) + { + adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + { + double speedChange = (float)mod.SpeedChange.Value; + + float od = adjustedDifficulty.OverallDifficulty; + + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); + + if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + } + } + + return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + } + } public enum PlayfieldType diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index fa575192c6..250685ec0f 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -329,11 +329,45 @@ namespace osu.Game.Rulesets.Osu public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); - public override double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public override float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; - public override double HitwindowFromOd(float OD) => 80.0 - 6 * OD; - public override float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; - public override float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); - public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); + public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public double HitwindowFromOd(float OD) => 80.0 - 6 * OD; + public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; + public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); + public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + { + BeatmapDifficulty? adjustedDifficulty = null; + isRateAdjusted = (false, false); + + if (mods.Any(m => m is IApplicableToDifficulty)) + { + adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + mod.ApplyToDifficulty(adjustedDifficulty); + } + + if (mods.Any(m => m is ModRateAdjust)) + { + adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + { + double speedChange = (float)mod.SpeedChange.Value; + + float ar = adjustedDifficulty.ApproachRate; + float od = adjustedDifficulty.OverallDifficulty; + + adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); + + if (adjustedDifficulty.ApproachRate != ar) isRateAdjusted.AR = true; + if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + } + } + + return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + } } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 23d732645e..801e46f9c3 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -263,8 +263,39 @@ namespace osu.Game.Rulesets.Taiko }), true) }; } - public override double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; - public override float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); - public override float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; + public float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); + public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + { + BeatmapDifficulty? adjustedDifficulty = null; + isRateAdjusted = (false, false); + + if (mods.Any(m => m is IApplicableToDifficulty)) + { + adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + mod.ApplyToDifficulty(adjustedDifficulty); + } + + if (mods.Any(m => m is ModRateAdjust)) + { + adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.OfType()) + { + double speedChange = (float)mod.SpeedChange.Value; + + float od = adjustedDifficulty.OverallDifficulty; + + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); + + if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + } + } + + return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + } } } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index ed4bc0ea7a..0f7655812a 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -389,13 +389,6 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. ///
public virtual DifficultySection? CreateEditorDifficultySection() => null; - - public virtual double PreemptFromAr(float AR) => 0; - public virtual float ArFromPreempt(double preempt) => 5; - public virtual double HitwindowFromOd(float OD) => 0; - public virtual float OdFromHitwindow(double hitwindow300) => 0; - - public virtual float ChangeArFromRate(float AR, double rate) => AR; - public virtual float ChangeOdFromRate(float OD, double rate) => OD; + public virtual BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) => (BeatmapDifficulty)baseDifficulty; } } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 4b7eee380d..4a0eed86f8 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -15,7 +15,6 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using System.Collections.Generic; using osu.Game.Rulesets.Mods; -using System.Linq; using System.Threading; using System.Threading.Tasks; using osu.Framework.Extensions; @@ -44,9 +43,6 @@ namespace osu.Game.Screens.Select.Details protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; private readonly StatisticRow starDifficulty; - private bool isArRateAdjusted { get; set; } - private bool isOdRateAdjusted { get; set; } - private IBeatmapInfo beatmapInfo; public IBeatmapInfo BeatmapInfo @@ -120,35 +116,12 @@ namespace osu.Game.Screens.Select.Details { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; - isArRateAdjusted = false; - isOdRateAdjusted = false; + (bool AR, bool OD) isRateAdjusted = (false, false); - if (baseDifficulty != null && mods.Value.Any(m => m is IApplicableToDifficulty)) + if (baseDifficulty != null) { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.Value.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - } - - if (baseDifficulty != null && mods.Value.Any(m => m is ModRateAdjust)) - { - adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); Ruleset ruleset = gameRuleset.Value.CreateInstance(); - - foreach (var mod in mods.Value.OfType()) - { - double speedChange = (float)mod.SpeedChange.Value; - - float ar = adjustedDifficulty.ApproachRate; - float od = adjustedDifficulty.OverallDifficulty; - - adjustedDifficulty.ApproachRate = ruleset.ChangeArFromRate(ar, speedChange); - adjustedDifficulty.OverallDifficulty = ruleset.ChangeOdFromRate(od, speedChange); - - if (adjustedDifficulty.ApproachRate != ar) isArRateAdjusted = true; - if (adjustedDifficulty.OverallDifficulty != od) isOdRateAdjusted = true; - } + adjustedDifficulty = ruleset.GetEffectiveDifficulty(baseDifficulty, mods.Value, ref isRateAdjusted); } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -167,8 +140,8 @@ namespace osu.Game.Screens.Select.Details } HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate, false); - Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, isOdRateAdjusted); - ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, isArRateAdjusted); + Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, isRateAdjusted.OD); + ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, isRateAdjusted.AR); updateStarDifficulty(); } From a04333c17bdc8ed82b99a57ce04b609b6f9a6b5b Mon Sep 17 00:00:00 2001 From: tsrk Date: Tue, 29 Aug 2023 19:42:37 +0200 Subject: [PATCH 025/567] style: use `HitSampleInfo.All` properties --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 323888a450..bd4649f065 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -23,8 +23,6 @@ namespace osu.Game.Rulesets.Edit.Checks private const int delay_threshold_negligible = 1; private readonly string[] audioExtensions = { "mp3", "ogg", "wav" }; - private readonly string[] bankNames = { HitSampleInfo.BANK_NORMAL, HitSampleInfo.BANK_SOFT, HitSampleInfo.BANK_DRUM }; - private readonly string[] sampleSets = { HitSampleInfo.HIT_NORMAL, HitSampleInfo.HIT_WHISTLE, HitSampleInfo.HIT_FINISH, HitSampleInfo.HIT_CLAP }; public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Audio, "Delayed hit sounds."); @@ -125,7 +123,8 @@ namespace osu.Game.Rulesets.Edit.Checks string bank = parts[0]; string sampleSet = parts[1]; - return bankNames.Contains(bank) && sampleSets.Any(sampleSet.StartsWith); + return HitSampleInfo.AllBanks.Contains(bank) + && HitSampleInfo.AllAdditions.Concat(new[] { HitSampleInfo.HIT_NORMAL, HitSampleInfo.HIT_FLOURISH }).Any(sampleSet.StartsWith); } public class IssueTemplateConsequentDelay : IssueTemplate From a7a64b57e93280624ac39481568050a9bf6dc8de Mon Sep 17 00:00:00 2001 From: tsrk Date: Tue, 29 Aug 2023 19:45:11 +0200 Subject: [PATCH 026/567] fix: use `using` statement for waveform auto-disposal --- .../Edit/Checks/CheckDelayedHitsounds.cs | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index bd4649f065..e4be2e7198 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -57,54 +57,55 @@ namespace osu.Game.Rulesets.Edit.Checks if (!isHitSound(file.Filename)) continue; - Waveform waveform = new Waveform(stream); - - var points = waveform.GetPoints(); - - // Skip muted samples - if (points.Length == 0 || points.Sum(getAverageAmplitude) <= silence_threshold) - continue; - - float maxAmplitude = points.Select(getAverageAmplitude).Max(); - - int consequentDelay = 0; - int delay = 0; - float amplitude = 0; - - while (delay + consequentDelay < points.Length) + using (Waveform waveform = new Waveform(stream)) { - amplitude += getAverageAmplitude(points[delay]); + var points = waveform.GetPoints(); - // Reached peak amplitude/transient - if (amplitude >= maxAmplitude) - break; + // Skip muted samples + if (points.Length == 0 || points.Sum(getAverageAmplitude) <= silence_threshold) + continue; - amplitude *= falloff_factor; + float maxAmplitude = points.Select(getAverageAmplitude).Max(); - if (amplitude < silence_threshold) + int consequentDelay = 0; + int delay = 0; + float amplitude = 0; + + while (delay + consequentDelay < points.Length) { - amplitude = 0; - consequentDelay++; + amplitude += getAverageAmplitude(points[delay]); + + // Reached peak amplitude/transient + if (amplitude >= maxAmplitude) + break; + + amplitude *= falloff_factor; + + if (amplitude < silence_threshold) + { + amplitude = 0; + consequentDelay++; + } + + delay++; } - delay++; - } - - if (consequentDelay >= delay_threshold) - yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); - else if (consequentDelay + delay >= delay_threshold) - { - if (consequentDelay > 0) - yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); - else - yield return new IssueTemplateDelayNoSilence(this).Create(file.Filename, delay); - } - else if (consequentDelay + delay >= delay_threshold_negligible) - { - if (consequentDelay > 0) - yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); - else - yield return new IssuTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); + if (consequentDelay >= delay_threshold) + yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); + else if (consequentDelay + delay >= delay_threshold) + { + if (consequentDelay > 0) + yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssueTemplateDelayNoSilence(this).Create(file.Filename, delay); + } + else if (consequentDelay + delay >= delay_threshold_negligible) + { + if (consequentDelay > 0) + yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssuTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); + } } } } From c1a7ad09b4cf9f47b2fb559c91a1620481cf99d7 Mon Sep 17 00:00:00 2001 From: tsrk Date: Tue, 29 Aug 2023 20:10:35 +0200 Subject: [PATCH 027/567] style: move common audio utils to separate static class --- .../Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 10 +++------- .../Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs | 6 +----- .../Edit/Checks/Components/AudioCheckUtils.cs | 11 +++++++++++ 3 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index e4be2e7198..fab7cdb7e4 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -22,8 +22,6 @@ namespace osu.Game.Rulesets.Edit.Checks private const int delay_threshold = 5; private const int delay_threshold_negligible = 1; - private readonly string[] audioExtensions = { "mp3", "ogg", "wav" }; - public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Audio, "Delayed hit sounds."); public IEnumerable PossibleTemplates => new IssueTemplate[] @@ -51,9 +49,6 @@ namespace osu.Game.Rulesets.Edit.Checks if (stream == null) continue; - if (!hasAudioExtension(file.Filename)) - continue; - if (!isHitSound(file.Filename)) continue; @@ -111,10 +106,11 @@ namespace osu.Game.Rulesets.Edit.Checks } } - private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLowerInvariant().EndsWith); - private bool isHitSound(string filename) { + if (!AudioCheckUtils.HasAudioExtension(filename)) + return false; + // - string[] parts = filename.ToLowerInvariant().Split('-'); diff --git a/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs b/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs index 1c2ea36948..32a3aa5ad9 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; -using System.Linq; using ManagedBass; using osu.Framework.Audio.Callbacks; using osu.Game.Extensions; @@ -16,8 +15,6 @@ namespace osu.Game.Rulesets.Edit.Checks private const int ms_threshold = 25; private const int min_bytes_threshold = 100; - private readonly string[] audioExtensions = { "mp3", "ogg", "wav" }; - public CheckMetadata Metadata => new CheckMetadata(CheckCategory.Audio, "Too short audio files"); public IEnumerable PossibleTemplates => new IssueTemplate[] @@ -46,7 +43,7 @@ namespace osu.Game.Rulesets.Edit.Checks { // If the file is not likely to be properly parsed by Bass, we don't produce Error issues about it. // Image files and audio files devoid of audio data both fail, for example, but neither would be issues in this check. - if (hasAudioExtension(file.Filename) && probablyHasAudioData(data)) + if (AudioCheckUtils.HasAudioExtension(file.Filename) && probablyHasAudioData(data)) yield return new IssueTemplateBadFormat(this).Create(file.Filename); continue; @@ -63,7 +60,6 @@ namespace osu.Game.Rulesets.Edit.Checks } } - private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLowerInvariant().EndsWith); private bool probablyHasAudioData(Stream data) => data.Length > min_bytes_threshold; public class IssueTemplateTooShort : IssueTemplate diff --git a/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs new file mode 100644 index 0000000000..b2cc950b94 --- /dev/null +++ b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs @@ -0,0 +1,11 @@ +using System.Linq; + +namespace osu.Game.Rulesets.Edit.Checks.Components +{ + public static class AudioCheckUtils + { + public static readonly string[] AUDIO_EXTENSIONS = { "mp3", "ogg", "wav" }; + + public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(filename.ToLowerInvariant().EndsWith); + } +} \ No newline at end of file From b3d432b0d520c3b4be2cb941d9f772842e6a37b7 Mon Sep 17 00:00:00 2001 From: tsrk Date: Tue, 29 Aug 2023 20:15:33 +0200 Subject: [PATCH 028/567] fix: issue template typo in `CheckDelayedHitsounds` --- .../Editing/Checks/CheckDelayedHitsoundsTest.cs | 2 +- .../Edit/Checks/CheckDelayedHitsounds.cs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs index 912b916a84..20b9643ab4 100644 --- a/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckDelayedHitsoundsTest.cs @@ -63,7 +63,7 @@ namespace osu.Game.Tests.Editing.Checks var issues = check.Run(getContext(resourceStream)).ToList(); Assert.That(issues, Has.Count.EqualTo(1)); - Assert.That(issues.Single().Template is CheckDelayedHitsounds.IssuTemplateMinorDelay); + Assert.That(issues.Single().Template is CheckDelayedHitsounds.IssueTemplateMinorDelay); } } diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index fab7cdb7e4..5d12c3fea8 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -29,8 +29,8 @@ namespace osu.Game.Rulesets.Edit.Checks new IssueTemplateConsequentDelay(this), new IssueTemplateDelay(this), new IssueTemplateDelayNoSilence(this), - new IssuTemplateMinorDelay(this), - new IssuTemplateMinorDelayNoSilence(this), + new IssueTemplateMinorDelay(this), + new IssueTemplateMinorDelayNoSilence(this), }; private float getAverageAmplitude(Waveform.Point point) => (point.AmplitudeLeft + point.AmplitudeRight) / 2; @@ -97,9 +97,9 @@ namespace osu.Game.Rulesets.Edit.Checks else if (consequentDelay + delay >= delay_threshold_negligible) { if (consequentDelay > 0) - yield return new IssuTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + yield return new IssueTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); else - yield return new IssuTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); + yield return new IssueTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); } } } @@ -157,9 +157,9 @@ namespace osu.Game.Rulesets.Edit.Checks public Issue Create(string filename, int delay) => new Issue(this, filename, delay); } - public class IssuTemplateMinorDelay : IssueTemplate + public class IssueTemplateMinorDelay : IssueTemplate { - public IssuTemplateMinorDelay(ICheck check) + public IssueTemplateMinorDelay(ICheck check) : base(check, IssueType.Negligible, "\"{0}\" has a transient delay of ~{1:0.##} ms, of which {2:0.##} ms is complete silence.") { @@ -168,9 +168,9 @@ namespace osu.Game.Rulesets.Edit.Checks public Issue Create(string filename, int consequentDelay, int delay) => new Issue(this, filename, delay, consequentDelay); } - public class IssuTemplateMinorDelayNoSilence : IssueTemplate + public class IssueTemplateMinorDelayNoSilence : IssueTemplate { - public IssuTemplateMinorDelayNoSilence(ICheck check) + public IssueTemplateMinorDelayNoSilence(ICheck check) : base(check, IssueType.Negligible, "\"{0}\" has a transient delay of ~{1:0.##} ms.") { From 5ecd5142d8ddc61d1394868e0627ceebc702e1ad Mon Sep 17 00:00:00 2001 From: tsrk Date: Tue, 29 Aug 2023 23:27:15 +0200 Subject: [PATCH 029/567] fix(AudioCheckUtils): add license header --- osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs index b2cc950b94..782369d72a 100644 --- a/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs +++ b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs @@ -1,3 +1,6 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + using System.Linq; namespace osu.Game.Rulesets.Edit.Checks.Components @@ -8,4 +11,4 @@ namespace osu.Game.Rulesets.Edit.Checks.Components public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(filename.ToLowerInvariant().EndsWith); } -} \ No newline at end of file +} From 5f00d3e2a44a32bac0a2a42366b84c4fa0a797a1 Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 1 Sep 2023 20:54:02 +0200 Subject: [PATCH 030/567] style: convert to `using` declaration for less nesting --- .../Edit/Checks/CheckDelayedHitsounds.cs | 83 +++++++++---------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 5d12c3fea8..0040deec80 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -52,55 +52,54 @@ namespace osu.Game.Rulesets.Edit.Checks if (!isHitSound(file.Filename)) continue; - using (Waveform waveform = new Waveform(stream)) + using Waveform waveform = new Waveform(stream); + + var points = waveform.GetPoints(); + + // Skip muted samples + if (points.Length == 0 || points.Sum(getAverageAmplitude) <= silence_threshold) + continue; + + float maxAmplitude = points.Select(getAverageAmplitude).Max(); + + int consequentDelay = 0; + int delay = 0; + float amplitude = 0; + + while (delay + consequentDelay < points.Length) { - var points = waveform.GetPoints(); + amplitude += getAverageAmplitude(points[delay]); - // Skip muted samples - if (points.Length == 0 || points.Sum(getAverageAmplitude) <= silence_threshold) - continue; + // Reached peak amplitude/transient + if (amplitude >= maxAmplitude) + break; - float maxAmplitude = points.Select(getAverageAmplitude).Max(); + amplitude *= falloff_factor; - int consequentDelay = 0; - int delay = 0; - float amplitude = 0; - - while (delay + consequentDelay < points.Length) + if (amplitude < silence_threshold) { - amplitude += getAverageAmplitude(points[delay]); - - // Reached peak amplitude/transient - if (amplitude >= maxAmplitude) - break; - - amplitude *= falloff_factor; - - if (amplitude < silence_threshold) - { - amplitude = 0; - consequentDelay++; - } - - delay++; + amplitude = 0; + consequentDelay++; } - if (consequentDelay >= delay_threshold) - yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); - else if (consequentDelay + delay >= delay_threshold) - { - if (consequentDelay > 0) - yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); - else - yield return new IssueTemplateDelayNoSilence(this).Create(file.Filename, delay); - } - else if (consequentDelay + delay >= delay_threshold_negligible) - { - if (consequentDelay > 0) - yield return new IssueTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); - else - yield return new IssueTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); - } + delay++; + } + + if (consequentDelay >= delay_threshold) + yield return new IssueTemplateConsequentDelay(this).Create(file.Filename, consequentDelay); + else if (consequentDelay + delay >= delay_threshold) + { + if (consequentDelay > 0) + yield return new IssueTemplateDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssueTemplateDelayNoSilence(this).Create(file.Filename, delay); + } + else if (consequentDelay + delay >= delay_threshold_negligible) + { + if (consequentDelay > 0) + yield return new IssueTemplateMinorDelay(this).Create(file.Filename, consequentDelay, delay); + else + yield return new IssueTemplateMinorDelayNoSilence(this).Create(file.Filename, delay); } } } From 2e2dcd99a6230aee8344fee3f45f4c33a0804d32 Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 1 Sep 2023 20:56:42 +0200 Subject: [PATCH 031/567] fix(AudioCheckUtils): use `Path.GetExtension()` To avoid filename escaping --- osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs index 782369d72a..b8cbe63c1e 100644 --- a/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs +++ b/osu.Game/Rulesets/Edit/Checks/Components/AudioCheckUtils.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.IO; using System.Linq; namespace osu.Game.Rulesets.Edit.Checks.Components @@ -9,6 +10,6 @@ namespace osu.Game.Rulesets.Edit.Checks.Components { public static readonly string[] AUDIO_EXTENSIONS = { "mp3", "ogg", "wav" }; - public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(filename.ToLowerInvariant().EndsWith); + public static bool HasAudioExtension(string filename) => AUDIO_EXTENSIONS.Any(Path.GetExtension(filename).ToLowerInvariant().EndsWith); } } From a4e146ad9b8d01da1d4981ec59e87d6c7c284466 Mon Sep 17 00:00:00 2001 From: tsrk Date: Fri, 1 Sep 2023 21:02:43 +0200 Subject: [PATCH 032/567] style: remove usage of `HIT_FLOURISH` Unaware clueless usage --- osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs index 0040deec80..d6cd4f4caa 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckDelayedHitsounds.cs @@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Edit.Checks string sampleSet = parts[1]; return HitSampleInfo.AllBanks.Contains(bank) - && HitSampleInfo.AllAdditions.Concat(new[] { HitSampleInfo.HIT_NORMAL, HitSampleInfo.HIT_FLOURISH }).Any(sampleSet.StartsWith); + && HitSampleInfo.AllAdditions.Append(HitSampleInfo.HIT_NORMAL).Any(sampleSet.StartsWith); } public class IssueTemplateConsequentDelay : IssueTemplate From 1a70110a4eed3e663ae6bbba81a9ed8a4b15cbf5 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Tue, 12 Sep 2023 16:44:44 +0300 Subject: [PATCH 033/567] Added BeatmapAttributesDisplay support --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 6 +-- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 6 +-- osu.Game.Rulesets.Osu/OsuRuleset.cs | 8 ++-- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 6 +-- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 17 +++++-- .../Overlays/Mods/VerticalAttributeDisplay.cs | 46 +++++++++++++++++-- osu.Game/Rulesets/Ruleset.cs | 17 ++++++- .../Screens/Select/Details/AdvancedStats.cs | 8 ++-- 8 files changed, 89 insertions(+), 25 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 4f499cee62..f0b20c68c4 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -238,10 +238,10 @@ namespace osu.Game.Rulesets.Catch public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) { BeatmapDifficulty? adjustedDifficulty = null; - isRateAdjusted = (false, false); + rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); if (mods.Any(m => m is IApplicableToDifficulty)) { @@ -264,7 +264,7 @@ namespace osu.Game.Rulesets.Catch adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); - if (adjustedDifficulty.ApproachRate != ar) isRateAdjusted.AR = true; + rateAdjustedInfo.AR = GetRateAdjustType(ar, adjustedDifficulty.ApproachRate); } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 7d16806397..a8a54ebf05 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -431,10 +431,10 @@ namespace osu.Game.Rulesets.Mania public double HitwindowFromOd(float OD) => 64.0 - 3 * OD; public float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) { BeatmapDifficulty? adjustedDifficulty = null; - isRateAdjusted = (false, false); + rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); if (mods.Any(m => m is IApplicableToDifficulty)) { @@ -456,7 +456,7 @@ namespace osu.Game.Rulesets.Mania adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); } } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 250685ec0f..4810be5db2 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -335,10 +335,10 @@ namespace osu.Game.Rulesets.Osu public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) { BeatmapDifficulty? adjustedDifficulty = null; - isRateAdjusted = (false, false); + rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); if (mods.Any(m => m is IApplicableToDifficulty)) { @@ -362,8 +362,8 @@ namespace osu.Game.Rulesets.Osu adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - if (adjustedDifficulty.ApproachRate != ar) isRateAdjusted.AR = true; - if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + rateAdjustedInfo.AR = GetRateAdjustType(ar, adjustedDifficulty.ApproachRate); + rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 801e46f9c3..a9abbea251 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -266,10 +266,10 @@ namespace osu.Game.Rulesets.Taiko public double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; public float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) + public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) { BeatmapDifficulty? adjustedDifficulty = null; - isRateAdjusted = (false, false); + rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); if (mods.Any(m => m is IApplicableToDifficulty)) { @@ -291,7 +291,7 @@ namespace osu.Game.Rulesets.Taiko adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - if (adjustedDifficulty.OverallDifficulty != od) isRateAdjusted.OD = true; + rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); } } diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 2aea53090a..d0ee9750b2 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -16,6 +16,7 @@ using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osuTK; using osuTK.Graphics; @@ -63,6 +64,10 @@ namespace osu.Game.Overlays.Mods [Resolved] private BeatmapDifficultyCache difficultyCache { get; set; } = null!; + [Resolved] + private OsuGameBase game { get; set; } = null!; + private IBindable gameRuleset = null!; + private CancellationTokenSource? cancellationSource; private IBindable starDifficulty = null!; @@ -195,6 +200,9 @@ namespace osu.Game.Overlays.Mods updateCollapsedState(); }); + gameRuleset = game.Ruleset.GetBoundCopy(); + gameRuleset.BindValueChanged(_ => updateValues()); + BeatmapInfo.BindValueChanged(_ => updateValues(), true); } @@ -243,9 +251,12 @@ namespace osu.Game.Overlays.Mods bpmDisplay.Current.Value = BeatmapInfo.Value.BPM * rate; - BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); - foreach (var mod in mods.Value.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); + (Ruleset.RateAdjustType AR, Ruleset.RateAdjustType OD) rateAdjustType = (Ruleset.RateAdjustType.NotChanged, Ruleset.RateAdjustType.NotChanged); + + Ruleset ruleset = gameRuleset.Value.CreateInstance(); + BeatmapDifficulty adjustedDifficulty = ruleset.GetEffectiveDifficulty(BeatmapInfo.Value.Difficulty, mods.Value, ref rateAdjustType); + approachRateDisplay.RateChangeType.Value = rateAdjustType.AR; + overallDifficultyDisplay.RateChangeType.Value = rateAdjustType.OD; circleSizeDisplay.Current.Value = adjustedDifficulty.CircleSize; drainRateDisplay.Current.Value = adjustedDifficulty.DrainRate; diff --git a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs index 60cc875dbb..16d75cd448 100644 --- a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs +++ b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; @@ -10,6 +12,9 @@ using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; +using osuTK.Graphics; namespace osu.Game.Overlays.Mods { @@ -23,11 +28,43 @@ namespace osu.Game.Overlays.Mods private readonly BindableWithCurrent current = new BindableWithCurrent(); + public Bindable RateChangeType = new Bindable(Ruleset.RateAdjustType.NotChanged); + /// /// Text to display in the top area of the display. /// public LocalisableString Label { get; protected set; } + private EffectCounter counter; + private OsuSpriteText text; + + [Resolved] + private OsuColour colours { get; set; } = null!; + private void updateTextColor() + { + Color4 newColor; + switch (RateChangeType.Value) + { + case Ruleset.RateAdjustType.NotChanged: + newColor = Color4.White; + break; + + case Ruleset.RateAdjustType.DifficultyReduction: + newColor = colours.ForModType(ModType.DifficultyReduction); + break; + + case Ruleset.RateAdjustType.DifficultyIncrease: + newColor = colours.ForModType(ModType.DifficultyIncrease); + break; + + default: + throw new ArgumentOutOfRangeException(nameof(RateChangeType.Value)); + } + + text.Colour = newColor; + counter.Colour = newColor; + } + public VerticalAttributeDisplay(LocalisableString label) { Label = label; @@ -37,6 +74,8 @@ namespace osu.Game.Overlays.Mods Origin = Anchor.CentreLeft; Anchor = Anchor.CentreLeft; + RateChangeType.BindValueChanged(_ => updateTextColor()); + InternalChild = new FillFlowContainer { Origin = Anchor.CentreLeft, @@ -45,7 +84,7 @@ namespace osu.Game.Overlays.Mods Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuSpriteText + text = new OsuSpriteText { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -53,7 +92,7 @@ namespace osu.Game.Overlays.Mods Margin = new MarginPadding { Horizontal = 15 }, // to reserve space for 0.XX value Font = OsuFont.Default.With(size: 20, weight: FontWeight.Bold) }, - new EffectCounter + counter = new EffectCounter { Origin = Anchor.Centre, Anchor = Anchor.Centre, @@ -62,12 +101,11 @@ namespace osu.Game.Overlays.Mods } }; } - private partial class EffectCounter : RollingCounter { protected override double RollingDuration => 500; - protected override LocalisableString FormatCount(double count) => count.ToLocalisableString("0.0"); + protected override LocalisableString FormatCount(double count) => count.ToLocalisableString("0.0#"); protected override OsuSpriteText CreateSpriteText() => new OsuSpriteText { diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 0f7655812a..7a09bff4aa 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -389,6 +389,21 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. /// public virtual DifficultySection? CreateEditorDifficultySection() => null; - public virtual BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (bool AR, bool OD) isRateAdjusted) => (BeatmapDifficulty)baseDifficulty; + public virtual BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) => (BeatmapDifficulty)baseDifficulty; + public enum RateAdjustType + { + NotChanged, + DifficultyReduction, + DifficultyIncrease + } + + protected RateAdjustType GetRateAdjustType(float baseValue, float adjustedValue) + { + if (adjustedValue > baseValue) + return RateAdjustType.DifficultyIncrease; + if (adjustedValue < baseValue) + return RateAdjustType.DifficultyReduction; + return RateAdjustType.NotChanged; + } } } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 4a0eed86f8..867d86a69b 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -116,12 +116,12 @@ namespace osu.Game.Screens.Select.Details { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; - (bool AR, bool OD) isRateAdjusted = (false, false); + (Ruleset.RateAdjustType AR, Ruleset.RateAdjustType OD) rateAdjustInfo = (Ruleset.RateAdjustType.NotChanged, Ruleset.RateAdjustType.NotChanged); if (baseDifficulty != null) { Ruleset ruleset = gameRuleset.Value.CreateInstance(); - adjustedDifficulty = ruleset.GetEffectiveDifficulty(baseDifficulty, mods.Value, ref isRateAdjusted); + adjustedDifficulty = ruleset.GetEffectiveDifficulty(baseDifficulty, mods.Value, ref rateAdjustInfo); } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -140,8 +140,8 @@ namespace osu.Game.Screens.Select.Details } HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate, false); - Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, isRateAdjusted.OD); - ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, isRateAdjusted.AR); + Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, rateAdjustInfo.OD != Ruleset.RateAdjustType.NotChanged); + ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, rateAdjustInfo.OD != Ruleset.RateAdjustType.NotChanged); updateStarDifficulty(); } From 57170501cdadfa786d8d59bd67efa4f45a9ce81a Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 17:25:09 +0200 Subject: [PATCH 034/567] Improve code quality --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 31 +++------------- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 30 +++------------- osu.Game.Rulesets.Osu/OsuRuleset.cs | 33 +++-------------- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 30 +++------------- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 20 ++++++----- .../Overlays/Mods/VerticalAttributeDisplay.cs | 33 ++++++++++++----- osu.Game/Rulesets/Ruleset.cs | 17 +-------- .../Screens/Select/Details/AdvancedStats.cs | 35 ++++++++++++------- 8 files changed, 76 insertions(+), 153 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index f0b20c68c4..2d0e34431d 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -238,37 +238,14 @@ namespace osu.Game.Rulesets.Catch public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) + public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { - BeatmapDifficulty? adjustedDifficulty = null; - rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - if (mods.Any(m => m is IApplicableToDifficulty)) - { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - } - - if (mods.Any(m => m is ModRateAdjust)) - { - adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - { - double speedChange = (float)mod.SpeedChange.Value; - - float ar = adjustedDifficulty.ApproachRate; - float od = adjustedDifficulty.OverallDifficulty; - - adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); - - rateAdjustedInfo.AR = GetRateAdjustType(ar, adjustedDifficulty.ApproachRate); - } - } + adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } + } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index a8a54ebf05..cfdfcbadee 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -431,34 +431,12 @@ namespace osu.Game.Rulesets.Mania public double HitwindowFromOd(float OD) => 64.0 - 3 * OD; public float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) + + public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { - BeatmapDifficulty? adjustedDifficulty = null; - rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - if (mods.Any(m => m is IApplicableToDifficulty)) - { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - } - - if (mods.Any(m => m is ModRateAdjust)) - { - adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - { - double speedChange = (float)mod.SpeedChange.Value; - - float od = adjustedDifficulty.OverallDifficulty; - - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - - rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); - } - } + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 4810be5db2..3a8f589c9f 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -335,37 +335,12 @@ namespace osu.Game.Rulesets.Osu public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) + public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { - BeatmapDifficulty? adjustedDifficulty = null; - rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - if (mods.Any(m => m is IApplicableToDifficulty)) - { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - } - - if (mods.Any(m => m is ModRateAdjust)) - { - adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - { - double speedChange = (float)mod.SpeedChange.Value; - - float ar = adjustedDifficulty.ApproachRate; - float od = adjustedDifficulty.OverallDifficulty; - - adjustedDifficulty.ApproachRate = ChangeArFromRate(ar, speedChange); - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - - rateAdjustedInfo.AR = GetRateAdjustType(ar, adjustedDifficulty.ApproachRate); - rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); - } - } + adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate); + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index a9abbea251..026ac4f42e 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -266,34 +266,12 @@ namespace osu.Game.Rulesets.Taiko public double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; public float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); - public override BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) + + public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { - BeatmapDifficulty? adjustedDifficulty = null; - rateAdjustedInfo = (RateAdjustType.NotChanged, RateAdjustType.NotChanged); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - if (mods.Any(m => m is IApplicableToDifficulty)) - { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - } - - if (mods.Any(m => m is ModRateAdjust)) - { - adjustedDifficulty ??= new BeatmapDifficulty(baseDifficulty); - - foreach (var mod in mods.OfType()) - { - double speedChange = (float)mod.SpeedChange.Value; - - float od = adjustedDifficulty.OverallDifficulty; - - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(od, speedChange); - - rateAdjustedInfo.OD = GetRateAdjustType(od, adjustedDifficulty.OverallDifficulty); - } - } + adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index d0ee9750b2..fd9ce8f5d9 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -251,17 +251,21 @@ namespace osu.Game.Overlays.Mods bpmDisplay.Current.Value = BeatmapInfo.Value.BPM * rate; - (Ruleset.RateAdjustType AR, Ruleset.RateAdjustType OD) rateAdjustType = (Ruleset.RateAdjustType.NotChanged, Ruleset.RateAdjustType.NotChanged); + var moddedDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); + + foreach (var mod in mods.Value.OfType()) + mod.ApplyToDifficulty(moddedDifficulty); Ruleset ruleset = gameRuleset.Value.CreateInstance(); - BeatmapDifficulty adjustedDifficulty = ruleset.GetEffectiveDifficulty(BeatmapInfo.Value.Difficulty, mods.Value, ref rateAdjustType); - approachRateDisplay.RateChangeType.Value = rateAdjustType.AR; - overallDifficultyDisplay.RateChangeType.Value = rateAdjustType.OD; + var rateAdjustedDifficulty = ruleset.GetRateAdjustedDifficulty(moddedDifficulty, rate); - circleSizeDisplay.Current.Value = adjustedDifficulty.CircleSize; - drainRateDisplay.Current.Value = adjustedDifficulty.DrainRate; - approachRateDisplay.Current.Value = adjustedDifficulty.ApproachRate; - overallDifficultyDisplay.Current.Value = adjustedDifficulty.OverallDifficulty; + approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.ApproachRate, rateAdjustedDifficulty.ApproachRate); + overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.OverallDifficulty, rateAdjustedDifficulty.OverallDifficulty); + + circleSizeDisplay.Current.Value = rateAdjustedDifficulty.CircleSize; + drainRateDisplay.Current.Value = rateAdjustedDifficulty.DrainRate; + approachRateDisplay.Current.Value = rateAdjustedDifficulty.ApproachRate; + overallDifficultyDisplay.Current.Value = rateAdjustedDifficulty.OverallDifficulty; }); private void updateCollapsedState() diff --git a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs index 16d75cd448..0b0c49bc1b 100644 --- a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs +++ b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs @@ -12,7 +12,6 @@ using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osuTK.Graphics; @@ -28,7 +27,7 @@ namespace osu.Game.Overlays.Mods private readonly BindableWithCurrent current = new BindableWithCurrent(); - public Bindable RateChangeType = new Bindable(Ruleset.RateAdjustType.NotChanged); + public Bindable AdjustType = new Bindable(); /// /// Text to display in the top area of the display. @@ -43,22 +42,22 @@ namespace osu.Game.Overlays.Mods private void updateTextColor() { Color4 newColor; - switch (RateChangeType.Value) + switch (AdjustType.Value) { - case Ruleset.RateAdjustType.NotChanged: + case ModEffect.NotChanged: newColor = Color4.White; break; - case Ruleset.RateAdjustType.DifficultyReduction: + case ModEffect.DifficultyReduction: newColor = colours.ForModType(ModType.DifficultyReduction); break; - case Ruleset.RateAdjustType.DifficultyIncrease: + case ModEffect.DifficultyIncrease: newColor = colours.ForModType(ModType.DifficultyIncrease); break; default: - throw new ArgumentOutOfRangeException(nameof(RateChangeType.Value)); + throw new ArgumentOutOfRangeException(nameof(AdjustType.Value)); } text.Colour = newColor; @@ -74,7 +73,7 @@ namespace osu.Game.Overlays.Mods Origin = Anchor.CentreLeft; Anchor = Anchor.CentreLeft; - RateChangeType.BindValueChanged(_ => updateTextColor()); + AdjustType.BindValueChanged(_ => updateTextColor()); InternalChild = new FillFlowContainer { @@ -101,6 +100,24 @@ namespace osu.Game.Overlays.Mods } }; } + + public static ModEffect CalculateEffect(double oldValue, double newValue) + { + if (newValue == oldValue) + return ModEffect.NotChanged; + if (newValue < oldValue) + return ModEffect.DifficultyReduction; + + return ModEffect.DifficultyIncrease; + } + + public enum ModEffect + { + NotChanged, + DifficultyReduction, + DifficultyIncrease, + } + private partial class EffectCounter : RollingCounter { protected override double RollingDuration => 500; diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 7a09bff4aa..fbeec5ff4b 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -389,21 +389,6 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. /// public virtual DifficultySection? CreateEditorDifficultySection() => null; - public virtual BeatmapDifficulty GetEffectiveDifficulty(IBeatmapDifficultyInfo baseDifficulty, IReadOnlyList mods, ref (RateAdjustType AR, RateAdjustType OD) rateAdjustedInfo) => (BeatmapDifficulty)baseDifficulty; - public enum RateAdjustType - { - NotChanged, - DifficultyReduction, - DifficultyIncrease - } - - protected RateAdjustType GetRateAdjustType(float baseValue, float adjustedValue) - { - if (adjustedValue > baseValue) - return RateAdjustType.DifficultyIncrease; - if (adjustedValue < baseValue) - return RateAdjustType.DifficultyReduction; - return RateAdjustType.NotChanged; - } + public virtual BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) => new BeatmapDifficulty(baseDifficulty); } } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 867d86a69b..d143e12667 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -24,6 +24,7 @@ using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; +using System.Linq; namespace osu.Game.Screens.Select.Details { @@ -116,12 +117,21 @@ namespace osu.Game.Screens.Select.Details { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; - (Ruleset.RateAdjustType AR, Ruleset.RateAdjustType OD) rateAdjustInfo = (Ruleset.RateAdjustType.NotChanged, Ruleset.RateAdjustType.NotChanged); if (baseDifficulty != null) { - Ruleset ruleset = gameRuleset.Value.CreateInstance(); - adjustedDifficulty = ruleset.GetEffectiveDifficulty(baseDifficulty, mods.Value, ref rateAdjustInfo); + adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + + foreach (var mod in mods.Value.OfType()) + mod.ApplyToDifficulty(adjustedDifficulty); + + // For now we not using rate adjusted difficulty here + + //Ruleset ruleset = gameRuleset.Value.CreateInstance(); + //double rate = 1; + //foreach (var mod in mods.Value.OfType()) + // rate = mod.ApplyToRate(0, rate); + //adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -130,18 +140,18 @@ namespace osu.Game.Screens.Select.Details // Account for mania differences locally for now // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes FirstValue.Title = BeatmapsetsStrings.ShowStatsCsMania; - FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null, false); + FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null); break; default: FirstValue.Title = BeatmapsetsStrings.ShowStatsCs; - FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize, false); + FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize); break; } - HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate, false); - Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty, rateAdjustInfo.OD != Ruleset.RateAdjustType.NotChanged); - ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate, rateAdjustInfo.OD != Ruleset.RateAdjustType.NotChanged); + HpDrain.Value = (baseDifficulty?.DrainRate ?? 0, adjustedDifficulty?.DrainRate); + Accuracy.Value = (baseDifficulty?.OverallDifficulty ?? 0, adjustedDifficulty?.OverallDifficulty); + ApproachRate.Value = (baseDifficulty?.ApproachRate ?? 0, adjustedDifficulty?.ApproachRate); updateStarDifficulty(); } @@ -175,7 +185,7 @@ namespace osu.Game.Screens.Select.Details if (normalDifficulty == null || moddedDifficulty == null) return; - starDifficulty.Value = ((float)normalDifficulty.Value.Stars, (float)moddedDifficulty.Value.Stars, false); + starDifficulty.Value = ((float)normalDifficulty.Value.Stars, (float)moddedDifficulty.Value.Stars); }), starDifficultyCancellationSource.Token, TaskContinuationOptions.OnlyOnRanToCompletion, TaskScheduler.Current); }); @@ -206,11 +216,11 @@ namespace osu.Game.Screens.Select.Details set => name.Text = value; } - private (float baseValue, float? adjustedValue, bool isRateAdjusted)? value; + private (float baseValue, float? adjustedValue)? value; - public (float baseValue, float? adjustedValue, bool isRateAdjusted) Value + public (float baseValue, float? adjustedValue) Value { - get => value ?? (0, null, false); + get => value ?? (0, null); set { if (value == this.value) @@ -221,7 +231,6 @@ namespace osu.Game.Screens.Select.Details bar.Length = value.baseValue / maxValue; valueText.Text = (value.adjustedValue ?? value.baseValue).ToString(forceDecimalPlaces ? "0.00" : "0.##"); - if (value.isRateAdjusted) valueText.Text += "*"; ModBar.Length = (value.adjustedValue ?? 0) / maxValue; if (Precision.AlmostEquals(value.baseValue, value.adjustedValue ?? value.baseValue, 0.05f)) From 440d57fb48ec4fc029452ceda9f54aad381fd32a Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 17:47:02 +0200 Subject: [PATCH 035/567] Basic rate-adjust tooltip --- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index fd9ce8f5d9..fc0ef989e6 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -9,6 +9,7 @@ using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; using osu.Game.Beatmaps; @@ -23,6 +24,7 @@ using osuTK.Graphics; using System.Threading; using osu.Framework.Input.Events; using osu.Game.Configuration; +using osu.Game.Rulesets.Difficulty; namespace osu.Game.Overlays.Mods { @@ -30,7 +32,7 @@ namespace osu.Game.Overlays.Mods /// On the mod select overlay, this provides a local updating view of BPM, star rating and other /// difficulty attributes so the user can have a better insight into what mods are changing. /// - public partial class BeatmapAttributesDisplay : CompositeDrawable + public partial class BeatmapAttributesDisplay : CompositeDrawable, IHasTooltip { private Container content = null!; private Container innerContent = null!; @@ -71,6 +73,10 @@ namespace osu.Game.Overlays.Mods private CancellationTokenSource? cancellationSource; private IBindable starDifficulty = null!; + private BeatmapDifficulty? baseDifficultyAttributes = null; + + private bool haveRateChangedValues = false; + [BackgroundDependencyLoader] private void load() { @@ -256,9 +262,13 @@ namespace osu.Game.Overlays.Mods foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(moddedDifficulty); + baseDifficultyAttributes = moddedDifficulty; + Ruleset ruleset = gameRuleset.Value.CreateInstance(); var rateAdjustedDifficulty = ruleset.GetRateAdjustedDifficulty(moddedDifficulty, rate); + haveRateChangedValues = !haveEqualDifficulties(rateAdjustedDifficulty, moddedDifficulty); + approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.ApproachRate, rateAdjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.OverallDifficulty, rateAdjustedDifficulty.OverallDifficulty); @@ -268,6 +278,19 @@ namespace osu.Game.Overlays.Mods overallDifficultyDisplay.Current.Value = rateAdjustedDifficulty.OverallDifficulty; }); + private bool haveEqualDifficulties(BeatmapDifficulty? a, BeatmapDifficulty? b) + { + if (a == null && b == null) return true; + if (a == null || b == null) return false; + + if (a.ApproachRate != b.ApproachRate) return false; + if (a.OverallDifficulty != b.OverallDifficulty) return false; + if (a.DrainRate != b.DrainRate) return false; + if (a.CircleSize != b.CircleSize) return false; + + return true; + } + private void updateCollapsedState() { outerContent.FadeTo(Collapsed.Value && !IsHovered ? 0 : 1, transition_duration, Easing.OutQuint); @@ -285,5 +308,17 @@ namespace osu.Game.Overlays.Mods UseFullGlyphHeight = false, }; } + + public LocalisableString TooltipText + { + get + { + if (haveRateChangedValues) + { + return "Some of the values are Rate-Adjusted."; + } + return ""; + } + } } } From 5597e819be1e400fb481f316b1b6fc47c76b94d7 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 18:01:10 +0200 Subject: [PATCH 036/567] fixed bug in AR formula --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 2d0e34431d..da84d12f59 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -235,7 +235,7 @@ namespace osu.Game.Rulesets.Catch } public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 3a8f589c9f..bdbedf1409 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -330,7 +330,7 @@ namespace osu.Game.Rulesets.Osu public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150)) + 5; + public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); public double HitwindowFromOd(float OD) => 80.0 - 6 * OD; public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); From 820519c37dcfa271235e75cdc2f9ad10d2f6f91e Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 21:55:46 +0200 Subject: [PATCH 037/567] improved tooltip --- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 44 +++++++++---------- .../Overlays/Mods/VerticalAttributeDisplay.cs | 3 +- .../Screens/Select/Details/AdvancedStats.cs | 44 ++++++++++++++++--- 3 files changed, 60 insertions(+), 31 deletions(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index fc0ef989e6..c921e3e075 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using System.Threading; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; @@ -11,9 +12,12 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Events; using osu.Framework.Localisation; +using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; +using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -21,10 +25,6 @@ using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osuTK; using osuTK.Graphics; -using System.Threading; -using osu.Framework.Input.Events; -using osu.Game.Configuration; -using osu.Game.Rulesets.Difficulty; namespace osu.Game.Overlays.Mods { @@ -73,8 +73,7 @@ namespace osu.Game.Overlays.Mods private CancellationTokenSource? cancellationSource; private IBindable starDifficulty = null!; - private BeatmapDifficulty? baseDifficultyAttributes = null; - + private BeatmapDifficulty? originalDifficulty = null; private bool haveRateChangedValues = false; [BackgroundDependencyLoader] @@ -257,36 +256,34 @@ namespace osu.Game.Overlays.Mods bpmDisplay.Current.Value = BeatmapInfo.Value.BPM * rate; - var moddedDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); + var adjustedDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); foreach (var mod in mods.Value.OfType()) - mod.ApplyToDifficulty(moddedDifficulty); + mod.ApplyToDifficulty(adjustedDifficulty); - baseDifficultyAttributes = moddedDifficulty; + originalDifficulty = adjustedDifficulty; Ruleset ruleset = gameRuleset.Value.CreateInstance(); - var rateAdjustedDifficulty = ruleset.GetRateAdjustedDifficulty(moddedDifficulty, rate); + adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); - haveRateChangedValues = !haveEqualDifficulties(rateAdjustedDifficulty, moddedDifficulty); + haveRateChangedValues = !isDifferentArOd(originalDifficulty, adjustedDifficulty); - approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.ApproachRate, rateAdjustedDifficulty.ApproachRate); - overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(moddedDifficulty.OverallDifficulty, rateAdjustedDifficulty.OverallDifficulty); + approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); + overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); - circleSizeDisplay.Current.Value = rateAdjustedDifficulty.CircleSize; - drainRateDisplay.Current.Value = rateAdjustedDifficulty.DrainRate; - approachRateDisplay.Current.Value = rateAdjustedDifficulty.ApproachRate; - overallDifficultyDisplay.Current.Value = rateAdjustedDifficulty.OverallDifficulty; + circleSizeDisplay.Current.Value = adjustedDifficulty.CircleSize; + drainRateDisplay.Current.Value = adjustedDifficulty.DrainRate; + approachRateDisplay.Current.Value = adjustedDifficulty.ApproachRate; + overallDifficultyDisplay.Current.Value = adjustedDifficulty.OverallDifficulty; }); - private bool haveEqualDifficulties(BeatmapDifficulty? a, BeatmapDifficulty? b) + private bool isDifferentArOd(BeatmapDifficulty? a, BeatmapDifficulty? b) { if (a == null && b == null) return true; if (a == null || b == null) return false; - if (a.ApproachRate != b.ApproachRate) return false; - if (a.OverallDifficulty != b.OverallDifficulty) return false; - if (a.DrainRate != b.DrainRate) return false; - if (a.CircleSize != b.CircleSize) return false; + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return false; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return false; return true; } @@ -315,7 +312,8 @@ namespace osu.Game.Overlays.Mods { if (haveRateChangedValues) { - return "Some of the values are Rate-Adjusted."; + return LocalisableString.Format("Values are changed by mods that change speed.\n" + + "Original values: AR = {0}, OD = {1}", originalDifficulty?.ApproachRate ?? 0, originalDifficulty?.OverallDifficulty ?? 0); } return ""; } diff --git a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs index 0b0c49bc1b..6ac7ebf159 100644 --- a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs +++ b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; +using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -103,7 +104,7 @@ namespace osu.Game.Overlays.Mods public static ModEffect CalculateEffect(double oldValue, double newValue) { - if (newValue == oldValue) + if (Precision.AlmostEquals(newValue, oldValue, 0.01)) return ModEffect.NotChanged; if (newValue < oldValue) return ModEffect.DifficultyReduction; diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index d143e12667..f9c6e95154 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -8,6 +8,7 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -28,7 +29,7 @@ using System.Linq; namespace osu.Game.Screens.Select.Details { - public partial class AdvancedStats : Container + public partial class AdvancedStats : Container, IHasTooltip { [Resolved] private BeatmapDifficultyCache difficultyCache { get; set; } @@ -44,6 +45,9 @@ namespace osu.Game.Screens.Select.Details protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; private readonly StatisticRow starDifficulty; + private BeatmapDifficulty originalDifficulty = null; + private bool haveRateChangedValues = false; + private IBeatmapInfo beatmapInfo; public IBeatmapInfo BeatmapInfo @@ -125,13 +129,15 @@ namespace osu.Game.Screens.Select.Details foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(adjustedDifficulty); - // For now we not using rate adjusted difficulty here + originalDifficulty = adjustedDifficulty; - //Ruleset ruleset = gameRuleset.Value.CreateInstance(); - //double rate = 1; - //foreach (var mod in mods.Value.OfType()) - // rate = mod.ApplyToRate(0, rate); - //adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); + Ruleset ruleset = gameRuleset.Value.CreateInstance(); + double rate = 1; + foreach (var mod in mods.Value.OfType()) + rate = mod.ApplyToRate(0, rate); + adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); + + haveRateChangedValues = !isDifferentArOd(originalDifficulty, adjustedDifficulty); } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -196,6 +202,30 @@ namespace osu.Game.Screens.Select.Details starDifficultyCancellationSource?.Cancel(); } + private bool isDifferentArOd(BeatmapDifficulty a, BeatmapDifficulty b) + { + if (a == null && b == null) return true; + if (a == null || b == null) return false; + + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return false; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return false; + + return true; + } + + public LocalisableString TooltipText + { + get + { + if (haveRateChangedValues) + { + return LocalisableString.Format("Values are changed by mods that change speed.\n" + + "Original values: AR = {0}, OD = {1}", originalDifficulty?.ApproachRate ?? 0, originalDifficulty?.OverallDifficulty ?? 0); + } + return ""; + } + } + public partial class StatisticRow : Container, IHasAccentColour { private const float value_width = 25; From 97caf18036efce177232e4ecfa3e36a5dba69fa0 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 21:57:17 +0200 Subject: [PATCH 038/567] Update CatchRuleset.cs --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index da84d12f59..816638ca87 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; From d0b2b4f7b9eaf2bf93cc92532ec683e095707561 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 4 Nov 2023 21:57:42 +0200 Subject: [PATCH 039/567] Update AdvancedStats.cs --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index f9c6e95154..54b76c48a4 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -16,6 +16,7 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using System.Collections.Generic; using osu.Game.Rulesets.Mods; +using System.Linq; using System.Threading; using System.Threading.Tasks; using osu.Framework.Extensions; @@ -25,7 +26,6 @@ using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; -using System.Linq; namespace osu.Game.Screens.Select.Details { From e451b2197c19503d357fc021984844d75d908c1f Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 9 Nov 2023 18:23:53 +0200 Subject: [PATCH 040/567] Delete util functions from rulesets --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 10 +++++----- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 18 +++++++++--------- osu.Game.Rulesets.Osu/OsuRuleset.cs | 17 +++++++++-------- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 7 +++---- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 816638ca87..421714e3b2 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -233,15 +233,15 @@ namespace osu.Game.Rulesets.Catch }; } - public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); - public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); - public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate); + double preempt = adjustedDifficulty.ApproachRate < 5 ? + (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : + (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + preempt /= rate; + adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index cfdfcbadee..b8324b3f2f 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -428,18 +428,18 @@ namespace osu.Game.Rulesets.Mania public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); - public double HitwindowFromOd(float OD) => 64.0 - 3 * OD; - public float OdFromHitwindow(double hitwindow300) => (float)(64.0 - hitwindow300) / 3; - public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); + // Mania doesn't have rate-adjusted attributes anymore? - public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) - { - BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + //public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) + //{ + // BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); + // double hitwindow = 64.0 - 3 * adjustedDifficulty.OverallDifficulty; + // hitwindow /= rate; + // adjustedDifficulty.OverallDifficulty = (float)(64.0 - hitwindow) / 3; - return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; - } + // return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + //} } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index bdbedf1409..26a51a0c48 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -329,18 +329,19 @@ namespace osu.Game.Rulesets.Osu public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); - public double PreemptFromAr(float AR) => AR < 5 ? (1200.0 + 600.0 * (5 - AR) / 5) : (1200.0 - 750.0 * (AR - 5) / 5); - public float ArFromPreempt(double preempt) => (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); - public double HitwindowFromOd(float OD) => 80.0 - 6 * OD; - public float OdFromHitwindow(double hitwindow300) => (float)(80.0 - hitwindow300) / 6; - public float ChangeArFromRate(float AR, double rate) => ArFromPreempt(PreemptFromAr(AR) / rate); - public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - adjustedDifficulty.ApproachRate = ChangeArFromRate(adjustedDifficulty.ApproachRate, rate); - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); + double preempt = adjustedDifficulty.ApproachRate < 5 ? + (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : + (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + preempt /= rate; + adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); + + double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty; + hitwindow /= rate; + adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6; return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 026ac4f42e..3f9f939245 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -263,15 +263,14 @@ namespace osu.Game.Rulesets.Taiko }), true) }; } - public double HitwindowFromOd(float OD) => 35.0 - 15.0 * (OD - 5) / 5; - public float OdFromHitwindow(double hitwindow300) => (float)(5 * (35 - hitwindow300) / 15 + 5); - public float ChangeOdFromRate(float OD, double rate) => OdFromHitwindow(HitwindowFromOd(OD) / rate); public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - adjustedDifficulty.OverallDifficulty = ChangeOdFromRate(adjustedDifficulty.OverallDifficulty, rate); + double hitwindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5; + hitwindow /= rate; + adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitwindow) / 15 + 5); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } From 9ef34fa51a97e41f47dc8be0fc40c1495442c5fe Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 10 Nov 2023 15:02:15 +0200 Subject: [PATCH 041/567] FIxed stated problems --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 13 ------------- osu.Game/Rulesets/Ruleset.cs | 8 ++++++++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index b8324b3f2f..7fcf400409 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -428,19 +428,6 @@ namespace osu.Game.Rulesets.Mania public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); - // Mania doesn't have rate-adjusted attributes anymore? - - //public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) - //{ - // BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - - // double hitwindow = 64.0 - 3 * adjustedDifficulty.OverallDifficulty; - // hitwindow /= rate; - // adjustedDifficulty.OverallDifficulty = (float)(64.0 - hitwindow) / 3; - - // return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; - //} - } public enum PlayfieldType diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index fbeec5ff4b..8896517a1a 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -389,6 +389,14 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. /// public virtual DifficultySection? CreateEditorDifficultySection() => null; + + /// + /// Changes difficulty after they're adjusted according to rate. + /// Doesn't change any attributes by default. + /// + /// Difficulty attributes that will be changed + /// Rate of the gameplay. For example 1.5 for DT. + /// Copy of difficulty info with values changed according to rate and ruleset-specific behaviour. public virtual BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) => new BeatmapDifficulty(baseDifficulty); } } From d0d334a3715d98405c9bcd58cf5d21d25895fd98 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 10 Nov 2023 15:05:26 +0200 Subject: [PATCH 042/567] Update Ruleset.cs --- osu.Game/Rulesets/Ruleset.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 8896517a1a..e0e0c1295b 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -391,10 +391,10 @@ namespace osu.Game.Rulesets public virtual DifficultySection? CreateEditorDifficultySection() => null; /// - /// Changes difficulty after they're adjusted according to rate. + /// Changes after they're adjusted according to rate. /// Doesn't change any attributes by default. /// - /// Difficulty attributes that will be changed + /// >The that will be adjusted. /// Rate of the gameplay. For example 1.5 for DT. /// Copy of difficulty info with values changed according to rate and ruleset-specific behaviour. public virtual BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) => new BeatmapDifficulty(baseDifficulty); From c5feefc2ad186371431c08f593d3ad8b032168a6 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 10 Nov 2023 15:06:32 +0200 Subject: [PATCH 043/567] Update ManiaRuleset.cs --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 7fcf400409..4507015169 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -427,7 +427,6 @@ namespace osu.Game.Rulesets.Mania public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection(); public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); - } public enum PlayfieldType From 60c3e7250bbc406f7ea82c446b9c2b3e2511e384 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 10 Nov 2023 15:13:40 +0200 Subject: [PATCH 044/567] fixed naming incconvinence --- osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs | 12 ++++++------ osu.Game/Screens/Select/Details/AdvancedStats.cs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index c921e3e075..74bf5e5bd3 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -266,7 +266,7 @@ namespace osu.Game.Overlays.Mods Ruleset ruleset = gameRuleset.Value.CreateInstance(); adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); - haveRateChangedValues = !isDifferentArOd(originalDifficulty, adjustedDifficulty); + haveRateChangedValues = isDifferentArOd(originalDifficulty, adjustedDifficulty); approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); @@ -279,13 +279,13 @@ namespace osu.Game.Overlays.Mods private bool isDifferentArOd(BeatmapDifficulty? a, BeatmapDifficulty? b) { - if (a == null && b == null) return true; - if (a == null || b == null) return false; + if (a == null && b == null) return false; + if (a == null || b == null) return true; - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return false; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return false; + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return true; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return true; - return true; + return false; } private void updateCollapsedState() diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 54b76c48a4..802c1901eb 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -137,7 +137,7 @@ namespace osu.Game.Screens.Select.Details rate = mod.ApplyToRate(0, rate); adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); - haveRateChangedValues = !isDifferentArOd(originalDifficulty, adjustedDifficulty); + haveRateChangedValues = isDifferentArOd(originalDifficulty, adjustedDifficulty); } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -204,13 +204,13 @@ namespace osu.Game.Screens.Select.Details private bool isDifferentArOd(BeatmapDifficulty a, BeatmapDifficulty b) { - if (a == null && b == null) return true; - if (a == null || b == null) return false; + if (a == null && b == null) return false; + if (a == null || b == null) return true; - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return false; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return false; + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return true; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return true; - return true; + return false; } public LocalisableString TooltipText From 4df1eb1b378cc4d5641ef4160b299f226e93dddf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 12 Nov 2023 16:15:33 +0900 Subject: [PATCH 045/567] Refactor logic and tooltip formatting --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 6 +- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 60 +++++++++---------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 7a9250a60e..382ac29b41 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -238,14 +238,12 @@ namespace osu.Game.Rulesets.Catch { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - double preempt = adjustedDifficulty.ApproachRate < 5 ? - (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : - (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + preempt /= rate; adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; } - } } diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 0a6f22d74a..5531ed5461 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -59,6 +59,8 @@ namespace osu.Game.Overlays.Mods private IBindable starDifficulty = null!; private BeatmapDifficulty? originalDifficulty; + private BeatmapDifficulty? adjustedDifficulty; + private bool haveRateChangedValues; private const float transition_duration = 250; @@ -171,17 +173,15 @@ namespace osu.Game.Overlays.Mods bpmDisplay.Current.Value = BeatmapInfo.Value.BPM * rate; - var adjustedDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); + originalDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); foreach (var mod in mods.Value.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); - - originalDifficulty = adjustedDifficulty; + mod.ApplyToDifficulty(originalDifficulty); Ruleset ruleset = gameRuleset.Value.CreateInstance(); - adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); + adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(originalDifficulty, rate); - haveRateChangedValues = isDifferentArOd(originalDifficulty, adjustedDifficulty); + haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); @@ -192,22 +192,34 @@ namespace osu.Game.Overlays.Mods overallDifficultyDisplay.Current.Value = adjustedDifficulty.OverallDifficulty; }); - private bool isDifferentArOd(BeatmapDifficulty? a, BeatmapDifficulty? b) - { - if (a == null && b == null) return false; - if (a == null || b == null) return true; - - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return true; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return true; - - return false; - } - private void updateCollapsedState() { RightContent.FadeTo(Collapsed.Value && !IsHovered ? 0 : 1, transition_duration, Easing.OutQuint); } + public LocalisableString TooltipText + { + get + { + if (haveRateChangedValues) + { + return $"One or more values are being adjusted by mods that change speed." + + $" (AR {originalDifficulty?.ApproachRate ?? 0}→{adjustedDifficulty?.ApproachRate ?? 0}, " + + $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{adjustedDifficulty?.OverallDifficulty ?? 0})"; + } + + return string.Empty; + } + } + + private static bool hasRateAdjustedProperties(BeatmapDifficulty a, BeatmapDifficulty b) + { + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate)) return true; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty)) return true; + + return false; + } + private partial class BPMDisplay : RollingCounter { protected override double RollingDuration => 500; @@ -222,19 +234,5 @@ namespace osu.Game.Overlays.Mods UseFullGlyphHeight = false, }; } - - public LocalisableString TooltipText - { - get - { - if (haveRateChangedValues) - { - return LocalisableString.Format("Values are changed by mods that change speed.\n" + - "Original values: AR = {0}, OD = {1}", originalDifficulty?.ApproachRate ?? 0, originalDifficulty?.OverallDifficulty ?? 0); - } - - return ""; - } - } } } From a04f9aaef7870d8ee94b85598aaca1d25dc22840 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 12 Nov 2023 16:20:13 +0900 Subject: [PATCH 046/567] Apply various inspections --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 4 ++-- osu.Game.Rulesets.Osu/OsuRuleset.cs | 6 ++---- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 382ac29b41..7327fb4513 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -238,12 +238,12 @@ namespace osu.Game.Rulesets.Catch { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + double preempt = adjustedDifficulty.ApproachRate < 6 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); preempt /= rate; adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); - return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + return adjustedDifficulty; } } } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 2d12e9ebc5..f4cf9409e8 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -334,9 +334,7 @@ namespace osu.Game.Rulesets.Osu { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); - double preempt = adjustedDifficulty.ApproachRate < 5 ? - (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : - (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); preempt /= rate; adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); @@ -344,7 +342,7 @@ namespace osu.Game.Rulesets.Osu hitwindow /= rate; adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6; - return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + return adjustedDifficulty; } } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index aaf32d35f2..88d0087622 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -273,7 +273,7 @@ namespace osu.Game.Rulesets.Taiko hitwindow /= rate; adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitwindow) / 15 + 5); - return adjustedDifficulty ?? (BeatmapDifficulty)baseDifficulty; + return adjustedDifficulty; } } } From 26d493986c318e2a390ecf02af10785f5ee760f1 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sun, 12 Nov 2023 18:05:18 +0200 Subject: [PATCH 047/567] Fixed precision and updated AdvancedStats --- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 4 +- .../Screens/Select/Details/AdvancedStats.cs | 48 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 5531ed5461..bf39666f83 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -204,8 +204,8 @@ namespace osu.Game.Overlays.Mods if (haveRateChangedValues) { return $"One or more values are being adjusted by mods that change speed." + - $" (AR {originalDifficulty?.ApproachRate ?? 0}→{adjustedDifficulty?.ApproachRate ?? 0}, " + - $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{adjustedDifficulty?.OverallDifficulty ?? 0})"; + $" (AR {originalDifficulty?.ApproachRate ?? 0}→{(adjustedDifficulty?.ApproachRate ?? 0):0.0#}, " + + $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{(adjustedDifficulty?.OverallDifficulty ?? 0):0.0#})"; } return string.Empty; diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index f84422ae65..25c18f7328 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -46,6 +46,7 @@ namespace osu.Game.Screens.Select.Details private readonly StatisticRow starDifficulty; private BeatmapDifficulty originalDifficulty; + private BeatmapDifficulty adjustedDifficulty; private bool haveRateChangedValues; private IBeatmapInfo beatmapInfo; @@ -120,24 +121,25 @@ namespace osu.Game.Screens.Select.Details private void updateStatistics() { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; - BeatmapDifficulty adjustedDifficulty = null; if (baseDifficulty != null) { - adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + originalDifficulty = new BeatmapDifficulty(baseDifficulty); foreach (var mod in mods.Value.OfType()) - mod.ApplyToDifficulty(adjustedDifficulty); + mod.ApplyToDifficulty(originalDifficulty); - originalDifficulty = adjustedDifficulty; + if (gameRuleset != null) + { + Ruleset ruleset = gameRuleset.Value.CreateInstance(); - Ruleset ruleset = gameRuleset.Value.CreateInstance(); - double rate = 1; - foreach (var mod in mods.Value.OfType()) - rate = mod.ApplyToRate(0, rate); - adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(adjustedDifficulty, rate); + double rate = 1; + foreach (var mod in mods.Value.OfType()) + rate = mod.ApplyToRate(0, rate); - haveRateChangedValues = isDifferentArOd(originalDifficulty, adjustedDifficulty); + adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(originalDifficulty, rate); + haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); + } } switch (BeatmapInfo?.Ruleset.OnlineID) @@ -202,31 +204,29 @@ namespace osu.Game.Screens.Select.Details starDifficultyCancellationSource?.Cancel(); } - private bool isDifferentArOd(BeatmapDifficulty a, BeatmapDifficulty b) - { - if (a == null && b == null) return false; - if (a == null || b == null) return true; - - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate, 0.01)) return true; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty, 0.01)) return true; - - return false; - } - public LocalisableString TooltipText { get { if (haveRateChangedValues) { - return LocalisableString.Format("Values are changed by mods that change speed.\n" + - "Original values: AR = {0}, OD = {1}", originalDifficulty?.ApproachRate ?? 0, originalDifficulty?.OverallDifficulty ?? 0); + return $"One or more values are being adjusted by mods that change speed." + + $" (AR {originalDifficulty?.ApproachRate ?? 0}→{(adjustedDifficulty?.ApproachRate ?? 0):0.0#}, " + + $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{(adjustedDifficulty?.OverallDifficulty ?? 0):0.0#})"; } - return ""; + return string.Empty; } } + private static bool hasRateAdjustedProperties(BeatmapDifficulty a, BeatmapDifficulty b) + { + if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate)) return true; + if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty)) return true; + + return false; + } + public partial class StatisticRow : Container, IHasAccentColour { private const float value_width = 25; From d1cea10f2197b243aff39ba16ee86b89f325fe44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2023 16:52:40 +0900 Subject: [PATCH 048/567] Add note about localisation --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 25c18f7328..85eb81eb9e 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -210,7 +210,8 @@ namespace osu.Game.Screens.Select.Details { if (haveRateChangedValues) { - return $"One or more values are being adjusted by mods that change speed." + + // Rather than localising this, it should be displayed in a better way (a custom tooltip which isn't a single super-long line). + return "One or more values are being adjusted by mods that change speed." + $" (AR {originalDifficulty?.ApproachRate ?? 0}→{(adjustedDifficulty?.ApproachRate ?? 0):0.0#}, " + $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{(adjustedDifficulty?.OverallDifficulty ?? 0):0.0#})"; } From 9172632b0b7177a643c2c1c26ab69533998298d8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2023 17:04:02 +0900 Subject: [PATCH 049/567] Rename method and adjust xmldoc to be very explicit about how wrong this is --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 4 ++-- osu.Game.Rulesets.Osu/OsuRuleset.cs | 4 ++-- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 4 ++-- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 19 ++++++++++--------- .../Screens/Select/Details/AdvancedStats.cs | 2 +- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 7327fb4513..94c8c36c09 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -234,9 +234,9 @@ namespace osu.Game.Rulesets.Catch }; } - public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) + public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { - BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); double preempt = adjustedDifficulty.ApproachRate < 6 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index f4cf9409e8..a99f0df066 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -330,9 +330,9 @@ namespace osu.Game.Rulesets.Osu public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); - public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) + public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { - BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); preempt /= rate; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 88d0087622..6e5cdbf2d1 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -265,9 +265,9 @@ namespace osu.Game.Rulesets.Taiko }; } - public override BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) + public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { - BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(baseDifficulty); + BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); double hitwindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5; hitwindow /= rate; diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index bf39666f83..6270b2bb49 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -179,7 +179,7 @@ namespace osu.Game.Overlays.Mods mod.ApplyToDifficulty(originalDifficulty); Ruleset ruleset = gameRuleset.Value.CreateInstance(); - adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(originalDifficulty, rate); + adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index edfe691b86..c7c81ecb55 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -377,6 +377,16 @@ namespace osu.Game.Rulesets /// The display name. public virtual LocalisableString GetDisplayNameForHitResult(HitResult result) => result.GetLocalisableDescription(); + /// + /// Applies changes to difficulty attributes for presenting to a user a rough estimate of how rate adjust mods affect difficulty. + /// Importantly, this should NOT BE USED FOR ANY CALCULATIONS. + /// It is also not always correct, and arguably is never correct depending on your frame of mind. + /// + /// >The that will be adjusted. + /// The rate adjustment multiplier from mods. For example 1.5 for DT. + /// The adjusted difficulty attributes. + public virtual BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) => new BeatmapDifficulty(difficulty); + /// /// Creates ruleset-specific beatmap filter criteria to be used on the song select screen. /// @@ -391,14 +401,5 @@ namespace osu.Game.Rulesets /// Can be overridden to alter the difficulty section to the editor beatmap setup screen. /// public virtual DifficultySection? CreateEditorDifficultySection() => null; - - /// - /// Changes after they're adjusted according to rate. - /// Doesn't change any attributes by default. - /// - /// >The that will be adjusted. - /// Rate of the gameplay. For example 1.5 for DT. - /// Copy of difficulty info with values changed according to rate and ruleset-specific behaviour. - public virtual BeatmapDifficulty GetRateAdjustedDifficulty(IBeatmapDifficultyInfo baseDifficulty, double rate) => new BeatmapDifficulty(baseDifficulty); } } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 85eb81eb9e..f617cb1d8e 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -137,7 +137,7 @@ namespace osu.Game.Screens.Select.Details foreach (var mod in mods.Value.OfType()) rate = mod.ApplyToRate(0, rate); - adjustedDifficulty = ruleset.GetRateAdjustedDifficulty(originalDifficulty, rate); + adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); } } From 2cf16e29acf5e5f397ea6ab98bbd8a8a6c5528f5 Mon Sep 17 00:00:00 2001 From: Zyf Date: Sun, 19 Nov 2023 21:02:56 +0100 Subject: [PATCH 050/567] Revert "Scoring : Adds fields to Catch/Mania/Taiko Simulators too" This reverts commit a97915180f37a87ac5716acdb0bfcafffe9e6452. --- .../Difficulty/CatchLegacyScoreSimulator.cs | 10 +++------- .../Difficulty/ManiaLegacyScoreSimulator.cs | 3 --- .../Difficulty/TaikoLegacyScoreSimulator.cs | 10 +++------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index 284fd23aea..c79fd36d96 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -20,12 +20,9 @@ namespace osu.Game.Rulesets.Catch.Difficulty public int ComboScore { get; private set; } - public int LegacyBonusScore { get; private set; } - - public int MaxCombo { get; private set; } - - public double BonusScoreRatio => LegacyBonusScore == 0 ? 0 : (double)modernBonusScore / LegacyBonusScore; + public double BonusScoreRatio => legacyBonusScore == 0 ? 0 : (double)modernBonusScore / legacyBonusScore; + private int legacyBonusScore; private int modernBonusScore; private int combo; @@ -77,7 +74,6 @@ namespace osu.Game.Rulesets.Catch.Difficulty foreach (var obj in playableBeatmap.HitObjects) simulateHit(obj); - MaxCombo = combo; } private void simulateHit(HitObject hitObject) @@ -133,7 +129,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty if (isBonus) { - LegacyBonusScore += scoreIncrease; + legacyBonusScore += scoreIncrease; modernBonusScore += Judgement.ToNumericResult(bonusResult); } else diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs index f09c911b98..e544428979 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs @@ -14,8 +14,6 @@ namespace osu.Game.Rulesets.Mania.Difficulty { public int AccuracyScore => 0; public int ComboScore { get; private set; } - public int LegacyBonusScore => 0; - public int MaxCombo { get; private set; } public double BonusScoreRatio => 0; public void Simulate(IWorkingBeatmap workingBeatmap, IBeatmap playableBeatmap, IReadOnlyList mods) @@ -25,7 +23,6 @@ namespace osu.Game.Rulesets.Mania.Difficulty .Aggregate(1.0, (c, n) => c * n); ComboScore = (int)(1000000 * multiplier); - MaxCombo = playableBeatmap.GetMaxCombo(); } } } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index 239ec5765c..e77327d622 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -20,12 +20,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty public int ComboScore { get; private set; } - public int LegacyBonusScore { get; private set; } - - public int MaxCombo { get; private set; } - - public double BonusScoreRatio => LegacyBonusScore == 0 ? 0 : (double)modernBonusScore / LegacyBonusScore; + public double BonusScoreRatio => legacyBonusScore == 0 ? 0 : (double)modernBonusScore / legacyBonusScore; + private int legacyBonusScore; private int modernBonusScore; private int combo; @@ -83,7 +80,6 @@ namespace osu.Game.Rulesets.Taiko.Difficulty foreach (var obj in playableBeatmap.HitObjects) simulateHit(obj); - MaxCombo = combo; } private void simulateHit(HitObject hitObject) @@ -193,7 +189,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty if (isBonus) { - LegacyBonusScore += scoreIncrease; + legacyBonusScore += scoreIncrease; modernBonusScore += Judgement.ToNumericResult(bonusResult); } else From 432b88674b3d2e0eff6bbf80b26016eea6da0b2d Mon Sep 17 00:00:00 2001 From: Zyf Date: Mon, 20 Nov 2023 00:02:58 +0100 Subject: [PATCH 051/567] Scoring : change formula parameters to match survey results --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 6 +++--- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index c38dd0e9cf..dfc2f8fb62 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -316,11 +316,11 @@ namespace osu.Game.Database 1.2 * (newLowerStrippedV3 + newUpperStrippedV3) / 2 ); - double newComboScoreProportion = (strippedV3 / maxStrippedV3) * score.Accuracy; + double newComboScoreProportion = (strippedV3 / maxStrippedV3); return (long)Math.Round(( - 700000 * newComboScoreProportion * score.Accuracy - + 300000 * Math.Pow(score.Accuracy, 8) + 500000 * newComboScoreProportion * score.Accuracy + + 500000 * Math.Pow(score.Accuracy, 5) + bonusProportion) * modMultiplier); case 1: diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 514630b351..adf8e318d3 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -301,7 +301,7 @@ namespace osu.Game.Rulesets.Scoring protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type); - protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); + protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Judgement.MaxResult) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); protected virtual void ApplyScoreChange(JudgementResult result) { @@ -325,8 +325,8 @@ namespace osu.Game.Rulesets.Scoring protected virtual double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 700000 * Accuracy.Value * comboProgress + - 300000 * Math.Pow(Accuracy.Value, 8) * accuracyProgress + + return 500000 * Accuracy.Value * comboProgress + + 500000 * Math.Pow(Accuracy.Value, 5) * accuracyProgress + bonusPortion; } From 1f88658bade025040f3c97a08020de9e21dba41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Burgelin=20=28Zyfarok=29?= Date: Mon, 20 Nov 2023 03:05:46 +0100 Subject: [PATCH 052/567] Fix syntax --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 ++ osu.Game/Rulesets/Scoring/Legacy/LegacyScoreAttributes.cs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index dfc2f8fb62..685f852eb4 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -267,10 +267,12 @@ namespace osu.Game.Database { case 0: if (score.MaxCombo == 0 || score.Accuracy == 0) + { return (long)Math.Round(( 0 + 300000 * Math.Pow(score.Accuracy, 8) + bonusProportion) * modMultiplier); + } // Assumption : // - sliders and slider-ticks are uniformly spread arround the beatmap diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreAttributes.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreAttributes.cs index c2f87be194..6f6740c641 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreAttributes.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreAttributes.cs @@ -29,6 +29,5 @@ namespace osu.Game.Rulesets.Scoring.Legacy /// The max combo of the legacy (ScoreV1) total score. /// public int MaxCombo; - } } From 16acec335f825eb93c791e64010f35e030f4ff69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Burgelin=20=28Zyf=29?= Date: Tue, 21 Nov 2023 11:27:03 +0100 Subject: [PATCH 053/567] Fix: update score migration of special case to match the new score MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartłomiej Dach --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 685f852eb4..a9569ac9ba 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -270,7 +270,7 @@ namespace osu.Game.Database { return (long)Math.Round(( 0 - + 300000 * Math.Pow(score.Accuracy, 8) + + 500000 * Math.Pow(score.Accuracy, 5) + bonusProportion) * modMultiplier); } From 901e45b6a4f134143d512c6cec378149c6bc4aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Burgelin=20=28Zyfarok=29?= Date: Tue, 21 Nov 2023 11:54:07 +0100 Subject: [PATCH 054/567] Scoring conversion: remove mention of v3 + improve comments --- .../StandardisedScoreMigrationTools.cs | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index a9569ac9ba..fe51c6f130 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -275,50 +275,52 @@ namespace osu.Game.Database } // Assumption : - // - sliders and slider-ticks are uniformly spread arround the beatmap - // thus we can ignore them without losing much precision (consider a map of hit-circles only !) - // - the Ok/Meh hit results are uniformly spread in the score - // thus we can simplify and consider each hit result to be score.Accuracy without losing much precision - // What is strippedV1/strippedV3 : - // This is the ComboScore of v1/v3 were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), - // based on the previous assumptions. For Scorev1, this is basically the sum of squared combos (because without sliders: object_count == combo). + // - sliders and slider-ticks are uniformly spread arround the beatmap, and thus can be ignored without losing much precision. + // We thus consider a map of hit-circles only, which gives objectCount == maximumCombo ! + // - the Ok/Meh hit results are uniformly spread in the score, and thus can be ignored without losing much precision. + // We simplify and consider each hit result to be equal to `300*score.Accuracy`, which allows us to isolate the accuracy multiplier. + // What is strippedV1/strippedNew : + // This is the ComboScore (of v1 / new score) were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), + // based on the previous assumptions. + // We use integrals to approximate the sum of each object's combo contribution (thus the original combo exponent is increased by 1) + // For the maximum score, we thus integrate `f(combo) = 300*combo^exponent`, and ignoring the constant multipliers we get: double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2); - double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + double maxStrippedNew = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy; double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2); - double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + double strippedNewFromMaxCombo = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - // Compute approximate lower estimate scorev3 for that play + // Compute approximate lower estimate new score for that play // That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo) // And didn't combo anything in the reminder of the map double possibleMaxComboRepeat = Math.Floor(strippedV1 / strippedV1FromMaxCombo); double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo; double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat; double remainingCombo = Math.Sqrt(remainingStrippedV1); - double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + double remainingStrippedNew = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - double newLowerStrippedV3 = (possibleMaxComboRepeat * strippedV3FromMaxCombo) + remainingStrippedV3; + double lowerStrippedNew = (possibleMaxComboRepeat * strippedNewFromMaxCombo) + remainingStrippedNew; - // Compute approximate upper estimate scorev3 for that play + // Compute approximate upper estimate new score for that play // That is, a play were all combos were equal (except MaxCombo) remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo; double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0; - remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, ScoreProcessor.COMBO_EXPONENT); + remainingStrippedNew = remainingComboObjects * Math.Pow(remainingAverageCombo, ScoreProcessor.COMBO_EXPONENT); - double newUpperStrippedV3 = strippedV3FromMaxCombo + remainingStrippedV3; + double upperStrippedNew = strippedNewFromMaxCombo + remainingStrippedNew; // Approximate by combining lower and upper estimates // As the lower-estimate is very pessimistic, we use a 30/70 ratio // And cap it with 1.2 times the middle-point to avoid overstimates - double strippedV3 = Math.Min( - 0.3 * newLowerStrippedV3 + 0.7 * newUpperStrippedV3, - 1.2 * (newLowerStrippedV3 + newUpperStrippedV3) / 2 + double strippedNew = Math.Min( + 0.3 * lowerStrippedNew + 0.7 * upperStrippedNew, + 1.2 * (lowerStrippedNew + upperStrippedNew) / 2 ); - double newComboScoreProportion = (strippedV3 / maxStrippedV3); + double newComboScoreProportion = (strippedNew / maxStrippedNew); return (long)Math.Round(( 500000 * newComboScoreProportion * score.Accuracy From c2a44cf1185dd28897f5488829124d7533cfb337 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 23 Nov 2023 23:30:18 +0200 Subject: [PATCH 055/567] Made custom tooltip --- .../Mods/AdjustedAttributesTooltip.cs | 158 ++++++++++++++++++ .../Overlays/Mods/BeatmapAttributesDisplay.cs | 46 ++--- .../Screens/Select/Details/AdvancedStats.cs | 38 ++--- 3 files changed, 188 insertions(+), 54 deletions(-) create mode 100644 osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs new file mode 100644 index 0000000000..e6a554d1fb --- /dev/null +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -0,0 +1,158 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Framework.Utils; +using osuTK; + +namespace osu.Game.Overlays.Mods +{ + public partial class AdjustedAttributesTooltip : CompositeDrawable, ITooltip + { + private Dictionary> attributes = new Dictionary>(); + + private Container content; + + private FillFlowContainer attributesFillFlow; + + [Resolved] + private OsuColour colours { get; set; } = null!; + + + public AdjustedAttributesTooltip() + { + // Need to be initialized in constructor to ensure accessability in AddAttribute function + InternalChild = content = new Container + { + AutoSizeAxes = Axes.Both + }; + attributesFillFlow = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both + }; + } + + [BackgroundDependencyLoader] + private void load() + { + AutoSizeAxes = Axes.Both; + + Masking = true; + CornerRadius = 15; + + content.AddRange(new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colours.Gray1, + Alpha = 0.8f + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Padding = new MarginPadding {Vertical = 10, Horizontal = 15}, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "One or more values are being adjusted by mods that change speed.", + }, + attributesFillFlow + } + } + }); + } + + private void checkAttributes() + { + foreach (var attribute in attributes) + { + if (!Precision.AlmostEquals(attribute.Value.Value.Old, attribute.Value.Value.New)) + { + content.Show(); + return; + } + } + content.Hide(); + } + + public void AddAttribute(string name) + { + Bindable newBindable = new Bindable(); + newBindable.BindValueChanged(_ => checkAttributes()); + attributes.Add(name, newBindable); + attributesFillFlow.Add(new AttributeDisplay(name, newBindable.GetBoundCopy())); + } + public void UpdateAttribute(string name, double oldValue, double newValue) + { + Bindable attribute = attributes[name]; + + OldNewPair attributeValue = attribute.Value; + attributeValue.Old = oldValue; + attributeValue.New = newValue; + + attribute.Value = attributeValue; + } + + protected override void Update() + { + } + public void SetContent(object content) + { + } + + public void Move(Vector2 pos) + { + Position = pos; + } + + private struct OldNewPair + { + public double Old, New; + } + + private partial class AttributeDisplay : CompositeDrawable + { + public Bindable AttributeValues = new Bindable(); + public string AttributeName; + + private OsuSpriteText text = new OsuSpriteText + { + Font = OsuFont.Default.With(weight: FontWeight.Bold) + }; + public AttributeDisplay(string name, Bindable boundCopy) + { + AutoSizeAxes = Axes.Both; + + AttributeName = name; + AttributeValues = boundCopy; + InternalChild = text; + AttributeValues.BindValueChanged(_ => update(), true); + } + + private void update() + { + if (Precision.AlmostEquals(AttributeValues.Value.Old, AttributeValues.Value.New)) + { + Hide(); + } + else + { + Show(); + text.Text = $"{AttributeName}: {(AttributeValues.Value.Old):0.0#} → {(AttributeValues.Value.New):0.0#}"; + } + } + } + } +} diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 6270b2bb49..fa8f9cb7a4 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; using osu.Framework.Input.Events; using osu.Framework.Localisation; -using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Configuration; @@ -28,7 +27,7 @@ namespace osu.Game.Overlays.Mods /// On the mod select overlay, this provides a local updating view of BPM, star rating and other /// difficulty attributes so the user can have a better insight into what mods are changing. /// - public partial class BeatmapAttributesDisplay : ModFooterInformationDisplay, IHasTooltip + public partial class BeatmapAttributesDisplay : ModFooterInformationDisplay, IHasCustomTooltip { private StarRatingDisplay starRatingDisplay = null!; private BPMDisplay bpmDisplay = null!; @@ -58,10 +57,11 @@ namespace osu.Game.Overlays.Mods private CancellationTokenSource? cancellationSource; private IBindable starDifficulty = null!; - private BeatmapDifficulty? originalDifficulty; - private BeatmapDifficulty? adjustedDifficulty; + private AdjustedAttributesTooltip rateAdjustTooltip = null!; + + public ITooltip GetCustomTooltip() => rateAdjustTooltip; + public object TooltipContent => this; - private bool haveRateChangedValues; private const float transition_duration = 250; @@ -70,6 +70,8 @@ namespace osu.Game.Overlays.Mods { const float shear = ShearedOverlayContainer.SHEAR; + rateAdjustTooltip = new AdjustedAttributesTooltip(); + LeftContent.AddRange(new Drawable[] { starRatingDisplay = new StarRatingDisplay(default, animated: true) @@ -105,7 +107,6 @@ namespace osu.Game.Overlays.Mods mods.BindValueChanged(_ => { modSettingChangeTracker?.Dispose(); - modSettingChangeTracker = new ModSettingChangeTracker(mods.Value); modSettingChangeTracker.SettingChanged += _ => updateValues(); updateValues(); @@ -125,6 +126,9 @@ namespace osu.Game.Overlays.Mods BeatmapInfo.BindValueChanged(_ => updateValues(), true); + rateAdjustTooltip.AddAttribute("AR"); + rateAdjustTooltip.AddAttribute("OD"); + updateCollapsedState(); } @@ -173,15 +177,16 @@ namespace osu.Game.Overlays.Mods bpmDisplay.Current.Value = BeatmapInfo.Value.BPM * rate; - originalDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); + BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(BeatmapInfo.Value.Difficulty); foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(originalDifficulty); Ruleset ruleset = gameRuleset.Value.CreateInstance(); - adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); + BeatmapDifficulty adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); + rateAdjustTooltip.UpdateAttribute("AR", originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); + rateAdjustTooltip.UpdateAttribute("OD", originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); @@ -197,29 +202,6 @@ namespace osu.Game.Overlays.Mods RightContent.FadeTo(Collapsed.Value && !IsHovered ? 0 : 1, transition_duration, Easing.OutQuint); } - public LocalisableString TooltipText - { - get - { - if (haveRateChangedValues) - { - return $"One or more values are being adjusted by mods that change speed." + - $" (AR {originalDifficulty?.ApproachRate ?? 0}→{(adjustedDifficulty?.ApproachRate ?? 0):0.0#}, " + - $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{(adjustedDifficulty?.OverallDifficulty ?? 0):0.0#})"; - } - - return string.Empty; - } - } - - private static bool hasRateAdjustedProperties(BeatmapDifficulty a, BeatmapDifficulty b) - { - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate)) return true; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty)) return true; - - return false; - } - private partial class BPMDisplay : RollingCounter { protected override double RollingDuration => 500; diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index f617cb1d8e..d3a6a88c68 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -26,10 +26,11 @@ using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; +using osu.Game.Overlays.Mods; namespace osu.Game.Screens.Select.Details { - public partial class AdvancedStats : Container, IHasTooltip + public partial class AdvancedStats : Container, IHasCustomTooltip { [Resolved] private BeatmapDifficultyCache difficultyCache { get; set; } @@ -45,9 +46,9 @@ namespace osu.Game.Screens.Select.Details protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; private readonly StatisticRow starDifficulty; - private BeatmapDifficulty originalDifficulty; - private BeatmapDifficulty adjustedDifficulty; - private bool haveRateChangedValues; + private AdjustedAttributesTooltip rateAdjustTooltip; + public ITooltip GetCustomTooltip() => rateAdjustTooltip; + public object TooltipContent => this; private IBeatmapInfo beatmapInfo; @@ -85,6 +86,7 @@ namespace osu.Game.Screens.Select.Details private void load(OsuColour colours) { starDifficulty.AccentColour = colours.Yellow; + rateAdjustTooltip = new AdjustedAttributesTooltip(); } protected override void LoadComplete() @@ -99,6 +101,9 @@ namespace osu.Game.Screens.Select.Details gameRuleset.BindValueChanged(_ => updateStatistics()); mods.BindValueChanged(modsChanged, true); + + rateAdjustTooltip.AddAttribute("AR"); + rateAdjustTooltip.AddAttribute("OD"); } private ModSettingChangeTracker modSettingChangeTracker; @@ -121,14 +126,17 @@ namespace osu.Game.Screens.Select.Details private void updateStatistics() { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; + BeatmapDifficulty adjustedDifficulty = null; if (baseDifficulty != null) { - originalDifficulty = new BeatmapDifficulty(baseDifficulty); + BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(baseDifficulty); foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(originalDifficulty); + adjustedDifficulty = originalDifficulty; + if (gameRuleset != null) { Ruleset ruleset = gameRuleset.Value.CreateInstance(); @@ -138,7 +146,9 @@ namespace osu.Game.Screens.Select.Details rate = mod.ApplyToRate(0, rate); adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - haveRateChangedValues = hasRateAdjustedProperties(originalDifficulty, adjustedDifficulty); + + rateAdjustTooltip.UpdateAttribute("AR", originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); + rateAdjustTooltip.UpdateAttribute("OD", originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); } } @@ -204,22 +214,6 @@ namespace osu.Game.Screens.Select.Details starDifficultyCancellationSource?.Cancel(); } - public LocalisableString TooltipText - { - get - { - if (haveRateChangedValues) - { - // Rather than localising this, it should be displayed in a better way (a custom tooltip which isn't a single super-long line). - return "One or more values are being adjusted by mods that change speed." + - $" (AR {originalDifficulty?.ApproachRate ?? 0}→{(adjustedDifficulty?.ApproachRate ?? 0):0.0#}, " + - $"OD {originalDifficulty?.OverallDifficulty ?? 0}→{(adjustedDifficulty?.OverallDifficulty ?? 0):0.0#})"; - } - - return string.Empty; - } - } - private static bool hasRateAdjustedProperties(BeatmapDifficulty a, BeatmapDifficulty b) { if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate)) return true; From 93e3156868d674dd3f9a79729c5561859d96f063 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Fri, 24 Nov 2023 01:07:37 +0200 Subject: [PATCH 056/567] slight format changes --- osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index e6a554d1fb..3e800bfaf1 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -26,7 +26,6 @@ namespace osu.Game.Overlays.Mods [Resolved] private OsuColour colours { get; set; } = null!; - public AdjustedAttributesTooltip() { // Need to be initialized in constructor to ensure accessability in AddAttribute function @@ -60,7 +59,7 @@ namespace osu.Game.Overlays.Mods new FillFlowContainer { AutoSizeAxes = Axes.Both, - Padding = new MarginPadding {Vertical = 10, Horizontal = 15}, + Padding = new MarginPadding { Vertical = 10, Horizontal = 15 }, Direction = FillDirection.Vertical, Children = new Drawable[] { @@ -85,6 +84,7 @@ namespace osu.Game.Overlays.Mods } } content.Hide(); + } public void AddAttribute(string name) @@ -94,6 +94,7 @@ namespace osu.Game.Overlays.Mods attributes.Add(name, newBindable); attributesFillFlow.Add(new AttributeDisplay(name, newBindable.GetBoundCopy())); } + public void UpdateAttribute(string name, double oldValue, double newValue) { Bindable attribute = attributes[name]; @@ -124,7 +125,7 @@ namespace osu.Game.Overlays.Mods private partial class AttributeDisplay : CompositeDrawable { - public Bindable AttributeValues = new Bindable(); + public readonly Bindable AttributeValues; public string AttributeName; private OsuSpriteText text = new OsuSpriteText From 7590bae445b331aa9d5d2bb4c1dd3730a9cb97c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 22 Nov 2023 12:50:08 +0900 Subject: [PATCH 057/567] Rename and comment everything in score migration code Hopefully, _hopefully_, makes all this a little bit less inscrutable. --- .../StandardisedScoreMigrationTools.cs | 98 ++++++++++++------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index fe51c6f130..77421908de 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -274,53 +274,79 @@ namespace osu.Game.Database + bonusProportion) * modMultiplier); } - // Assumption : - // - sliders and slider-ticks are uniformly spread arround the beatmap, and thus can be ignored without losing much precision. - // We thus consider a map of hit-circles only, which gives objectCount == maximumCombo ! + // Assumptions: + // - sliders and slider ticks are uniformly distributed in the beatmap, and thus can be ignored without losing much precision. + // We thus consider a map of hit-circles only, which gives objectCount == maximumCombo. // - the Ok/Meh hit results are uniformly spread in the score, and thus can be ignored without losing much precision. - // We simplify and consider each hit result to be equal to `300*score.Accuracy`, which allows us to isolate the accuracy multiplier. - // What is strippedV1/strippedNew : - // This is the ComboScore (of v1 / new score) were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), - // based on the previous assumptions. - // We use integrals to approximate the sum of each object's combo contribution (thus the original combo exponent is increased by 1) - // For the maximum score, we thus integrate `f(combo) = 300*combo^exponent`, and ignoring the constant multipliers we get: - double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2); - double maxStrippedNew = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + // We simplify and consider each hit result to have the same hit value of `300 * score.Accuracy` + // (which represents the average hit value over the entire play), + // which allows us to isolate the accuracy multiplier. - double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy; + // This is a very ballpark estimate of the maximum magnitude of the combo portion in score V1. + // It is derived by assuming a full combo play and summing up the contribution to combo portion from each individual object. + // Because each object's combo contribution is proportional to the current combo at the time of judgement, + // this can be roughly represented by summing / integrating f(combo) = combo. + // All mod- and beatmap-dependent multipliers and constants are not included here, + // as we will only be using the magnitude of this to compute ratios. + double maximumAchievableComboPortionInScoreV1 = Math.Pow(maximumLegacyCombo, 2); + // Similarly, estimate the maximum magnitude of the combo portion in standardised score. + // Roughly corresponds to integrating f(combo) = combo ^ COMBO_EXPONENT (omitting constants) + double maximumAchievableComboPortionInStandardisedScore = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2); - double strippedNewFromMaxCombo = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + double comboPortionInScoreV1 = maximumAchievableComboPortionInScoreV1 * comboProportion / score.Accuracy; - // Compute approximate lower estimate new score for that play - // That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo) - // And didn't combo anything in the reminder of the map - double possibleMaxComboRepeat = Math.Floor(strippedV1 / strippedV1FromMaxCombo); - double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo; - double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat; - double remainingCombo = Math.Sqrt(remainingStrippedV1); - double remainingStrippedNew = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + // This is - roughly - how much score, in the combo portion, the longest combo on this particular play would gain in score V1. + double comboPortionFromLongestComboInScoreV1 = Math.Pow(score.MaxCombo, 2); + // Same for standardised score. + double comboPortionFromLongestComboInStandardisedScore = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - double lowerStrippedNew = (possibleMaxComboRepeat * strippedNewFromMaxCombo) + remainingStrippedNew; + // Calculate how many times the longest combo the user has achieved in the play can repeat + // without exceeding the combo portion in score V1 as achieved by the player. + // This is a pessimistic estimate; it intentionally does not operate on object count and uses only score instead. + double maximumOccurrencesOfLongestCombo = Math.Floor(comboPortionInScoreV1 / comboPortionFromLongestComboInScoreV1); + double comboPortionFromRepeatedLongestCombosInScoreV1 = maximumOccurrencesOfLongestCombo * comboPortionFromLongestComboInScoreV1; - // Compute approximate upper estimate new score for that play - // That is, a play were all combos were equal (except MaxCombo) - remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo; - double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; - double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0; - remainingStrippedNew = remainingComboObjects * Math.Pow(remainingAverageCombo, ScoreProcessor.COMBO_EXPONENT); + double remainingComboPortionInScoreV1 = comboPortionInScoreV1 - comboPortionFromRepeatedLongestCombosInScoreV1; + // `remainingComboPortionInScoreV1` is in the "score ballpark" realm, which means it's proportional to combo squared. + // To convert that back to a raw combo length, we need to take the square root... + double remainingCombo = Math.Sqrt(remainingComboPortionInScoreV1); + // ...and then based on that raw combo length, we calculate how much this last combo is worth in standardised score. + double remainingComboPortionInStandardisedScore = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - double upperStrippedNew = strippedNewFromMaxCombo + remainingStrippedNew; + double lowerEstimateOfComboPortionInStandardisedScore + = maximumOccurrencesOfLongestCombo * comboPortionFromLongestComboInStandardisedScore + + remainingComboPortionInStandardisedScore; - // Approximate by combining lower and upper estimates + // Compute approximate upper estimate new score for that play. + // This time, divide the remaining combo among remaining objects equally to achieve longest possible combo lengths. + // There is no rigorous proof that doing this will yield a correct upper bound, but it seems to work out in practice. + remainingComboPortionInScoreV1 = comboPortionInScoreV1 - comboPortionFromLongestComboInScoreV1; + double remainingCountOfObjectsGivingCombo = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; + // Because we assumed all combos were equal, `remainingComboPortionInScoreV1` + // can be approximated by n * x^2, wherein n is the assumed number of equal combos, + // and x is the assumed length of every one of those combos. + // The remaining count of objects giving combo is, using those terms, equal to n * x. + // Therefore, dividing the two will result in x, i.e. the assumed length of the remaining combos. + double lengthOfRemainingCombos = remainingCountOfObjectsGivingCombo > 0 + ? remainingComboPortionInScoreV1 / remainingCountOfObjectsGivingCombo + : 0; + // In standardised scoring, each combo yields a score proportional to combo length to the power 1 + COMBO_EXPONENT. + // Using the symbols introduced above, that would be x ^ 1.5 per combo, n times (because there are n assumed equal-length combos). + // However, because `remainingCountOfObjectsGivingCombo` - using the symbols introduced above - is assumed to be equal to n * x, + // we can skip adding the 1 and just multiply by x ^ 0.5. + remainingComboPortionInStandardisedScore = remainingCountOfObjectsGivingCombo * Math.Pow(lengthOfRemainingCombos, ScoreProcessor.COMBO_EXPONENT); + + double upperEstimateOfComboPortionInStandardisedScore = comboPortionFromLongestComboInStandardisedScore + remainingComboPortionInStandardisedScore; + + // Approximate by combining lower and upper estimates. // As the lower-estimate is very pessimistic, we use a 30/70 ratio - // And cap it with 1.2 times the middle-point to avoid overstimates - double strippedNew = Math.Min( - 0.3 * lowerStrippedNew + 0.7 * upperStrippedNew, - 1.2 * (lowerStrippedNew + upperStrippedNew) / 2 + // and cap it with 1.2 times the middle-point to avoid overestimates. + double estimatedComboPortionInStandardisedScore = Math.Min( + 0.3 * lowerEstimateOfComboPortionInStandardisedScore + 0.7 * upperEstimateOfComboPortionInStandardisedScore, + 1.2 * (lowerEstimateOfComboPortionInStandardisedScore + upperEstimateOfComboPortionInStandardisedScore) / 2 ); - double newComboScoreProportion = (strippedNew / maxStrippedNew); + double newComboScoreProportion = estimatedComboPortionInStandardisedScore / maximumAchievableComboPortionInStandardisedScore; return (long)Math.Round(( 500000 * newComboScoreProportion * score.Accuracy From 2a6885164ced88450bd17bc24aea91d55a08343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 24 Nov 2023 10:46:21 +0900 Subject: [PATCH 058/567] Update tests to match new scoring expectations --- .../Rulesets/Scoring/ScoreProcessorTest.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs index c957ddd7d3..fd041d3dd0 100644 --- a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs +++ b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs @@ -45,11 +45,11 @@ namespace osu.Game.Tests.Rulesets.Scoring }; } - [TestCase(ScoringMode.Standardised, HitResult.Meh, 116_667)] - [TestCase(ScoringMode.Standardised, HitResult.Ok, 233_338)] + [TestCase(ScoringMode.Standardised, HitResult.Meh, 83_398)] + [TestCase(ScoringMode.Standardised, HitResult.Ok, 168_724)] [TestCase(ScoringMode.Standardised, HitResult.Great, 1_000_000)] - [TestCase(ScoringMode.Classic, HitResult.Meh, 11_670)] - [TestCase(ScoringMode.Classic, HitResult.Ok, 23_341)] + [TestCase(ScoringMode.Classic, HitResult.Meh, 8_343)] + [TestCase(ScoringMode.Classic, HitResult.Ok, 16_878)] [TestCase(ScoringMode.Classic, HitResult.Great, 100_033)] public void TestSingleOsuHit(ScoringMode scoringMode, HitResult hitResult, int expectedScore) { @@ -75,27 +75,27 @@ namespace osu.Game.Tests.Rulesets.Scoring /// This test intentionally misses the 3rd hitobject to achieve lower than 75% accuracy and 50% max combo. /// [TestCase(ScoringMode.Standardised, HitResult.Miss, HitResult.Great, 0)] - [TestCase(ScoringMode.Standardised, HitResult.Meh, HitResult.Great, 79_333)] - [TestCase(ScoringMode.Standardised, HitResult.Ok, HitResult.Great, 158_667)] - [TestCase(ScoringMode.Standardised, HitResult.Good, HitResult.Perfect, 317_626)] - [TestCase(ScoringMode.Standardised, HitResult.Great, HitResult.Great, 492_894)] - [TestCase(ScoringMode.Standardised, HitResult.Perfect, HitResult.Perfect, 492_894)] + [TestCase(ScoringMode.Standardised, HitResult.Meh, HitResult.Great, 34_734)] + [TestCase(ScoringMode.Standardised, HitResult.Ok, HitResult.Great, 69_925)] + [TestCase(ScoringMode.Standardised, HitResult.Good, HitResult.Perfect, 154_499)] + [TestCase(ScoringMode.Standardised, HitResult.Great, HitResult.Great, 326_963)] + [TestCase(ScoringMode.Standardised, HitResult.Perfect, HitResult.Perfect, 326_963)] [TestCase(ScoringMode.Standardised, HitResult.SmallTickMiss, HitResult.SmallTickHit, 0)] - [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 541_894)] + [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 493_652)] [TestCase(ScoringMode.Standardised, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] - [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 492_894)] + [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 326_963)] [TestCase(ScoringMode.Standardised, HitResult.SmallBonus, HitResult.SmallBonus, 1_000_030)] [TestCase(ScoringMode.Standardised, HitResult.LargeBonus, HitResult.LargeBonus, 1_000_150)] [TestCase(ScoringMode.Classic, HitResult.Miss, HitResult.Great, 0)] - [TestCase(ScoringMode.Classic, HitResult.Meh, HitResult.Great, 7_975)] - [TestCase(ScoringMode.Classic, HitResult.Ok, HitResult.Great, 15_949)] - [TestCase(ScoringMode.Classic, HitResult.Good, HitResult.Perfect, 31_928)] - [TestCase(ScoringMode.Classic, HitResult.Great, HitResult.Great, 49_546)] - [TestCase(ScoringMode.Classic, HitResult.Perfect, HitResult.Perfect, 49_546)] + [TestCase(ScoringMode.Classic, HitResult.Meh, HitResult.Great, 3_492)] + [TestCase(ScoringMode.Classic, HitResult.Ok, HitResult.Great, 7_029)] + [TestCase(ScoringMode.Classic, HitResult.Good, HitResult.Perfect, 15_530)] + [TestCase(ScoringMode.Classic, HitResult.Great, HitResult.Great, 32_867)] + [TestCase(ScoringMode.Classic, HitResult.Perfect, HitResult.Perfect, 32_867)] [TestCase(ScoringMode.Classic, HitResult.SmallTickMiss, HitResult.SmallTickHit, 0)] - [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 54_189)] + [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 49_365)] [TestCase(ScoringMode.Classic, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] - [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 49_289)] + [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 32_696)] [TestCase(ScoringMode.Classic, HitResult.SmallBonus, HitResult.SmallBonus, 100_003)] [TestCase(ScoringMode.Classic, HitResult.LargeBonus, HitResult.LargeBonus, 100_015)] public void TestFourVariousResultsOneMiss(ScoringMode scoringMode, HitResult hitResult, HitResult maxResult, int expectedScore) From 27f9dfccc46429f2956d6ce4c3759620178fabf1 Mon Sep 17 00:00:00 2001 From: Zyf Date: Fri, 24 Nov 2023 22:05:24 +0100 Subject: [PATCH 059/567] Fix scoring-conversion when miss-count is 0 --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 77421908de..457262a1de 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -321,7 +321,7 @@ namespace osu.Game.Database // This time, divide the remaining combo among remaining objects equally to achieve longest possible combo lengths. // There is no rigorous proof that doing this will yield a correct upper bound, but it seems to work out in practice. remainingComboPortionInScoreV1 = comboPortionInScoreV1 - comboPortionFromLongestComboInScoreV1; - double remainingCountOfObjectsGivingCombo = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; + double remainingCountOfObjectsGivingCombo = maximumLegacyCombo - score.MaxCombo - score.Statistics.GetValueOrDefault(HitResult.Miss); // Because we assumed all combos were equal, `remainingComboPortionInScoreV1` // can be approximated by n * x^2, wherein n is the assumed number of equal combos, // and x is the assumed length of every one of those combos. From 71e5654b645c07da60b7acbfbe60fe71021f9c45 Mon Sep 17 00:00:00 2001 From: Zyf Date: Fri, 24 Nov 2023 23:07:27 +0100 Subject: [PATCH 060/567] Account for legacyAccScore in score conversion --- .../Difficulty/CatchLegacyScoreSimulator.cs | 1 + .../Difficulty/TaikoLegacyScoreSimulator.cs | 1 + .../Database/StandardisedScoreMigrationTools.cs | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index 746f5713e4..ed27e11208 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -74,6 +74,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty simulateHit(obj, ref attributes); attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; + attributes.BonusScore = legacyBonusScore; return attributes; } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index 6a3eb68a22..1db44592b8 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -75,6 +75,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty simulateHit(obj, ref attributes); attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; + attributes.BonusScore = legacyBonusScore; return attributes; } diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 457262a1de..6484500bcc 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -250,15 +250,14 @@ namespace osu.Game.Database long maximumLegacyComboScore = (long)Math.Round(attributes.ComboScore * legacyModMultiplier); double maximumLegacyBonusRatio = attributes.BonusScoreRatio; long maximumLegacyBonusScore = attributes.BonusScore; - int maximumLegacyCombo = attributes.MaxCombo; + double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy; + // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. + double comboProportion = + ((double)score.LegacyTotalScore - legacyAccScore) / (maximumLegacyComboScore + maximumLegacyBonusScore); + + // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; - long maximumLegacyTotalScore = maximumLegacyBaseScore + maximumLegacyBonusScore; - - // The combo proportion is calculated as a proportion of maximumLegacyTotalScore. - double comboProportion = (double)score.LegacyTotalScore / maximumLegacyTotalScore; - - // The bonus proportion makes up the rest of the score that exceeds maximumLegacyBaseScore. double bonusProportion = Math.Max(0, ((long)score.LegacyTotalScore - maximumLegacyBaseScore) * maximumLegacyBonusRatio); double modMultiplier = score.Mods.Select(m => m.ScoreMultiplier).Aggregate(1.0, (c, n) => c * n); @@ -288,6 +287,7 @@ namespace osu.Game.Database // this can be roughly represented by summing / integrating f(combo) = combo. // All mod- and beatmap-dependent multipliers and constants are not included here, // as we will only be using the magnitude of this to compute ratios. + int maximumLegacyCombo = attributes.MaxCombo; double maximumAchievableComboPortionInScoreV1 = Math.Pow(maximumLegacyCombo, 2); // Similarly, estimate the maximum magnitude of the combo portion in standardised score. // Roughly corresponds to integrating f(combo) = combo ^ COMBO_EXPONENT (omitting constants) From 68fca007577f29c9b57e7df2e33b6dd09ee6d7b2 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 25 Nov 2023 02:40:30 +0300 Subject: [PATCH 061/567] Improve handling of beatmap collection changes in `CollectionDropdown` Co-authored-by: Dean Herbert --- osu.Game/Collections/CollectionDropdown.cs | 72 +++++++++++++--------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/osu.Game/Collections/CollectionDropdown.cs b/osu.Game/Collections/CollectionDropdown.cs index e435992381..299594b0a0 100644 --- a/osu.Game/Collections/CollectionDropdown.cs +++ b/osu.Game/Collections/CollectionDropdown.cs @@ -43,11 +43,13 @@ namespace osu.Game.Collections private IDisposable? realmSubscription; + private readonly CollectionFilterMenuItem allBeatmapsItem = new AllBeatmapsCollectionFilterMenuItem(); + public CollectionDropdown() { ItemSource = filters; - Current.Value = new AllBeatmapsCollectionFilterMenuItem(); + Current.Value = allBeatmapsItem; } protected override void LoadComplete() @@ -61,37 +63,51 @@ namespace osu.Game.Collections private void collectionsChanged(IRealmCollection collections, ChangeSet? changes) { - var selectedItem = SelectedItem?.Value?.Collection; - - var allBeatmaps = new AllBeatmapsCollectionFilterMenuItem(); - - filters.Clear(); - filters.Add(allBeatmaps); - filters.AddRange(collections.Select(c => new CollectionFilterMenuItem(c.ToLive(realm)))); - - if (ShowManageCollectionsItem) - filters.Add(new ManageCollectionsFilterMenuItem()); - - // This current update and schedule is required to work around dropdown headers not updating text even when the selected item - // changes. It's not great but honestly the whole dropdown menu structure isn't great. This needs to be fixed, but I'll issue - // a warning that it's going to be a frustrating journey. - Current.Value = allBeatmaps; - Schedule(() => + if (changes == null) { - // current may have changed before the scheduled call is run. - if (Current.Value != allBeatmaps) - return; - - Current.Value = filters.SingleOrDefault(f => f.Collection != null && f.Collection.ID == selectedItem?.ID) ?? filters[0]; - }); - - // Trigger a re-filter if the current item was in the change set. - if (selectedItem != null && changes != null) + filters.Add(allBeatmapsItem); + filters.AddRange(collections.Select(c => new CollectionFilterMenuItem(c.ToLive(realm)))); + if (ShowManageCollectionsItem) + filters.Add(new ManageCollectionsFilterMenuItem()); + } + else { - foreach (int index in changes.ModifiedIndices) + foreach (int i in changes.DeletedIndices) + filters.RemoveAt(i + 1); + + foreach (int i in changes.InsertedIndices) + filters.Insert(i + 1, new CollectionFilterMenuItem(collections[i].ToLive(realm))); + + var selectedItem = SelectedItem?.Value; + + foreach (int i in changes.NewModifiedIndices) { - if (collections[index].ID == selectedItem.ID) + var updatedItem = collections[i]; + + // This is responsible for updating the state of the +/- button and the collection's name. + // TODO: we can probably make the menu items update with changes to avoid this. + filters.RemoveAt(i + 1); + filters.Insert(i + 1, new CollectionFilterMenuItem(updatedItem.ToLive(realm))); + + if (updatedItem.ID == selectedItem?.Collection?.ID) + { + // This current update and schedule is required to work around dropdown headers not updating text even when the selected item + // changes. It's not great but honestly the whole dropdown menu structure isn't great. This needs to be fixed, but I'll issue + // a warning that it's going to be a frustrating journey. + Current.Value = allBeatmapsItem; + Schedule(() => + { + // current may have changed before the scheduled call is run. + if (Current.Value != allBeatmapsItem) + return; + + Current.Value = filters.SingleOrDefault(f => f.Collection?.ID == selectedItem.Collection?.ID) ?? filters[0]; + }); + + // Trigger an external re-filter if the current item was in the change set. RequestFilter?.Invoke(); + break; + } } } } From ff18f80559acc1a1d6fd6dd709d2cbb0ff98c710 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2023 16:56:11 +0900 Subject: [PATCH 062/567] Apply NRT to `UpdateSettings` --- .../Sections/General/UpdateSettings.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 2f68b3a82f..6dc3cc5f18 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System.Threading.Tasks; using osu.Framework; using osu.Framework.Allocation; @@ -21,17 +19,17 @@ namespace osu.Game.Overlays.Settings.Sections.General { public partial class UpdateSettings : SettingsSubsection { - [Resolved(CanBeNull = true)] - private UpdateManager updateManager { get; set; } - protected override LocalisableString Header => GeneralSettingsStrings.UpdateHeader; - private SettingsButton checkForUpdatesButton; + private SettingsButton checkForUpdatesButton = null!; - [Resolved(CanBeNull = true)] - private INotificationOverlay notifications { get; set; } + [Resolved] + private UpdateManager? updateManager { get; set; } - [BackgroundDependencyLoader(true)] + [Resolved] + private INotificationOverlay? notifications { get; set; } + + [BackgroundDependencyLoader] private void load(Storage storage, OsuConfigManager config, OsuGame game) { Add(new SettingsEnumDropdown @@ -77,7 +75,7 @@ namespace osu.Game.Overlays.Settings.Sections.General Add(new SettingsButton { Text = GeneralSettingsStrings.ChangeFolderLocation, - Action = () => game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) + Action = () => game.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) }); } } From 11f1f4423704a205fa231c55e1f52b9574ee57c4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Nov 2023 17:13:11 +0900 Subject: [PATCH 063/567] Add button to compress log files for bug submission --- .../Sections/General/UpdateSettings.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 6dc3cc5f18..5f74b5ecb9 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -14,6 +14,7 @@ using osu.Game.Localisation; using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Settings.Sections.Maintenance; using osu.Game.Updater; +using SharpCompress.Archives.Zip; namespace osu.Game.Overlays.Settings.Sections.General { @@ -72,6 +73,29 @@ namespace osu.Game.Overlays.Settings.Sections.General Action = () => storage.PresentExternally(), }); + Add(new SettingsButton + { + Text = "Compress log files", + Keywords = new[] { @"bug", "report", "logs" }, + Action = () => + { + var logStorage = storage.GetStorageForDirectory(@"logs"); + + const string archive_filename = "exports/compressed-logs.zip"; + + using (var outStream = storage.CreateFileSafely(archive_filename)) + using (var zip = ZipArchive.Create()) + { + foreach (string? f in logStorage.GetFiles(string.Empty, "*.log")) + zip.AddEntry(f, logStorage.GetStream(f), true); + + zip.SaveTo(outStream); + } + + storage.PresentFileExternally(archive_filename); + }, + }); + Add(new SettingsButton { Text = GeneralSettingsStrings.ChangeFolderLocation, From 4c2819dbc2d5bd88af61a00ebe58d0ce6a1247ea Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2023 17:59:05 +0900 Subject: [PATCH 064/567] Update button text and make localisable --- osu.Game/Localisation/GeneralSettingsStrings.cs | 5 +++++ .../Overlays/Settings/Sections/General/UpdateSettings.cs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game/Localisation/GeneralSettingsStrings.cs b/osu.Game/Localisation/GeneralSettingsStrings.cs index ebf57d8109..42623f4632 100644 --- a/osu.Game/Localisation/GeneralSettingsStrings.cs +++ b/osu.Game/Localisation/GeneralSettingsStrings.cs @@ -49,6 +49,11 @@ namespace osu.Game.Localisation /// public static LocalisableString OpenOsuFolder => new TranslatableString(getKey(@"open_osu_folder"), @"Open osu! folder"); + /// + /// "Export logs" + /// + public static LocalisableString ExportLogs => new TranslatableString(getKey(@"export_logs"), @"Export logs"); + /// /// "Change folder location..." /// diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 5f74b5ecb9..e2c9de1807 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -75,8 +75,8 @@ namespace osu.Game.Overlays.Settings.Sections.General Add(new SettingsButton { - Text = "Compress log files", - Keywords = new[] { @"bug", "report", "logs" }, + Text = GeneralSettingsStrings.ExportLogs, + Keywords = new[] { @"bug", "report", "logs", "files" }, Action = () => { var logStorage = storage.GetStorageForDirectory(@"logs"); From 51de98f34186b799c0e51e6434a1783302df6f57 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Nov 2023 17:59:21 +0900 Subject: [PATCH 065/567] Use `Logger.Storage` rather than locally querying --- osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index e2c9de1807..398e4b39af 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -7,6 +7,7 @@ using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Screens; using osu.Game.Configuration; @@ -79,7 +80,7 @@ namespace osu.Game.Overlays.Settings.Sections.General Keywords = new[] { @"bug", "report", "logs", "files" }, Action = () => { - var logStorage = storage.GetStorageForDirectory(@"logs"); + var logStorage = Logger.Storage; const string archive_filename = "exports/compressed-logs.zip"; From dc588e6d56a8e88eb408d75f7b7d2cb1780e5ef9 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 3 Dec 2023 04:58:17 +0300 Subject: [PATCH 066/567] Implement OsuModDepth --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 163 ++++++++++++++++++++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 3 +- 2 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs new file mode 100644 index 0000000000..9c0e34d0c8 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -0,0 +1,163 @@ +using System; +using System.Linq; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Rulesets.Osu.UI; +using osu.Game.Rulesets.UI; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModDepth : ModWithVisibilityAdjustment, IUpdatableByPlayfield, IApplicableToDrawableRuleset + { + public override string Name => "Depth"; + public override string Acronym => "DH"; + public override IconUsage? Icon => FontAwesome.Solid.Cube; + public override ModType Type => ModType.Fun; + public override LocalisableString Description => "3D. Almost."; + public override double ScoreMultiplier => 1; + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModFreezeFrame), typeof(ModWithVisibilityAdjustment) }).ToArray(); + + private static readonly Vector3 camera_position = new Vector3(OsuPlayfield.BASE_SIZE.X * 0.5f, OsuPlayfield.BASE_SIZE.Y * 0.5f, -100); + + [SettingSource("Maximum Depth", "How far away object appear.", 0)] + public BindableFloat MaxDepth { get; } = new BindableFloat(100) + { + Precision = 10, + MinValue = 50, + MaxValue = 200 + }; + + [SettingSource("Show Approach Circles", "Whether approach circles should be visible.", 1)] + public BindableBool ShowApproachCircles { get; } = new BindableBool(true); + + protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) => applyTransform(hitObject, state); + + protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state) => applyTransform(hitObject, state); + + public void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) + { + // Hide judgment displays and follow points as they won't make any sense. + // Judgements can potentially be turned on in a future where they display at a position relative to their drawable counterpart. + drawableRuleset.Playfield.DisplayJudgements.Value = false; + (drawableRuleset.Playfield as OsuPlayfield)?.FollowPoints.Hide(); + } + + public override void ApplyToDrawableHitObject(DrawableHitObject dho) + { + base.ApplyToDrawableHitObject(dho); + + switch (dho) + { + case DrawableSliderHead: + case DrawableSliderTail: + case DrawableSliderTick: + case DrawableSliderRepeat: + return; + + case DrawableHitCircle: + case DrawableSlider: + dho.Anchor = Anchor.Centre; + break; + } + } + + private void applyTransform(DrawableHitObject drawable, ArmedState state) + { + switch (drawable) + { + case DrawableSliderHead head: + if (!ShowApproachCircles.Value) + { + var hitObject = (OsuHitObject)drawable.HitObject; + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + + using (head.BeginAbsoluteSequence(appearTime)) + head.ApproachCircle.Hide(); + } + + break; + + case DrawableSliderTail: + case DrawableSliderTick: + case DrawableSliderRepeat: + return; + + case DrawableHitCircle circle: + + if (!ShowApproachCircles.Value) + { + var hitObject = (OsuHitObject)drawable.HitObject; + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + + using (circle.BeginAbsoluteSequence(appearTime)) + circle.ApproachCircle.Hide(); + } + + setStartPosition(drawable); + break; + + case DrawableSlider: + setStartPosition(drawable); + break; + } + } + + private void setStartPosition(DrawableHitObject drawable) + { + var hitObject = (OsuHitObject)drawable.HitObject; + + float d = mappedDepth(MaxDepth.Value); + + using (drawable.BeginAbsoluteSequence(hitObject.StartTime - hitObject.TimePreempt)) + { + drawable.MoveTo(positionAtDepth(d, hitObject.Position)); + drawable.ScaleTo(new Vector2(d)); + } + } + + public void Update(Playfield playfield) + { + double time = playfield.Time.Current; + + foreach (var drawable in playfield.HitObjectContainer.AliveObjects) + { + switch (drawable) + { + case DrawableSliderHead: + case DrawableSliderTail: + case DrawableSliderTick: + case DrawableSliderRepeat: + continue; + + case DrawableHitCircle: + case DrawableSlider: + var hitObject = (OsuHitObject)drawable.HitObject; + + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + double moveDuration = hitObject.TimePreempt; + float z = time > appearTime + moveDuration ? 0 : (MaxDepth.Value - (float)((time - appearTime) / moveDuration * MaxDepth.Value)); + + float d = mappedDepth(z); + drawable.Position = positionAtDepth(d, hitObject.Position); + drawable.Scale = new Vector2(d); + break; + } + } + } + + private static float mappedDepth(float depth) => 100 / (depth - camera_position.Z); + + private static Vector2 positionAtDepth(float mappedDepth, Vector2 positionAtZeroDepth) + { + return (positionAtZeroDepth - camera_position.Xy) * mappedDepth; + } + } +} diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index aaf0ab41a0..50e6a5b572 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -211,7 +211,8 @@ namespace osu.Game.Rulesets.Osu new ModAdaptiveSpeed(), new OsuModFreezeFrame(), new OsuModBubbles(), - new OsuModSynesthesia() + new OsuModSynesthesia(), + new OsuModDepth() }; case ModType.System: From cf6e50f73c5f0fabd35141602187981c86842a44 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 3 Dec 2023 05:07:40 +0300 Subject: [PATCH 067/567] Add header and fix typo --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 9c0e34d0c8..b2d52aef42 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -1,3 +1,6 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + using System; using System.Linq; using osu.Framework.Bindables; @@ -27,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Mods private static readonly Vector3 camera_position = new Vector3(OsuPlayfield.BASE_SIZE.X * 0.5f, OsuPlayfield.BASE_SIZE.Y * 0.5f, -100); - [SettingSource("Maximum Depth", "How far away object appear.", 0)] + [SettingSource("Maximum depth", "How far away objects appear.", 0)] public BindableFloat MaxDepth { get; } = new BindableFloat(100) { Precision = 10, From 937689ee6bb4eeee18b007ea153b36e5c8e6a961 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 3 Dec 2023 05:39:44 +0300 Subject: [PATCH 068/567] Add OsuModDepth as incompatable to other mods --- osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModObjectScaleTween.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModSpinIn.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs | 3 ++- osu.Game.Rulesets.Osu/Mods/OsuModTraceable.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs index f1197ce0cd..06cb9c3419 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFreezeFrame.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override LocalisableString Description => "Burn the notes into your memory."; //Alters the transforms of the approach circles, breaking the effects of these mods. - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModApproachDifferent), typeof(OsuModTransform) }).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModApproachDifferent), typeof(OsuModTransform), typeof(OsuModDepth) }).ToArray(); public override ModType Type => ModType.Fun; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs index dd2befef4e..6dc0d5d522 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override LocalisableString Description => @"Play with no approach circles and fading circles/sliders."; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.06 : 1; - public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn) }; + public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn), typeof(OsuModDepth) }; public const double FADE_IN_DURATION_MULTIPLIER = 0.4; public const double FADE_OUT_DURATION_MULTIPLIER = 0.3; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs b/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs index c8c4cd6a14..befee4af5a 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModMagnetised.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override ModType Type => ModType.Fun; public override LocalisableString Description => "No need to chase the circles – your cursor is a magnet!"; public override double ScoreMultiplier => 0.5; - public override Type[] IncompatibleMods => new[] { typeof(OsuModAutopilot), typeof(OsuModWiggle), typeof(OsuModTransform), typeof(ModAutoplay), typeof(OsuModRelax), typeof(OsuModRepel), typeof(OsuModBubbles) }; + public override Type[] IncompatibleMods => new[] { typeof(OsuModAutopilot), typeof(OsuModWiggle), typeof(OsuModTransform), typeof(ModAutoplay), typeof(OsuModRelax), typeof(OsuModRepel), typeof(OsuModBubbles), typeof(OsuModDepth) }; [SettingSource("Attraction strength", "How strong the pull is.", 0)] public BindableFloat AttractionStrength { get; } = new BindableFloat(0.5f) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModObjectScaleTween.cs b/osu.Game.Rulesets.Osu/Mods/OsuModObjectScaleTween.cs index 6f1206382a..1df344648a 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModObjectScaleTween.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModObjectScaleTween.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods protected virtual float EndScale => 1; - public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn), typeof(OsuModObjectScaleTween) }; + public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModSpinIn), typeof(OsuModObjectScaleTween), typeof(OsuModDepth) }; protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs index 28d459cedb..91feb33931 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRepel.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override ModType Type => ModType.Fun; public override LocalisableString Description => "Hit objects run away!"; public override double ScoreMultiplier => 1; - public override Type[] IncompatibleMods => new[] { typeof(OsuModAutopilot), typeof(OsuModWiggle), typeof(OsuModTransform), typeof(ModAutoplay), typeof(OsuModMagnetised), typeof(OsuModBubbles) }; + public override Type[] IncompatibleMods => new[] { typeof(OsuModAutopilot), typeof(OsuModWiggle), typeof(OsuModTransform), typeof(ModAutoplay), typeof(OsuModMagnetised), typeof(OsuModBubbles), typeof(OsuModDepth) }; [SettingSource("Repulsion strength", "How strong the repulsion is.", 0)] public BindableFloat RepulsionStrength { get; } = new BindableFloat(0.5f) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModSpinIn.cs b/osu.Game.Rulesets.Osu/Mods/OsuModSpinIn.cs index b0533d0cfa..59a1342480 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModSpinIn.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModSpinIn.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Mods // todo: this mod needs to be incompatible with "hidden" due to forcing the circle to remain opaque, // further implementation will be required for supporting that. - public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModObjectScaleTween), typeof(OsuModHidden) }; + public override Type[] IncompatibleMods => new[] { typeof(IRequiresApproachCircles), typeof(OsuModObjectScaleTween), typeof(OsuModHidden), typeof(OsuModDepth) }; private const int rotate_offset = 360; private const float rotate_starting_width = 2; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs index 77cf340b95..a5846efdfe 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTargetPractice.cs @@ -47,7 +47,8 @@ namespace osu.Game.Rulesets.Osu.Mods typeof(OsuModRandom), typeof(OsuModSpunOut), typeof(OsuModStrictTracking), - typeof(OsuModSuddenDeath) + typeof(OsuModSuddenDeath), + typeof(OsuModDepth) }).ToArray(); [SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))] diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTraceable.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTraceable.cs index 25d05a88a8..9671f53bea 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModTraceable.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTraceable.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override LocalisableString Description => "Put your faith in the approach circles..."; public override double ScoreMultiplier => 1; - public override Type[] IncompatibleMods => new[] { typeof(IHidesApproachCircles) }; + public override Type[] IncompatibleMods => new[] { typeof(IHidesApproachCircles), typeof(OsuModDepth) }; protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state) { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs index 92a499e735..b6907af119 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override ModType Type => ModType.Fun; public override LocalisableString Description => "Everything rotates. EVERYTHING."; public override double ScoreMultiplier => 1; - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModWiggle), typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModFreezeFrame) }).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModWiggle), typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModFreezeFrame), typeof(OsuModDepth) }).ToArray(); private float theta; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs b/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs index a45338d91f..d14a821541 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override ModType Type => ModType.Fun; public override LocalisableString Description => "They just won't stay still..."; public override double ScoreMultiplier => 1; - public override Type[] IncompatibleMods => new[] { typeof(OsuModTransform), typeof(OsuModMagnetised), typeof(OsuModRepel) }; + public override Type[] IncompatibleMods => new[] { typeof(OsuModTransform), typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModDepth) }; private const int wiggle_duration = 100; // (ms) Higher = fewer wiggles From ebcde63caa4aef0696c977c04bbd5d3e2f2ed5da Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 3 Dec 2023 17:13:47 +0300 Subject: [PATCH 069/567] Don't override hitobjects anchor --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index b2d52aef42..5ae9fc4fac 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -53,25 +53,6 @@ namespace osu.Game.Rulesets.Osu.Mods (drawableRuleset.Playfield as OsuPlayfield)?.FollowPoints.Hide(); } - public override void ApplyToDrawableHitObject(DrawableHitObject dho) - { - base.ApplyToDrawableHitObject(dho); - - switch (dho) - { - case DrawableSliderHead: - case DrawableSliderTail: - case DrawableSliderTick: - case DrawableSliderRepeat: - return; - - case DrawableHitCircle: - case DrawableSlider: - dho.Anchor = Anchor.Centre; - break; - } - } - private void applyTransform(DrawableHitObject drawable, ArmedState state) { switch (drawable) @@ -160,7 +141,7 @@ namespace osu.Game.Rulesets.Osu.Mods private static Vector2 positionAtDepth(float mappedDepth, Vector2 positionAtZeroDepth) { - return (positionAtZeroDepth - camera_position.Xy) * mappedDepth; + return (positionAtZeroDepth - camera_position.Xy) * mappedDepth + camera_position.Xy; } } } From b90000f7b70f2840d6ef683aacb6043f78add0e3 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 3 Dec 2023 17:15:52 +0300 Subject: [PATCH 070/567] Simplify objects depth calculation --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 5ae9fc4fac..f2ea8b9698 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; @@ -126,8 +127,7 @@ namespace osu.Game.Rulesets.Osu.Mods var hitObject = (OsuHitObject)drawable.HitObject; double appearTime = hitObject.StartTime - hitObject.TimePreempt; - double moveDuration = hitObject.TimePreempt; - float z = time > appearTime + moveDuration ? 0 : (MaxDepth.Value - (float)((time - appearTime) / moveDuration * MaxDepth.Value)); + float z = Interpolation.ValueAt(Math.Clamp(time, appearTime, hitObject.StartTime), MaxDepth.Value, 0f, appearTime, hitObject.StartTime); float d = mappedDepth(z); drawable.Position = positionAtDepth(d, hitObject.Position); From 595bc9398a37596ad98760f0e32448b33741b9bd Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 20:14:00 +0100 Subject: [PATCH 071/567] update to new builder control point signature --- .../Sliders/SliderPlacementBlueprint.cs | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index ac7b5e63e1..584c8fabbf 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -309,12 +309,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders private void updateSliderPathFromBSplineBuilder() { - IReadOnlyList builderPoints = bSplineBuilder.ControlPoints; + IReadOnlyList> builderPoints = bSplineBuilder.ControlPoints; if (builderPoints.Count == 0) return; - int lastSegmentStart = 0; PathType? lastPathType = null; HitObject.Path.ControlPoints.Clear(); @@ -323,31 +322,25 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders // Importantly, the B-Spline builder returns three Vector2s at the same location when a new segment is to be started. for (int i = 0; i < builderPoints.Count; i++) { - bool isLastPoint = i == builderPoints.Count - 1; - bool isNewSegment = i < builderPoints.Count - 2 && builderPoints[i] == builderPoints[i + 1] && builderPoints[i] == builderPoints[i + 2]; + bool isLastSegment = i == builderPoints.Count - 1; + var segment = builderPoints[i]; + int pointsInSegment = segment.Count; - if (isNewSegment || isLastPoint) - { - int pointsInSegment = i - lastSegmentStart; + // Where possible, we can use the simpler LINEAR path type. + PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3); - // Where possible, we can use the simpler LINEAR path type. - PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3); + // Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined. + if (lastPathType == pathType && lastPathType == PathType.LINEAR) + pathType = null; - // Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined. - if (lastPathType == pathType && lastPathType == PathType.LINEAR) - pathType = null; + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], pathType)); + for (int j = 1; j < pointsInSegment - 1; j++) + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); - HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[lastSegmentStart], pathType)); - for (int j = lastSegmentStart + 1; j < i; j++) - HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[j])); + if (isLastSegment) + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[pointsInSegment - 1])); - if (isLastPoint) - HitObject.Path.ControlPoints.Add(new PathControlPoint(builderPoints[i])); - - // Skip the redundant duplicated points (see isNewSegment above) which have been coalesced into a path type. - lastSegmentStart = (i += 2); - if (pathType != null) lastPathType = pathType; - } + if (pathType != null) lastPathType = pathType; } } From 4cd6efc8f750e8dddc65f23f22e94d1be38fa3bc Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 20:53:05 +0100 Subject: [PATCH 072/567] update default parameters --- osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs index 1974415d30..87dd8636c9 100644 --- a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs +++ b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Edit { } - public BindableFloat Tolerance { get; } = new BindableFloat(1.5f) + public BindableFloat Tolerance { get; } = new BindableFloat(2f) { MinValue = 0.05f, MaxValue = 3f, @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Edit }; // We map internal ranges to a more standard range of values for display to the user. - private readonly BindableInt displayTolerance = new BindableInt(40) + private readonly BindableInt displayTolerance = new BindableInt(66) { MinValue = 5, MaxValue = 100 From 8873824107a2e29eb914536aec11addddb421857 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 20:53:25 +0100 Subject: [PATCH 073/567] fix control points being cleared --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 584c8fabbf..bc32acda96 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -311,7 +311,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { IReadOnlyList> builderPoints = bSplineBuilder.ControlPoints; - if (builderPoints.Count == 0) + if (builderPoints.Count == 0 || builderPoints[0].Count == 0) return; PathType? lastPathType = null; @@ -326,6 +326,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders var segment = builderPoints[i]; int pointsInSegment = segment.Count; + if (segment.Count == 0) + continue; + // Where possible, we can use the simpler LINEAR path type. PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3); From ba2cc0243c03e014bb360aca82ad61f17df828f6 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 21:10:01 +0100 Subject: [PATCH 074/567] update comment --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index bc32acda96..14de35965e 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -318,8 +318,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders HitObject.Path.ControlPoints.Clear(); - // Iterate through generated points, finding each segment and adding non-inheriting path types where appropriate. - // Importantly, the B-Spline builder returns three Vector2s at the same location when a new segment is to be started. + // Iterate through generated segments and adding non-inheriting path types where appropriate. for (int i = 0; i < builderPoints.Count; i++) { bool isLastSegment = i == builderPoints.Count - 1; From 34b5264616aa784439153110eb2b93d542c1968f Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 21:13:27 +0100 Subject: [PATCH 075/567] fix the linear segment --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 14de35965e..f98eadb817 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -329,7 +329,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders continue; // Where possible, we can use the simpler LINEAR path type. - PathType? pathType = pointsInSegment == 1 ? PathType.LINEAR : PathType.BSpline(3); + PathType? pathType = pointsInSegment == 2 ? PathType.LINEAR : PathType.BSpline(3); // Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined. if (lastPathType == pathType && lastPathType == PathType.LINEAR) From bcf2effae9b9f4ee80e652940834533d96d0c044 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 21:22:04 +0100 Subject: [PATCH 076/567] Remove the Linear segment simplification because it just makes things harder to edit afterwards if it made some segment linear type when you actually intended there to be some curve --- .../Blueprints/Sliders/SliderPlacementBlueprint.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index f98eadb817..5f1066d92d 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -314,8 +314,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders if (builderPoints.Count == 0 || builderPoints[0].Count == 0) return; - PathType? lastPathType = null; - HitObject.Path.ControlPoints.Clear(); // Iterate through generated segments and adding non-inheriting path types where appropriate. @@ -328,21 +326,12 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders if (segment.Count == 0) continue; - // Where possible, we can use the simpler LINEAR path type. - PathType? pathType = pointsInSegment == 2 ? PathType.LINEAR : PathType.BSpline(3); - - // Linear segments can be combined, as two adjacent linear sections are computationally the same as one with the points combined. - if (lastPathType == pathType && lastPathType == PathType.LINEAR) - pathType = null; - - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], pathType)); + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(3))); for (int j = 1; j < pointsInSegment - 1; j++) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); if (isLastSegment) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[pointsInSegment - 1])); - - if (pathType != null) lastPathType = pathType; } } From ca55a7b2bfb913f0de9d733a4213650484ad3296 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 21:43:37 +0100 Subject: [PATCH 077/567] call builder finish before ending curve --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 5f1066d92d..4413fc4bf4 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -197,7 +197,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders base.OnDragEnd(e); if (state == SliderPlacementState.Drawing) + { + bSplineBuilder.Finish(); + updateSliderPathFromBSplineBuilder(); endCurve(); + } } protected override void OnMouseUp(MouseUpEvent e) From b3d1a9ee2e0665e4a9adc5088db33823615e9f23 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 22:03:51 +0100 Subject: [PATCH 078/567] Dont snap expected distance while drawing This makes it 10 billion times smoother to draw, very nice --- .../Blueprints/Sliders/SliderPlacementBlueprint.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 4413fc4bf4..c40f90bfa3 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -200,6 +200,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { bSplineBuilder.Finish(); updateSliderPathFromBSplineBuilder(); + + // Change the state so it will snap the expected distance in endCurve. + state = SliderPlacementState.Finishing; endCurve(); } } @@ -304,7 +307,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders private void updateSlider() { - HitObject.Path.ExpectedDistance.Value = distanceSnapProvider?.FindSnappedDistance(HitObject, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance; + if (state == SliderPlacementState.Drawing) + HitObject.Path.ExpectedDistance.Value = (float)HitObject.Path.CalculatedDistance; + else + HitObject.Path.ExpectedDistance.Value = distanceSnapProvider?.FindSnappedDistance(HitObject, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance; bodyPiece.UpdateFrom(HitObject); headCirclePiece.UpdateFrom(HitObject.HeadCircle); @@ -343,7 +349,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { Initial, ControlPoints, - Drawing + Drawing, + Finishing } } } From 060141866c4d9e60f8a0d1172318d89fdb821206 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 22:06:07 +0100 Subject: [PATCH 079/567] Update SliderPlacementBlueprint.cs --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index c40f90bfa3..e13a46d0cd 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -331,17 +331,16 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { bool isLastSegment = i == builderPoints.Count - 1; var segment = builderPoints[i]; - int pointsInSegment = segment.Count; if (segment.Count == 0) continue; HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(3))); - for (int j = 1; j < pointsInSegment - 1; j++) + for (int j = 1; j < segment.Count - 1; j++) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); if (isLastSegment) - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[pointsInSegment - 1])); + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[^1])); } } From 13b7f2fa42e68fe72ec0835260b6b84411d3dbbc Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sun, 3 Dec 2023 22:42:48 +0100 Subject: [PATCH 080/567] Fix test cases --- .../Editor/TestSceneSliderPlacementBlueprint.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs index 7ac34bc6c8..f889999fe3 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs @@ -310,7 +310,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor AddStep("release left button", () => InputManager.ReleaseButton(MouseButton.Left)); assertPlaced(true); - assertLength(760, tolerance: 10); + assertLength(808, tolerance: 10); assertControlPointCount(5); assertControlPointType(0, PathType.BSpline(3)); assertControlPointType(1, null); @@ -337,9 +337,9 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertPlaced(true); assertLength(600, tolerance: 10); assertControlPointCount(4); - assertControlPointType(0, PathType.LINEAR); - assertControlPointType(1, null); - assertControlPointType(2, null); + assertControlPointType(0, PathType.BSpline(3)); + assertControlPointType(1, PathType.BSpline(3)); + assertControlPointType(2, PathType.BSpline(3)); assertControlPointType(3, null); } From b56a78c6ecaa9f47e0a8de9b8c4d567975b3c500 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 4 Dec 2023 08:51:21 +0900 Subject: [PATCH 081/567] Adjust with framework changes --- osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs | 2 +- osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs | 2 +- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 2 +- osu.Game/Graphics/Backgrounds/Triangles.cs | 2 +- osu.Game/Graphics/Backgrounds/TrianglesV2.cs | 2 +- osu.Game/Graphics/UserInterface/BarGraph.cs | 2 +- osu.Game/Graphics/UserInterface/SegmentedGraph.cs | 2 +- osu.Game/Rulesets/Mods/ModFlashlight.cs | 2 +- osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs index b719138d33..88769442a1 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs @@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon relativeGlowSize = Source.glowSize / Source.DrawSize.X; } - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); drawGlow(renderer); diff --git a/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs index d818c8baee..9838cb2c37 100644 --- a/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs +++ b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs @@ -231,7 +231,7 @@ namespace osu.Game.Rulesets.Osu.Skinning points.AddRange(Source.SmokePoints.Skip(firstVisiblePointIndex).Take(futurePointIndex - firstVisiblePointIndex)); } - public sealed override void Draw(IRenderer renderer) + protected sealed override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index a29faac5a0..95a052dadb 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -258,7 +258,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor private IUniformBuffer cursorTrailParameters; - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 0ee42c69d5..1a78c1ec5e 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -286,7 +286,7 @@ namespace osu.Game.Graphics.Backgrounds private IUniformBuffer borderDataBuffer; - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Graphics/Backgrounds/TrianglesV2.cs b/osu.Game/Graphics/Backgrounds/TrianglesV2.cs index 750e96440d..a20fd78569 100644 --- a/osu.Game/Graphics/Backgrounds/TrianglesV2.cs +++ b/osu.Game/Graphics/Backgrounds/TrianglesV2.cs @@ -228,7 +228,7 @@ namespace osu.Game.Graphics.Backgrounds private IUniformBuffer? borderDataBuffer; - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Graphics/UserInterface/BarGraph.cs b/osu.Game/Graphics/UserInterface/BarGraph.cs index 0ac987e85b..e7592128b0 100644 --- a/osu.Game/Graphics/UserInterface/BarGraph.cs +++ b/osu.Game/Graphics/UserInterface/BarGraph.cs @@ -134,7 +134,7 @@ namespace osu.Game.Graphics.UserInterface lengths.AddRange(Source.bars.InstantaneousLengths); } - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Graphics/UserInterface/SegmentedGraph.cs b/osu.Game/Graphics/UserInterface/SegmentedGraph.cs index 91971e5af9..9f467687a4 100644 --- a/osu.Game/Graphics/UserInterface/SegmentedGraph.cs +++ b/osu.Game/Graphics/UserInterface/SegmentedGraph.cs @@ -221,7 +221,7 @@ namespace osu.Game.Graphics.UserInterface tierColours.AddRange(Source.tierColours); } - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index 215fc877dc..95406cc9e6 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -252,7 +252,7 @@ namespace osu.Game.Rulesets.Mods private IUniformBuffer? flashlightParametersBuffer; - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index fa26cfab46..b722b83280 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -189,7 +189,7 @@ namespace osu.Game.Screens.Menu Source.frequencyAmplitudes.AsSpan().CopyTo(audioData); } - public override void Draw(IRenderer renderer) + protected override void Draw(IRenderer renderer) { base.Draw(renderer); From ec5c7d7830dfac2f37a8e3d6cbc14967c8473f21 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Mon, 4 Dec 2023 09:43:09 +0300 Subject: [PATCH 082/567] Add deceleration and rework depth handling --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 105 ++++++++++------------ 1 file changed, 49 insertions(+), 56 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index f2ea8b9698..5054c75e97 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -4,7 +4,6 @@ using System; using System.Linq; using osu.Framework.Bindables; -using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Framework.Utils; @@ -30,6 +29,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModFreezeFrame), typeof(ModWithVisibilityAdjustment) }).ToArray(); private static readonly Vector3 camera_position = new Vector3(OsuPlayfield.BASE_SIZE.X * 0.5f, OsuPlayfield.BASE_SIZE.Y * 0.5f, -100); + private readonly float minDepth = depthForScale(1.5f); [SettingSource("Maximum depth", "How far away objects appear.", 0)] public BindableFloat MaxDepth { get; } = new BindableFloat(100) @@ -58,25 +58,7 @@ namespace osu.Game.Rulesets.Osu.Mods { switch (drawable) { - case DrawableSliderHead head: - if (!ShowApproachCircles.Value) - { - var hitObject = (OsuHitObject)drawable.HitObject; - double appearTime = hitObject.StartTime - hitObject.TimePreempt; - - using (head.BeginAbsoluteSequence(appearTime)) - head.ApproachCircle.Hide(); - } - - break; - - case DrawableSliderTail: - case DrawableSliderTick: - case DrawableSliderRepeat: - return; - case DrawableHitCircle circle: - if (!ShowApproachCircles.Value) { var hitObject = (OsuHitObject)drawable.HitObject; @@ -86,25 +68,7 @@ namespace osu.Game.Rulesets.Osu.Mods circle.ApproachCircle.Hide(); } - setStartPosition(drawable); break; - - case DrawableSlider: - setStartPosition(drawable); - break; - } - } - - private void setStartPosition(DrawableHitObject drawable) - { - var hitObject = (OsuHitObject)drawable.HitObject; - - float d = mappedDepth(MaxDepth.Value); - - using (drawable.BeginAbsoluteSequence(hitObject.StartTime - hitObject.TimePreempt)) - { - drawable.MoveTo(positionAtDepth(d, hitObject.Position)); - drawable.ScaleTo(new Vector2(d)); } } @@ -114,34 +78,63 @@ namespace osu.Game.Rulesets.Osu.Mods foreach (var drawable in playfield.HitObjectContainer.AliveObjects) { - switch (drawable) - { - case DrawableSliderHead: - case DrawableSliderTail: - case DrawableSliderTick: - case DrawableSliderRepeat: - continue; + if (drawable is not DrawableOsuHitObject d) + continue; + switch (d) + { case DrawableHitCircle: case DrawableSlider: - var hitObject = (OsuHitObject)drawable.HitObject; - - double appearTime = hitObject.StartTime - hitObject.TimePreempt; - float z = Interpolation.ValueAt(Math.Clamp(time, appearTime, hitObject.StartTime), MaxDepth.Value, 0f, appearTime, hitObject.StartTime); - - float d = mappedDepth(z); - drawable.Position = positionAtDepth(d, hitObject.Position); - drawable.Scale = new Vector2(d); + processObject(time, d); break; } } } - private static float mappedDepth(float depth) => 100 / (depth - camera_position.Z); - - private static Vector2 positionAtDepth(float mappedDepth, Vector2 positionAtZeroDepth) + private void processObject(double time, DrawableOsuHitObject drawable) { - return (positionAtZeroDepth - camera_position.Xy) * mappedDepth + camera_position.Xy; + var hitObject = drawable.HitObject; + + double baseSpeed = MaxDepth.Value / hitObject.TimePreempt; + double hitObjectDuration = hitObject is Slider s ? s.Duration : 0.0; + double offsetAfterStartTime = hitObjectDuration + hitObject.MaximumJudgementOffset + 500; + double slowSpeed = -minDepth / offsetAfterStartTime; + + float decelerationDistance = MaxDepth.Value * 0.2f; + double decelerationTime = (slowSpeed - baseSpeed) * 2 * decelerationDistance / (slowSpeed * slowSpeed - baseSpeed * baseSpeed); + + float z; + + if (time < hitObject.StartTime - decelerationTime) + { + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + float fullDistance = decelerationDistance + (float)(baseSpeed * (hitObject.TimePreempt - decelerationTime)); + z = Interpolation.ValueAt(Math.Max(time, appearTime), fullDistance, decelerationDistance, appearTime, hitObject.StartTime - decelerationTime); + } + else if (time < hitObject.StartTime) + { + double timeOffset = time - (hitObject.StartTime - decelerationTime); + double deceleration = (slowSpeed - baseSpeed) / decelerationTime; + z = decelerationDistance - (float)(baseSpeed * timeOffset + deceleration * timeOffset * timeOffset * 0.5); + } + else + { + double endTime = hitObject.StartTime + offsetAfterStartTime; + z = Interpolation.ValueAt(Math.Min(time, endTime), 0f, minDepth, hitObject.StartTime, endTime); + } + + float scale = scaleForDepth(z); + drawable.Position = positionAtDepth(scale, hitObject.Position); + drawable.Scale = new Vector2(scale); + } + + private static float scaleForDepth(float depth) => 100 / (depth - camera_position.Z); + + private static float depthForScale(float scale) => 100 / scale + camera_position.Z; + + private static Vector2 positionAtDepth(float scale, Vector2 positionAtZeroDepth) + { + return (positionAtZeroDepth - camera_position.Xy) * scale + camera_position.Xy; } } } From bb198e0c5a96120ac3ac3139879ccc47265eac72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 4 Dec 2023 09:26:23 +0100 Subject: [PATCH 083/567] Add test coverage for missing hyperdashes on simultaneous notes --- .../TestSceneHyperDash.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs index 3c222662f5..445fa42b36 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneHyperDash.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Catch.Tests AddAssert("First note is hyperdash", () => Beatmap.Value.Beatmap.HitObjects[0] is Fruit f && f.HyperDash); - for (int i = 0; i < 9; i++) + for (int i = 0; i < 11; i++) { int count = i + 1; AddUntilStep($"wait for hyperdash #{count}", () => hyperDashCount >= count); @@ -100,12 +100,22 @@ namespace osu.Game.Rulesets.Catch.Tests }) }, 1); + createObjects(() => new Fruit { X = right_x }, count: 2, spacing: 0, spacingAfterGroup: 400); + createObjects(() => new TestJuiceStream(left_x) + { + Path = new SliderPath(new[] + { + new PathControlPoint(Vector2.Zero), + new PathControlPoint(new Vector2(0, 300)) + }) + }, count: 1, spacingAfterGroup: 150); + createObjects(() => new Fruit { X = left_x }, count: 1, spacing: 0, spacingAfterGroup: 400); + createObjects(() => new Fruit { X = right_x }, count: 2, spacing: 0); + return beatmap; - void createObjects(Func createObject, int count = 3) + void createObjects(Func createObject, int count = 3, float spacing = 140, float spacingAfterGroup = 700) { - const float spacing = 140; - for (int i = 0; i < count; i++) { var hitObject = createObject(); @@ -113,7 +123,7 @@ namespace osu.Game.Rulesets.Catch.Tests beatmap.HitObjects.Add(hitObject); } - startTime += 700; + startTime += spacingAfterGroup; } } From fcb6f40666bc351c8bd8122314978ce33ac2993e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 4 Dec 2023 09:30:18 +0100 Subject: [PATCH 084/567] Prioritise hyperfruit over non-hyperfruit if simultaneous In case of simultaneous hyperfruit and non-hyperfruit - which happen to occur on some aspire maps - the desired behaviour is to hyperdash. This did not previously occur, due to annoying details in how `HitObjectContainer` is structured. `HitObjectContainer`'s drawable comparer determines the order of updating the objects. One could say that forcing the hyperfruit to be updated last, after normal fruit, could help; unfortunately this is complicated by the existence of juice streams and the fact that while a juice stream can be terminated by a normal fruit that is coincidental with a hyperfruit, the two are not comparable directly using the comparer in any feasible way. Therefore, apply a `Catcher`-level workaround that intends to handle this locally; in short, if a hyperdash was toggled in a given frame, it cannot be toggled off again in the same frame. This yields the desired behaviour. --- osu.Game.Rulesets.Catch/UI/Catcher.cs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 0c2c157d10..147850a9b7 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -126,6 +126,7 @@ namespace osu.Game.Rulesets.Catch.UI private Color4 hyperDashColour = DEFAULT_HYPER_DASH_COLOUR; + private double? lastHyperDashStartTime; private double hyperDashModifier = 1; private int hyperDashDirection; private float hyperDashTargetPosition; @@ -233,16 +234,23 @@ namespace osu.Game.Rulesets.Catch.UI // droplet doesn't affect the catcher state if (hitObject is TinyDroplet) return; - if (result.IsHit && hitObject.HyperDashTarget is CatchHitObject target) + // if a hyper fruit was already handled this frame, just go where it says to go. + // this special-cases some aspire maps that have doubled-up objects (one hyper, one not) at the same time instant. + // handling this "properly" elsewhere is impossible as there is no feasible way to ensure + // that the hyperfruit gets judged second (especially if it coincides with a last fruit in a juice stream). + if (lastHyperDashStartTime != Time.Current) { - double timeDifference = target.StartTime - hitObject.StartTime; - double positionDifference = target.EffectiveX - X; - double velocity = positionDifference / Math.Max(1.0, timeDifference - 1000.0 / 60.0); + if (result.IsHit && hitObject.HyperDashTarget is CatchHitObject target) + { + double timeDifference = target.StartTime - hitObject.StartTime; + double positionDifference = target.EffectiveX - X; + double velocity = positionDifference / Math.Max(1.0, timeDifference - 1000.0 / 60.0); - SetHyperDashState(Math.Abs(velocity) / BASE_DASH_SPEED, target.EffectiveX); + SetHyperDashState(Math.Abs(velocity) / BASE_DASH_SPEED, target.EffectiveX); + } + else + SetHyperDashState(); } - else - SetHyperDashState(); if (result.IsHit) CurrentState = hitObject.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle; @@ -292,6 +300,8 @@ namespace osu.Game.Rulesets.Catch.UI if (wasHyperDashing) runHyperDashStateTransition(false); + + lastHyperDashStartTime = null; } else { @@ -301,6 +311,8 @@ namespace osu.Game.Rulesets.Catch.UI if (!wasHyperDashing) runHyperDashStateTransition(true); + + lastHyperDashStartTime = Time.Current; } } From 629e64d50aa712d226480fe6c91c3ad933bb6a04 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 4 Dec 2023 23:55:31 +0300 Subject: [PATCH 085/567] Fix `ArgonHealthDisplay` not displaying miss correctly during initial transition --- osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs | 7 +++++++ osu.Game/Screens/Play/HUD/HealthDisplay.cs | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index 2bef6c312f..de591cdb31 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -204,6 +204,13 @@ namespace osu.Game.Screens.Play.HUD glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, GlowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); } + protected override void FinishInitialAnimation(double value) + { + base.FinishInitialAnimation(value); + this.TransformTo(nameof(HealthBarValue), value, 500, Easing.OutQuint); + this.TransformTo(nameof(GlowBarValue), value, 250, Easing.OutQuint); + } + protected override void Flash() { base.Flash(); diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index 13dc05229e..7747036826 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -58,7 +58,9 @@ namespace osu.Game.Screens.Play.HUD health = HealthProcessor.Health.GetBoundCopy(); health.BindValueChanged(h => { - finishInitialAnimation(); + if (initialIncrease != null) + FinishInitialAnimation(h.OldValue); + Current.Value = h.NewValue; }); @@ -90,16 +92,16 @@ namespace osu.Game.Screens.Play.HUD Scheduler.AddOnce(Flash); if (newValue >= health.Value) - finishInitialAnimation(); + FinishInitialAnimation(health.Value); }, increase_delay, true); } - private void finishInitialAnimation() + protected virtual void FinishInitialAnimation(double value) { if (initialIncrease == null) return; - initialIncrease?.Cancel(); + initialIncrease.Cancel(); initialIncrease = null; // aside from the repeating `initialIncrease` scheduled task, From 68907fe1ba93fec9b513c1c6e6072567e7913bb5 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 5 Dec 2023 02:48:11 +0300 Subject: [PATCH 086/567] Cleanup pass --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 34 +++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 5054c75e97..18d4fef5e8 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; -using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; @@ -78,30 +77,29 @@ namespace osu.Game.Rulesets.Osu.Mods foreach (var drawable in playfield.HitObjectContainer.AliveObjects) { - if (drawable is not DrawableOsuHitObject d) - continue; - - switch (d) + switch (drawable) { - case DrawableHitCircle: - case DrawableSlider: - processObject(time, d); + case DrawableHitCircle circle: + processObject(time, circle, 0); + break; + + case DrawableSlider slider: + processObject(time, slider, slider.HitObject.Duration); break; } } } - private void processObject(double time, DrawableOsuHitObject drawable) + private void processObject(double time, DrawableOsuHitObject drawable, double duration) { var hitObject = drawable.HitObject; double baseSpeed = MaxDepth.Value / hitObject.TimePreempt; - double hitObjectDuration = hitObject is Slider s ? s.Duration : 0.0; - double offsetAfterStartTime = hitObjectDuration + hitObject.MaximumJudgementOffset + 500; - double slowSpeed = -minDepth / offsetAfterStartTime; + double offsetAfterStartTime = duration + hitObject.MaximumJudgementOffset + 500; + double slowSpeed = Math.Min(-minDepth / offsetAfterStartTime, baseSpeed); - float decelerationDistance = MaxDepth.Value * 0.2f; - double decelerationTime = (slowSpeed - baseSpeed) * 2 * decelerationDistance / (slowSpeed * slowSpeed - baseSpeed * baseSpeed); + double decelerationTime = hitObject.TimePreempt * 0.2; + float decelerationDistance = (float)(decelerationTime * (baseSpeed + slowSpeed) * 0.5); float z; @@ -109,7 +107,7 @@ namespace osu.Game.Rulesets.Osu.Mods { double appearTime = hitObject.StartTime - hitObject.TimePreempt; float fullDistance = decelerationDistance + (float)(baseSpeed * (hitObject.TimePreempt - decelerationTime)); - z = Interpolation.ValueAt(Math.Max(time, appearTime), fullDistance, decelerationDistance, appearTime, hitObject.StartTime - decelerationTime); + z = fullDistance - (float)((Math.Max(time, appearTime) - appearTime) * baseSpeed); } else if (time < hitObject.StartTime) { @@ -120,11 +118,11 @@ namespace osu.Game.Rulesets.Osu.Mods else { double endTime = hitObject.StartTime + offsetAfterStartTime; - z = Interpolation.ValueAt(Math.Min(time, endTime), 0f, minDepth, hitObject.StartTime, endTime); + z = -(float)((Math.Min(time, endTime) - hitObject.StartTime) * slowSpeed); } float scale = scaleForDepth(z); - drawable.Position = positionAtDepth(scale, hitObject.Position); + drawable.Position = toPlayfieldPosition(scale, hitObject.Position); drawable.Scale = new Vector2(scale); } @@ -132,7 +130,7 @@ namespace osu.Game.Rulesets.Osu.Mods private static float depthForScale(float scale) => 100 / scale + camera_position.Z; - private static Vector2 positionAtDepth(float scale, Vector2 positionAtZeroDepth) + private static Vector2 toPlayfieldPosition(float scale, Vector2 positionAtZeroDepth) { return (positionAtZeroDepth - camera_position.Xy) * scale + camera_position.Xy; } From 594ea4da5f5324bb4cce86b071acff13a9a1cb1d Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 5 Dec 2023 16:00:20 +0300 Subject: [PATCH 087/567] Apply suggested behaviour --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 18d4fef5e8..16517a2f36 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -103,13 +103,7 @@ namespace osu.Game.Rulesets.Osu.Mods float z; - if (time < hitObject.StartTime - decelerationTime) - { - double appearTime = hitObject.StartTime - hitObject.TimePreempt; - float fullDistance = decelerationDistance + (float)(baseSpeed * (hitObject.TimePreempt - decelerationTime)); - z = fullDistance - (float)((Math.Max(time, appearTime) - appearTime) * baseSpeed); - } - else if (time < hitObject.StartTime) + if (time < hitObject.StartTime) { double timeOffset = time - (hitObject.StartTime - decelerationTime); double deceleration = (slowSpeed - baseSpeed) / decelerationTime; From a0813d18cab2cb5485d5a0f792819d8018ef1189 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:47:08 +0300 Subject: [PATCH 088/567] `CalculatedTextSize` -> `FontSize` --- osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/ShearedSearchTextBox.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 123854a2dd..0be7b4dc48 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -23,7 +23,7 @@ namespace osu.Game.Graphics.UserInterface protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer { AutoSizeAxes = Axes.Both, - Child = new PasswordMaskChar(CalculatedTextSize), + Child = new PasswordMaskChar(FontSize), }; protected override bool AllowUniqueCharacterSamples => false; diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 04ecfa7e9a..4742da6d0b 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -268,7 +268,7 @@ namespace osu.Game.Graphics.UserInterface protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer { AutoSizeAxes = Axes.Both, - Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) }, + Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: FontSize) }, }; protected override Caret CreateCaret() => caret = new OsuCaret diff --git a/osu.Game/Graphics/UserInterface/ShearedSearchTextBox.cs b/osu.Game/Graphics/UserInterface/ShearedSearchTextBox.cs index 3940bf8bca..131041e706 100644 --- a/osu.Game/Graphics/UserInterface/ShearedSearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/ShearedSearchTextBox.cs @@ -110,7 +110,7 @@ namespace osu.Game.Graphics.UserInterface BackgroundFocused = colourProvider.Background4; BackgroundUnfocused = colourProvider.Background4; - Placeholder.Font = OsuFont.GetFont(size: CalculatedTextSize, weight: FontWeight.SemiBold); + Placeholder.Font = OsuFont.GetFont(size: FontSize, weight: FontWeight.SemiBold); PlaceholderText = CommonStrings.InputSearch; CornerRadius = corner_radius; From b8b82f890172cd2a6dd70e57ad6ecf591dca073c Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:45:46 +0300 Subject: [PATCH 089/567] Handle back action in `OsuDropdown` rather than menu --- .../Graphics/UserInterface/OsuDropdown.cs | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index b530172f3e..7a052c2298 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -22,7 +22,7 @@ using osuTK.Graphics; namespace osu.Game.Graphics.UserInterface { - public partial class OsuDropdown : Dropdown + public partial class OsuDropdown : Dropdown, IKeyBindingHandler { private const float corner_radius = 5; @@ -30,9 +30,23 @@ namespace osu.Game.Graphics.UserInterface protected override DropdownMenu CreateMenu() => new OsuDropdownMenu(); + public bool OnPressed(KeyBindingPressEvent e) + { + if (e.Repeat) return false; + + if (e.Action == GlobalAction.Back) + return Back(); + + return false; + } + + public void OnReleased(KeyBindingReleaseEvent e) + { + } + #region OsuDropdownMenu - protected partial class OsuDropdownMenu : DropdownMenu, IKeyBindingHandler + protected partial class OsuDropdownMenu : DropdownMenu { public override bool HandleNonPositionalInput => State == MenuState.Open; @@ -276,23 +290,6 @@ namespace osu.Game.Graphics.UserInterface } #endregion - - public bool OnPressed(KeyBindingPressEvent e) - { - if (e.Repeat) return false; - - if (e.Action == GlobalAction.Back) - { - State = MenuState.Closed; - return true; - } - - return false; - } - - public void OnReleased(KeyBindingReleaseEvent e) - { - } } #endregion From a67df766543cb2e967695675434885edd0431d7c Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:50:05 +0300 Subject: [PATCH 090/567] Add test coverage --- .../UserInterface/TestSceneOsuDropdown.cs | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuDropdown.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuDropdown.cs index b0548d7e9f..1678890b73 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuDropdown.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuDropdown.cs @@ -1,9 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Linq; +using NUnit.Framework; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input.Events; +using osu.Framework.Input.States; +using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; +using osu.Game.Input.Bindings; namespace osu.Game.Tests.Visual.UserInterface { @@ -13,8 +21,29 @@ namespace osu.Game.Tests.Visual.UserInterface new OsuEnumDropdown { Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Origin = Anchor.TopCentre, Width = 150 }; + + [Test] + // todo: this can be written much better if ThemeComparisonTestScene has a manual input manager + public void TestBackAction() + { + AddStep("open", () => dropdown().ChildrenOfType().Single().Open()); + AddStep("press back", () => dropdown().OnPressed(new KeyBindingPressEvent(new InputState(), GlobalAction.Back))); + AddAssert("closed", () => dropdown().ChildrenOfType().Single().State == MenuState.Closed); + + AddStep("open", () => dropdown().ChildrenOfType().Single().Open()); + AddStep("type something", () => dropdown().ChildrenOfType().Single().SearchTerm.Value = "something"); + AddAssert("search bar visible", () => dropdown().ChildrenOfType().Single().State.Value == Visibility.Visible); + AddStep("press back", () => dropdown().OnPressed(new KeyBindingPressEvent(new InputState(), GlobalAction.Back))); + AddAssert("text clear", () => dropdown().ChildrenOfType().Single().SearchTerm.Value == string.Empty); + AddAssert("search bar hidden", () => dropdown().ChildrenOfType().Single().State.Value == Visibility.Hidden); + AddAssert("still open", () => dropdown().ChildrenOfType().Single().State == MenuState.Open); + AddStep("press back", () => dropdown().OnPressed(new KeyBindingPressEvent(new InputState(), GlobalAction.Back))); + AddAssert("closed", () => dropdown().ChildrenOfType().Single().State == MenuState.Closed); + + OsuEnumDropdown dropdown() => this.ChildrenOfType>().First(); + } } } From d92db8059e1b8804af4a88d9450cd837a0e97d6d Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:49:43 +0300 Subject: [PATCH 091/567] Add new dropdown properties to `SettingsDropdown` --- osu.Game/Overlays/Settings/SettingsDropdown.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index 5798d02e03..ec69224bb6 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -16,6 +16,18 @@ namespace osu.Game.Overlays.Settings { protected new OsuDropdown Control => (OsuDropdown)base.Control; + public bool AlwaysShowSearchBar + { + get => Control.AlwaysShowSearchBar; + set => Control.AlwaysShowSearchBar = value; + } + + public bool AllowNonContiguousMatching + { + get => Control.AllowNonContiguousMatching; + set => Control.AllowNonContiguousMatching = value; + } + public IEnumerable Items { get => Control.Items; From ee2e176082834d34350d2c9183d825b5468d7333 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:52:48 +0300 Subject: [PATCH 092/567] Add osu! dropdown search bar implementation --- .../Graphics/UserInterface/OsuDropdown.cs | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 7a052c2298..96604275ea 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -352,11 +352,82 @@ namespace osu.Game.Graphics.UserInterface AddInternal(new HoverClickSounds()); } - [BackgroundDependencyLoader(true)] - private void load(OverlayColourProvider? colourProvider, OsuColour colours) + [Resolved] + private OverlayColourProvider? colourProvider { get; set; } + + [Resolved] + private OsuColour colours { get; set; } = null!; + + protected override void LoadComplete() { - BackgroundColour = colourProvider?.Background5 ?? Color4.Black.Opacity(0.5f); - BackgroundColourHover = colourProvider?.Light4 ?? colours.PinkDarker; + base.LoadComplete(); + + SearchBar.State.ValueChanged += _ => updateColour(); + updateColour(); + } + + protected override bool OnHover(HoverEvent e) + { + updateColour(); + return false; + } + + protected override void OnHoverLost(HoverLostEvent e) + { + updateColour(); + } + + private void updateColour() + { + bool hovered = Enabled.Value && IsHovered; + var hoveredColour = colourProvider?.Light4 ?? colours.PinkDarker; + var unhoveredColour = colourProvider?.Background5 ?? Color4.Black.Opacity(0.5f); + + if (SearchBar.State.Value == Visibility.Visible) + { + Icon.Colour = hovered ? hoveredColour.Lighten(0.5f) : Colour4.White; + Background.Colour = unhoveredColour; + } + else + { + Icon.Colour = Color4.White; + Background.Colour = hovered ? hoveredColour : unhoveredColour; + } + } + + protected override DropdownSearchBar CreateSearchBar() => new OsuDropdownSearchBar + { + Padding = new MarginPadding { Right = 36 }, + }; + + private partial class OsuDropdownSearchBar : DropdownSearchBar + { + protected override void PopIn() => this.FadeIn(); + + protected override void PopOut() => this.FadeOut(); + + protected override TextBox CreateTextBox() => new DropdownSearchTextBox + { + FontSize = OsuFont.Default.Size, + }; + + private partial class DropdownSearchTextBox : SearchTextBox + { + public DropdownSearchTextBox() + { + TextContainer.Margin = new MarginPadding { Top = 4f }; + } + + public override bool OnPressed(KeyBindingPressEvent e) + { + if (e.Action == GlobalAction.Back) + // this method is blocking Dropdown from receiving the back action, despite this text box residing in a separate input manager. + // to fix this properly, a local global action container needs to be added as well, but for simplicity, just don't handle the back action here. + return false; + + return base.OnPressed(e); + } + } } } } From d4aedaf22d730cf03eaf199c06df66939b86f9a8 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:53:24 +0300 Subject: [PATCH 093/567] Always show search bar in skin dropdown for visibility --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index e997e70157..40c54b26a0 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -57,9 +57,10 @@ namespace osu.Game.Overlays.Settings.Sections { skinDropdown = new SkinSettingsDropdown { + AlwaysShowSearchBar = true, LabelText = SkinSettingsStrings.CurrentSkin, Current = skins.CurrentSkinInfo, - Keywords = new[] { @"skins" } + Keywords = new[] { @"skins" }, }, new SettingsButton { From f45336a4f65126fbf258df1627074a089ce51852 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 5 Dec 2023 22:53:35 +0300 Subject: [PATCH 094/567] Make skin dropdown searching non-contiguous --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 40c54b26a0..1d057f42c0 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -58,6 +58,7 @@ namespace osu.Game.Overlays.Settings.Sections skinDropdown = new SkinSettingsDropdown { AlwaysShowSearchBar = true, + AllowNonContiguousMatching = true, LabelText = SkinSettingsStrings.CurrentSkin, Current = skins.CurrentSkinInfo, Keywords = new[] { @"skins" }, From 160edcd2707d64aede30385eb9bf59ef4641fb7b Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 6 Dec 2023 07:09:46 +0300 Subject: [PATCH 095/567] Move objects at a constant speed whenever possible --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 54 ++++++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 16517a2f36..0defebc1c3 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -27,8 +27,8 @@ namespace osu.Game.Rulesets.Osu.Mods public override double ScoreMultiplier => 1; public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModMagnetised), typeof(OsuModRepel), typeof(OsuModFreezeFrame), typeof(ModWithVisibilityAdjustment) }).ToArray(); - private static readonly Vector3 camera_position = new Vector3(OsuPlayfield.BASE_SIZE.X * 0.5f, OsuPlayfield.BASE_SIZE.Y * 0.5f, -100); - private readonly float minDepth = depthForScale(1.5f); + private static readonly Vector3 camera_position = new Vector3(OsuPlayfield.BASE_SIZE.X * 0.5f, OsuPlayfield.BASE_SIZE.Y * 0.5f, -200); + private readonly float sliderMinDepth = depthForScale(1.5f); // Depth at which slider's scale will be 1.5f [SettingSource("Maximum depth", "How far away objects appear.", 0)] public BindableFloat MaxDepth { get; } = new BindableFloat(100) @@ -80,30 +80,60 @@ namespace osu.Game.Rulesets.Osu.Mods switch (drawable) { case DrawableHitCircle circle: - processObject(time, circle, 0); + processHitObject(time, circle); break; case DrawableSlider slider: - processObject(time, slider, slider.HitObject.Duration); + processSlider(time, slider); break; } } } - private void processObject(double time, DrawableOsuHitObject drawable, double duration) + private void processHitObject(double time, DrawableOsuHitObject drawable) { var hitObject = drawable.HitObject; + // Circles are always moving at the constant speed. They'll fade out before reaching the camera even at extreme conditions (AR 11, max depth). + double speed = MaxDepth.Value / hitObject.TimePreempt; + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + float z = MaxDepth.Value - (float)((Math.Max(time, appearTime) - appearTime) * speed); + + float scale = scaleForDepth(z); + drawable.Position = toPlayfieldPosition(scale, hitObject.Position); + drawable.Scale = new Vector2(scale); + } + + private void processSlider(double time, DrawableSlider drawableSlider) + { + var hitObject = drawableSlider.HitObject; + double baseSpeed = MaxDepth.Value / hitObject.TimePreempt; - double offsetAfterStartTime = duration + hitObject.MaximumJudgementOffset + 500; - double slowSpeed = Math.Min(-minDepth / offsetAfterStartTime, baseSpeed); + double appearTime = hitObject.StartTime - hitObject.TimePreempt; + + // Allow slider to move at a constant speed if its scale at the end time will be lower than 1.5f + float zEnd = MaxDepth.Value - (float)((Math.Max(hitObject.StartTime + hitObject.Duration, appearTime) - appearTime) * baseSpeed); + + if (zEnd > sliderMinDepth) + { + processHitObject(time, drawableSlider); + return; + } + + double offsetAfterStartTime = hitObject.Duration + 500; + double slowSpeed = Math.Min(-sliderMinDepth / offsetAfterStartTime, baseSpeed); double decelerationTime = hitObject.TimePreempt * 0.2; float decelerationDistance = (float)(decelerationTime * (baseSpeed + slowSpeed) * 0.5); float z; - if (time < hitObject.StartTime) + if (time < hitObject.StartTime - decelerationTime) + { + float fullDistance = decelerationDistance + (float)(baseSpeed * (hitObject.TimePreempt - decelerationTime)); + z = fullDistance - (float)((Math.Max(time, appearTime) - appearTime) * baseSpeed); + } + else if (time < hitObject.StartTime) { double timeOffset = time - (hitObject.StartTime - decelerationTime); double deceleration = (slowSpeed - baseSpeed) / decelerationTime; @@ -116,13 +146,13 @@ namespace osu.Game.Rulesets.Osu.Mods } float scale = scaleForDepth(z); - drawable.Position = toPlayfieldPosition(scale, hitObject.Position); - drawable.Scale = new Vector2(scale); + drawableSlider.Position = toPlayfieldPosition(scale, hitObject.Position); + drawableSlider.Scale = new Vector2(scale); } - private static float scaleForDepth(float depth) => 100 / (depth - camera_position.Z); + private static float scaleForDepth(float depth) => -camera_position.Z / Math.Max(1f, depth - camera_position.Z); - private static float depthForScale(float scale) => 100 / scale + camera_position.Z; + private static float depthForScale(float scale) => -camera_position.Z / scale + camera_position.Z; private static Vector2 toPlayfieldPosition(float scale, Vector2 positionAtZeroDepth) { From b0878e36cf39baeb92da9b646e2a47c62acf7891 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 6 Dec 2023 10:30:21 +0300 Subject: [PATCH 096/567] Fix stacks having incorrect position --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index 0defebc1c3..f71acf95b8 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Osu.Mods float z = MaxDepth.Value - (float)((Math.Max(time, appearTime) - appearTime) * speed); float scale = scaleForDepth(z); - drawable.Position = toPlayfieldPosition(scale, hitObject.Position); + drawable.Position = toPlayfieldPosition(scale, hitObject.StackedPosition); drawable.Scale = new Vector2(scale); } @@ -146,7 +146,7 @@ namespace osu.Game.Rulesets.Osu.Mods } float scale = scaleForDepth(z); - drawableSlider.Position = toPlayfieldPosition(scale, hitObject.Position); + drawableSlider.Position = toPlayfieldPosition(scale, hitObject.StackedPosition); drawableSlider.Scale = new Vector2(scale); } From faf60cec919637b0c8b04b3c69b15b909cfd90f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 6 Dec 2023 10:11:41 +0100 Subject: [PATCH 097/567] Extend test coverage of skin editor open to fail better --- .../Visual/Navigation/TestSceneSkinEditorNavigation.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs index fa85c8c9f8..57f1b2fbe9 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs @@ -283,15 +283,17 @@ namespace osu.Game.Tests.Visual.Navigation openSkinEditor(); } - [Test] - public void TestOpenSkinEditorGameplaySceneWhenDifferentRulesetActive() + [TestCase(1)] + [TestCase(2)] + [TestCase(3)] + public void TestOpenSkinEditorGameplaySceneWhenDifferentRulesetActive(int rulesetId) { BeatmapSetInfo beatmapSet = null!; AddStep("import beatmap", () => beatmapSet = BeatmapImportHelper.LoadQuickOszIntoOsu(Game).GetResultSafely()); - AddStep("select mania difficulty", () => + AddStep($"select difficulty for ruleset w/ ID {rulesetId}", () => { - var beatmap = beatmapSet.Beatmaps.First(b => b.Ruleset.OnlineID == 3); + var beatmap = beatmapSet.Beatmaps.First(b => b.Ruleset.OnlineID == rulesetId); Game.Beatmap.Value = Game.BeatmapManager.GetWorkingBeatmap(beatmap); }); From f239d03d75aaeb02118f5a316c6febf135b291dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 6 Dec 2023 10:12:25 +0100 Subject: [PATCH 098/567] Forcibly change ruleset to correct one before entering gameplay from main menu Closes #25663 (again). As it turns out, in some scenarios it can be the case that the current game-global `Beatmap` is not valid for the current game-global `Ruleset`. The validity of one and the other in conjunction is only really validated by the song select screen; elsewhere there is no guarantee that the global beatmap is playable using the global ruleset. However, this only comes up in very specific circumstances, namely one: when trying to autoplay a catch beatmap with osu! ruleset globally active via the skin editor flow. `Player` is responsible for retrieving the beatmap to be played. It does so by invoking the appropriate beatmap converter and asking it if the beatmap can be converted: https://github.com/ppy/osu/blob/6d64538d7a3130df63574eb75a8ebe044154c799/osu.Game/Beatmaps/WorkingBeatmap.cs#L262-L266 If the code above throws, `Player` actually silently covers for this, by trying the beatmap's default ruleset instead: https://github.com/ppy/osu/blob/6d64538d7a3130df63574eb75a8ebe044154c799/osu.Game/Screens/Play/Player.cs#L529-L536 However, for the pairing of osu! ruleset and catch beatmap, this fails, as `OsuBeatmapConverter`'s condition necessary for permitting conversion is that the objects have a defined position: https://github.com/ppy/osu/blob/6d64538d7a3130df63574eb75a8ebe044154c799/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs#L25 which they will do, due to the fact that all catch beatmaps are really just osu! beatmaps but with conversion steps applied, and thus `Player` succeeds to load the catch beatmap in osu! ruleset. In the skin editor scenario, this would lead to the secondary failure of the skin editor trying to apply `CatchModAutoplay` on top of all of that, which would fail at the hard-cast of the beatmap to `CatchBeatmap`. --- osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs index 262ce263bd..bedaf12c9b 100644 --- a/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs +++ b/osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs @@ -17,6 +17,7 @@ using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Graphics.Containers; using osu.Game.Input.Bindings; +using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Scoring; using osu.Game.Screens; @@ -58,6 +59,9 @@ namespace osu.Game.Overlays.SkinEditor [Resolved] private Bindable> mods { get; set; } = null!; + [Resolved] + private Bindable ruleset { get; set; } = null!; + [Resolved] private IBindable beatmap { get; set; } = null!; @@ -153,7 +157,11 @@ namespace osu.Game.Overlays.SkinEditor if (screen is Player) return; - var replayGeneratingMod = beatmap.Value.BeatmapInfo.Ruleset.CreateInstance().GetAutoplayMod(); + // the validity of the current game-wide beatmap + ruleset combination is enforced by song select. + // if we're anywhere else, the state is unknown and may not make sense, so forcibly set something that does. + if (screen is not PlaySongSelect) + ruleset.Value = beatmap.Value.BeatmapInfo.Ruleset; + var replayGeneratingMod = ruleset.Value.CreateInstance().GetAutoplayMod(); IReadOnlyList usableMods = mods.Value; From a8f3a0533ac72da3a7abd1696770c27a21b4c692 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Wed, 6 Dec 2023 16:35:59 +0100 Subject: [PATCH 099/567] Use 4th order BSpline by default --- .../Editor/TestSceneSliderPlacementBlueprint.cs | 8 ++++---- .../Sliders/Components/PathControlPointVisualiser.cs | 2 +- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs index f889999fe3..bbded55732 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs @@ -312,7 +312,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertPlaced(true); assertLength(808, tolerance: 10); assertControlPointCount(5); - assertControlPointType(0, PathType.BSpline(3)); + assertControlPointType(0, PathType.BSpline(4)); assertControlPointType(1, null); assertControlPointType(2, null); assertControlPointType(3, null); @@ -337,9 +337,9 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertPlaced(true); assertLength(600, tolerance: 10); assertControlPointCount(4); - assertControlPointType(0, PathType.BSpline(3)); - assertControlPointType(1, PathType.BSpline(3)); - assertControlPointType(2, PathType.BSpline(3)); + assertControlPointType(0, PathType.BSpline(4)); + assertControlPointType(1, PathType.BSpline(4)); + assertControlPointType(2, PathType.BSpline(4)); assertControlPointType(3, null); } diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs index 3add95b2b2..24e2210b45 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs @@ -373,7 +373,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components curveTypeItems.Add(createMenuItemForPathType(PathType.LINEAR)); curveTypeItems.Add(createMenuItemForPathType(PathType.PERFECT_CURVE)); curveTypeItems.Add(createMenuItemForPathType(PathType.BEZIER)); - curveTypeItems.Add(createMenuItemForPathType(PathType.BSpline(3))); + curveTypeItems.Add(createMenuItemForPathType(PathType.BSpline(4))); if (selectedPieces.Any(piece => piece.ControlPoint.Type?.Type == SplineType.Catmull)) curveTypeItems.Add(createMenuItemForPathType(PathType.CATMULL)); diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index e13a46d0cd..672ac43f2c 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders [Resolved(CanBeNull = true)] private FreehandSliderToolboxGroup freehandToolboxGroup { get; set; } - private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder(); + private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder { Degree = 4 }; protected override bool IsValidForPlacement => HitObject.Path.HasValidLength; @@ -239,7 +239,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { if (state == SliderPlacementState.Drawing) { - segmentStart.Type = PathType.BSpline(3); + segmentStart.Type = PathType.BSpline(4); return; } @@ -335,7 +335,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders if (segment.Count == 0) continue; - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(3))); + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(4))); for (int j = 1; j < segment.Count - 1; j++) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); From 22287f3a7f3acc256f13d5759665e2dbf4a27983 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Wed, 6 Dec 2023 16:36:24 +0100 Subject: [PATCH 100/567] decrease max tolerance --- osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs index 87dd8636c9..7d1eb4e270 100644 --- a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs +++ b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Edit public BindableFloat Tolerance { get; } = new BindableFloat(2f) { MinValue = 0.05f, - MaxValue = 3f, + MaxValue = 2.0f, Precision = 0.01f }; @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Edit }; // We map internal ranges to a more standard range of values for display to the user. - private readonly BindableInt displayTolerance = new BindableInt(66) + private readonly BindableInt displayTolerance = new BindableInt(100) { MinValue = 5, MaxValue = 100 @@ -90,8 +90,8 @@ namespace osu.Game.Rulesets.Osu.Edit displayCornerThreshold.Value = internalToDisplayCornerThreshold(threshold.NewValue) ); - float displayToInternalTolerance(float v) => v / 33f; - int internalToDisplayTolerance(float v) => (int)Math.Round(v * 33f); + float displayToInternalTolerance(float v) => v / 50f; + int internalToDisplayTolerance(float v) => (int)Math.Round(v * 50f); float displayToInternalCornerThreshold(float v) => v / 100f; int internalToDisplayCornerThreshold(float v) => (int)Math.Round(v * 100f); From 193047619210ce42a2a54e87dcce2bffb5ddab70 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 7 Dec 2023 00:26:13 +0100 Subject: [PATCH 101/567] Add circle arc segments --- .../Sliders/SliderPlacementBlueprint.cs | 77 ++++++++++++++++++- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 672ac43f2c..f5d0d82c2a 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -3,6 +3,7 @@ #nullable disable +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -335,15 +336,85 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders if (segment.Count == 0) continue; - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(4))); - for (int j = 1; j < segment.Count - 1; j++) - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); + // Replace this segment with a circular arc if it is a reasonable substitute. + var circleArcSegment = tryCircleArc(segment); + + if (circleArcSegment is not null) + { + HitObject.Path.ControlPoints.Add(new PathControlPoint(circleArcSegment[0], PathType.PERFECT_CURVE)); + HitObject.Path.ControlPoints.Add(new PathControlPoint(circleArcSegment[1])); + } + else + { + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(4))); + for (int j = 1; j < segment.Count - 1; j++) + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j])); + } if (isLastSegment) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[^1])); } } + private Vector2[] tryCircleArc(List segment) + { + if (segment.Count < 3) return null; + + // Assume the segment creates a reasonable circular arc and then check if it reasonable + var points = PathApproximator.BSplineToPiecewiseLinear(segment.ToArray(), bSplineBuilder.Degree); + var circleArcControlPoints = new[] { points[0], points[points.Count / 2], points[^1] }; + var circleArc = new CircularArcProperties(circleArcControlPoints); + + if (!circleArc.IsValid) return null; + + double length = circleArc.ThetaRange * circleArc.Radius; + + if (length > 1000) return null; + + double loss = 0; + Vector2? lastPoint = null; + Vector2? lastVec = null; + int? lastDir = null; + double totalWinding = 0; + + // Loop through the points and check if they are not too far away from the circular arc. + // Also make sure it curves monotonically in one direction and at most one loop is done. + foreach (var point in points) + { + loss += Math.Pow((Vector2.Distance(point, circleArc.Centre) - circleArc.Radius) / length, 2); + + if (lastPoint.HasValue) + { + var vec = point - lastPoint.Value; + + if (lastVec.HasValue) + { + double dot = Vector2.Dot(vec, lastVec.Value); + double det = lastVec.Value.X * vec.Y - lastVec.Value.Y * vec.X; + double angle = Math.Atan2(det, dot); + int dir = Math.Sign(angle); + + if (dir == 0) + continue; + + if (lastDir.HasValue && dir != lastDir) + return null; // Curvature changed, like in an S-shape + + totalWinding += Math.Abs(angle); + lastDir = dir; + } + + lastVec = vec; + } + + lastPoint = point; + } + + loss /= points.Count; + + return loss > 0.002 || totalWinding > MathHelper.TwoPi ? null : circleArcControlPoints; + } + private enum SliderPlacementState { Initial, From 89859b85b7e8523171fe6e7d686bf4e6ecb99d3c Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 7 Dec 2023 00:43:34 +0100 Subject: [PATCH 102/567] add controllable leniency --- .../Sliders/SliderPlacementBlueprint.cs | 9 ++++-- .../Edit/FreehandSliderToolboxGroup.cs | 32 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index f5d0d82c2a..5878c0e11b 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -95,6 +95,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders bSplineBuilder.CornerThreshold = e.NewValue; Scheduler.AddOnce(updateSliderPathFromBSplineBuilder); }, true); + + freehandToolboxGroup.CircleThreshold.BindValueChanged(e => + { + Scheduler.AddOnce(updateSliderPathFromBSplineBuilder); + }, true); } } @@ -358,7 +363,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders private Vector2[] tryCircleArc(List segment) { - if (segment.Count < 3) return null; + if (segment.Count < 3 || freehandToolboxGroup.CircleThreshold.Value == 0) return null; // Assume the segment creates a reasonable circular arc and then check if it reasonable var points = PathApproximator.BSplineToPiecewiseLinear(segment.ToArray(), bSplineBuilder.Degree); @@ -412,7 +417,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders loss /= points.Count; - return loss > 0.002 || totalWinding > MathHelper.TwoPi ? null : circleArcControlPoints; + return loss > freehandToolboxGroup.CircleThreshold.Value || totalWinding > MathHelper.TwoPi ? null : circleArcControlPoints; } private enum SliderPlacementState diff --git a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs index 7d1eb4e270..c574280267 100644 --- a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs +++ b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs @@ -31,6 +31,13 @@ namespace osu.Game.Rulesets.Osu.Edit Precision = 0.01f }; + public BindableFloat CircleThreshold { get; } = new BindableFloat(0.002f) + { + MinValue = 0f, + MaxValue = 0.005f, + Precision = 0.0001f + }; + // We map internal ranges to a more standard range of values for display to the user. private readonly BindableInt displayTolerance = new BindableInt(100) { @@ -44,8 +51,15 @@ namespace osu.Game.Rulesets.Osu.Edit MaxValue = 100 }; + private readonly BindableInt displayCircleThreshold = new BindableInt(40) + { + MinValue = 0, + MaxValue = 100 + }; + private ExpandableSlider toleranceSlider = null!; private ExpandableSlider cornerThresholdSlider = null!; + private ExpandableSlider circleThresholdSlider = null!; [BackgroundDependencyLoader] private void load() @@ -59,6 +73,10 @@ namespace osu.Game.Rulesets.Osu.Edit cornerThresholdSlider = new ExpandableSlider { Current = displayCornerThreshold + }, + circleThresholdSlider = new ExpandableSlider + { + Current = displayCircleThreshold } }; } @@ -83,18 +101,32 @@ namespace osu.Game.Rulesets.Osu.Edit CornerThreshold.Value = displayToInternalCornerThreshold(threshold.NewValue); }, true); + displayCircleThreshold.BindValueChanged(threshold => + { + circleThresholdSlider.ContractedLabelText = $"P. C. T.: {threshold.NewValue:N0}"; + circleThresholdSlider.ExpandedLabelText = $"Perfect Curve Threshold: {threshold.NewValue:N0}"; + + CircleThreshold.Value = displayToInternalCircleThreshold(threshold.NewValue); + }, true); + Tolerance.BindValueChanged(tolerance => displayTolerance.Value = internalToDisplayTolerance(tolerance.NewValue) ); CornerThreshold.BindValueChanged(threshold => displayCornerThreshold.Value = internalToDisplayCornerThreshold(threshold.NewValue) ); + CircleThreshold.BindValueChanged(threshold => + displayCircleThreshold.Value = internalToDisplayCircleThreshold(threshold.NewValue) + ); float displayToInternalTolerance(float v) => v / 50f; int internalToDisplayTolerance(float v) => (int)Math.Round(v * 50f); float displayToInternalCornerThreshold(float v) => v / 100f; int internalToDisplayCornerThreshold(float v) => (int)Math.Round(v * 100f); + + float displayToInternalCircleThreshold(float v) => v / 20000f; + int internalToDisplayCircleThreshold(float v) => (int)Math.Round(v * 20000f); } } } From a2ec75d824b4bc80198a8937944ed84d7f904158 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 7 Dec 2023 00:57:29 +0100 Subject: [PATCH 103/567] Fix illegal circle arc with center out of polygon --- .../Sliders/SliderPlacementBlueprint.cs | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index 5878c0e11b..e5dada19bb 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -379,37 +379,56 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders double loss = 0; Vector2? lastPoint = null; Vector2? lastVec = null; + Vector2? lastVec2 = null; int? lastDir = null; + int? lastDir2 = null; double totalWinding = 0; // Loop through the points and check if they are not too far away from the circular arc. // Also make sure it curves monotonically in one direction and at most one loop is done. foreach (var point in points) { - loss += Math.Pow((Vector2.Distance(point, circleArc.Centre) - circleArc.Radius) / length, 2); + var vec = point - circleArc.Centre; + loss += Math.Pow((vec.Length - circleArc.Radius) / length, 2); + + if (lastVec.HasValue) + { + double det = lastVec.Value.X * vec.Y - lastVec.Value.Y * vec.X; + int dir = Math.Sign(det); + + if (dir == 0) + continue; + + if (lastDir.HasValue && dir != lastDir) + return null; // Circle center is not inside the polygon + + lastDir = dir; + } + + lastVec = vec; if (lastPoint.HasValue) { - var vec = point - lastPoint.Value; + var vec2 = point - lastPoint.Value; - if (lastVec.HasValue) + if (lastVec2.HasValue) { - double dot = Vector2.Dot(vec, lastVec.Value); - double det = lastVec.Value.X * vec.Y - lastVec.Value.Y * vec.X; + double dot = Vector2.Dot(vec2, lastVec2.Value); + double det = lastVec2.Value.X * vec2.Y - lastVec2.Value.Y * vec2.X; double angle = Math.Atan2(det, dot); - int dir = Math.Sign(angle); + int dir2 = Math.Sign(angle); - if (dir == 0) + if (dir2 == 0) continue; - if (lastDir.HasValue && dir != lastDir) + if (lastDir2.HasValue && dir2 != lastDir2) return null; // Curvature changed, like in an S-shape totalWinding += Math.Abs(angle); - lastDir = dir; + lastDir2 = dir2; } - lastVec = vec; + lastVec2 = vec2; } lastPoint = point; From 7b49db05d134676605efd0859016c78f9900ebee Mon Sep 17 00:00:00 2001 From: OliBomby Date: Thu, 7 Dec 2023 01:15:42 +0100 Subject: [PATCH 104/567] Update default parameters to be slightly better --- osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs index c574280267..f17118ba34 100644 --- a/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs +++ b/osu.Game.Rulesets.Osu/Edit/FreehandSliderToolboxGroup.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Edit { } - public BindableFloat Tolerance { get; } = new BindableFloat(2f) + public BindableFloat Tolerance { get; } = new BindableFloat(1.8f) { MinValue = 0.05f, MaxValue = 2.0f, @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Edit Precision = 0.01f }; - public BindableFloat CircleThreshold { get; } = new BindableFloat(0.002f) + public BindableFloat CircleThreshold { get; } = new BindableFloat(0.0015f) { MinValue = 0f, MaxValue = 0.005f, @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Edit }; // We map internal ranges to a more standard range of values for display to the user. - private readonly BindableInt displayTolerance = new BindableInt(100) + private readonly BindableInt displayTolerance = new BindableInt(90) { MinValue = 5, MaxValue = 100 @@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.Edit MaxValue = 100 }; - private readonly BindableInt displayCircleThreshold = new BindableInt(40) + private readonly BindableInt displayCircleThreshold = new BindableInt(30) { MinValue = 0, MaxValue = 100 From 07dc44ccd769213a1078ac36bd867c7f6ee300f2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Dec 2023 16:18:54 +0900 Subject: [PATCH 105/567] Make log export async and show notification on completion --- .../Sections/General/UpdateSettings.cs | 62 +++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 398e4b39af..a8f5b655d0 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -31,8 +31,11 @@ namespace osu.Game.Overlays.Settings.Sections.General [Resolved] private INotificationOverlay? notifications { get; set; } + [Resolved] + private Storage storage { get; set; } = null!; + [BackgroundDependencyLoader] - private void load(Storage storage, OsuConfigManager config, OsuGame game) + private void load(OsuConfigManager config, OsuGame game) { Add(new SettingsEnumDropdown { @@ -78,23 +81,7 @@ namespace osu.Game.Overlays.Settings.Sections.General { Text = GeneralSettingsStrings.ExportLogs, Keywords = new[] { @"bug", "report", "logs", "files" }, - Action = () => - { - var logStorage = Logger.Storage; - - const string archive_filename = "exports/compressed-logs.zip"; - - using (var outStream = storage.CreateFileSafely(archive_filename)) - using (var zip = ZipArchive.Create()) - { - foreach (string? f in logStorage.GetFiles(string.Empty, "*.log")) - zip.AddEntry(f, logStorage.GetStream(f), true); - - zip.SaveTo(outStream); - } - - storage.PresentFileExternally(archive_filename); - }, + Action = () => Task.Run(exportLogs), }); Add(new SettingsButton @@ -104,5 +91,44 @@ namespace osu.Game.Overlays.Settings.Sections.General }); } } + + private void exportLogs() + { + ProgressNotification notification = new ProgressNotification + { + State = ProgressNotificationState.Active, + Text = "Exporting logs...", + }; + + notifications?.Post(notification); + + const string archive_filename = "exports/compressed-logs.zip"; + + try + { + var logStorage = Logger.Storage; + + using (var outStream = storage.CreateFileSafely(archive_filename)) + using (var zip = ZipArchive.Create()) + { + foreach (string? f in logStorage.GetFiles(string.Empty, "*.log")) zip.AddEntry(f, logStorage.GetStream(f), true); + + zip.SaveTo(outStream); + } + } + catch + { + notification.State = ProgressNotificationState.Cancelled; + + // cleanup if export is failed or canceled. + storage.Delete(archive_filename); + throw; + } + + notification.CompletionText = "Exported logs! Click to view."; + notification.CompletionClickAction = () => storage.PresentFileExternally(archive_filename); + + notification.State = ProgressNotificationState.Completed; + } } } From 81fe15f2882e54d0041538c1af5b16a1748b347f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 9 Dec 2023 15:39:54 +0900 Subject: [PATCH 106/567] Fix osu!mania converted key count edge cases --- .../ManiaBeatmapConversionTest.cs | 1 + .../Beatmaps/1450162-expected-conversion.json | 1 + .../Resources/Testing/Beatmaps/1450162.osu | 297 ++++++++++++++++++ .../Beatmaps/ManiaBeatmapConverter.cs | 5 +- 4 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162-expected-conversion.json create mode 100644 osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162.osu diff --git a/osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs b/osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs index 435d5e737e..609c2e8953 100644 --- a/osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs +++ b/osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs @@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Mania.Tests [TestCase("zero-length-slider")] [TestCase("20544")] [TestCase("100374")] + [TestCase("1450162")] public void Test(string name) => base.Test(name); protected override IEnumerable CreateConvertValue(HitObject hitObject) diff --git a/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162-expected-conversion.json b/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162-expected-conversion.json new file mode 100644 index 0000000000..4981951267 --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162-expected-conversion.json @@ -0,0 +1 @@ +{"Mappings":[{"RandomW":2659430625,"RandomX":3579807591,"RandomY":273326509,"RandomZ":272911513,"StartTime":1107.0,"Objects":[{"StartTime":1107.0,"EndTime":1838.0,"Column":1}]},{"RandomW":4073513076,"RandomX":272911513,"RandomY":2659430625,"RandomZ":3083761897,"StartTime":2570.0,"Objects":[{"StartTime":2570.0,"EndTime":2935.0,"Column":6}]},{"RandomW":1129971314,"RandomX":3083761897,"RandomY":4073513076,"RandomZ":3235797552,"StartTime":3302.0,"Objects":[{"StartTime":3302.0,"EndTime":3667.0,"Column":3}]},{"RandomW":315510790,"RandomX":3235797552,"RandomY":1129971314,"RandomZ":2274676672,"StartTime":4033.0,"Objects":[{"StartTime":4033.0,"EndTime":4764.0,"Column":1}]},{"RandomW":2899658679,"RandomX":2274676672,"RandomY":315510790,"RandomZ":552830901,"StartTime":5497.0,"Objects":[{"StartTime":5497.0,"EndTime":5862.0,"Column":2}]},{"RandomW":3979364583,"RandomX":552830901,"RandomY":2899658679,"RandomZ":2367584034,"StartTime":6228.0,"Objects":[{"StartTime":6228.0,"EndTime":6593.0,"Column":5}]},{"RandomW":1470933435,"RandomX":2367584034,"RandomY":3979364583,"RandomZ":1363326171,"StartTime":6960.0,"Objects":[{"StartTime":6960.0,"EndTime":7142.0,"Column":4}]},{"RandomW":695558923,"RandomX":3979364583,"RandomY":1363326171,"RandomZ":1470933435,"StartTime":7326.0,"Objects":[{"StartTime":7326.0,"EndTime":7326.0,"Column":2},{"StartTime":7326.0,"EndTime":7326.0,"Column":3}]},{"RandomW":47047112,"RandomX":1470933435,"RandomY":695558923,"RandomZ":1181573554,"StartTime":7509.0,"Objects":[{"StartTime":7509.0,"EndTime":7691.0,"Column":0}]},{"RandomW":807301467,"RandomX":695558923,"RandomY":1181573554,"RandomZ":47047112,"StartTime":7875.0,"Objects":[{"StartTime":7875.0,"EndTime":7875.0,"Column":5}]},{"RandomW":2679940725,"RandomX":47047112,"RandomY":807301467,"RandomZ":3002147176,"StartTime":8058.0,"Objects":[{"StartTime":8058.0,"EndTime":8240.0,"Column":1}]},{"RandomW":176449914,"RandomX":2679940725,"RandomY":4061321195,"RandomZ":826668123,"StartTime":8424.0,"Objects":[{"StartTime":8424.0,"EndTime":8789.0,"Column":2},{"StartTime":8424.0,"EndTime":8789.0,"Column":0}]},{"RandomW":3697485076,"RandomX":347653435,"RandomY":172035291,"RandomZ":598178640,"StartTime":8972.0,"Objects":[{"StartTime":8972.0,"EndTime":9154.0,"Column":1},{"StartTime":8972.0,"EndTime":9154.0,"Column":5}]},{"RandomW":237023934,"RandomX":172035291,"RandomY":598178640,"RandomZ":3697485076,"StartTime":9338.0,"Objects":[{"StartTime":9338.0,"EndTime":9338.0,"Column":4},{"StartTime":9338.0,"EndTime":9338.0,"Column":5}]},{"RandomW":201670773,"RandomX":598178640,"RandomY":3697485076,"RandomZ":237023934,"StartTime":9521.0,"Objects":[{"StartTime":9521.0,"EndTime":9521.0,"Column":3}]},{"RandomW":3522038595,"RandomX":237023934,"RandomY":201670773,"RandomZ":341886814,"StartTime":9887.0,"Objects":[{"StartTime":9887.0,"EndTime":10069.0,"Column":4}]},{"RandomW":3662734978,"RandomX":201670773,"RandomY":341886814,"RandomZ":3522038595,"StartTime":10253.0,"Objects":[{"StartTime":10253.0,"EndTime":10253.0,"Column":3},{"StartTime":10253.0,"EndTime":10253.0,"Column":4}]},{"RandomW":4235203413,"RandomX":341886814,"RandomY":3522038595,"RandomZ":3662734978,"StartTime":10436.0,"Objects":[{"StartTime":10436.0,"EndTime":10436.0,"Column":2},{"StartTime":10436.0,"EndTime":10436.0,"Column":3}]},{"RandomW":3996672434,"RandomX":3522038595,"RandomY":3662734978,"RandomZ":4235203413,"StartTime":10619.0,"Objects":[{"StartTime":10619.0,"EndTime":10619.0,"Column":1},{"StartTime":10619.0,"EndTime":10619.0,"Column":2}]},{"RandomW":1328405285,"RandomX":3662734978,"RandomY":4235203413,"RandomZ":3996672434,"StartTime":10802.0,"Objects":[{"StartTime":10802.0,"EndTime":10802.0,"Column":0},{"StartTime":10802.0,"EndTime":10802.0,"Column":1}]},{"RandomW":303317172,"RandomX":4235203413,"RandomY":3996672434,"RandomZ":1328405285,"StartTime":10985.0,"Objects":[{"StartTime":10985.0,"EndTime":10985.0,"Column":1},{"StartTime":10985.0,"EndTime":10985.0,"Column":2}]},{"RandomW":1854018328,"RandomX":3996672434,"RandomY":1328405285,"RandomZ":303317172,"StartTime":11167.0,"Objects":[{"StartTime":11167.0,"EndTime":11167.0,"Column":2},{"StartTime":11167.0,"EndTime":11167.0,"Column":3}]},{"RandomW":1134221963,"RandomX":1328405285,"RandomY":303317172,"RandomZ":1854018328,"StartTime":12814.0,"Objects":[{"StartTime":12814.0,"EndTime":12814.0,"Column":1}]},{"RandomW":2894789541,"RandomX":1134221963,"RandomY":1649399086,"RandomZ":3538823219,"StartTime":13180.0,"Objects":[{"StartTime":13180.0,"EndTime":13362.0,"Column":4},{"StartTime":13180.0,"EndTime":13362.0,"Column":2}]},{"RandomW":2259123626,"RandomX":2894789541,"RandomY":961618493,"RandomZ":631989916,"StartTime":13546.0,"Objects":[{"StartTime":13546.0,"EndTime":13728.0,"Column":0}]},{"RandomW":3004853499,"RandomX":2259123626,"RandomY":2097932552,"RandomZ":3455806558,"StartTime":13911.0,"Objects":[{"StartTime":13911.0,"EndTime":14093.0,"Column":4},{"StartTime":13911.0,"EndTime":14093.0,"Column":2}]},{"RandomW":1511929919,"RandomX":250420511,"RandomY":747435619,"RandomZ":973338160,"StartTime":14277.0,"Objects":[{"StartTime":14277.0,"EndTime":14277.0,"Column":5},{"StartTime":14277.0,"EndTime":14277.0,"Column":6},{"StartTime":14459.0,"EndTime":14459.0,"Column":2},{"StartTime":14459.0,"EndTime":14459.0,"Column":3},{"StartTime":14641.0,"EndTime":14641.0,"Column":3},{"StartTime":14641.0,"EndTime":14641.0,"Column":4}]},{"RandomW":1997079940,"RandomX":973338160,"RandomY":1511929919,"RandomZ":1014879110,"StartTime":14826.0,"Objects":[{"StartTime":14826.0,"EndTime":15191.0,"Column":6}]},{"RandomW":735692759,"RandomX":1997079940,"RandomY":1386139427,"RandomZ":4192918159,"StartTime":15375.0,"Objects":[{"StartTime":15375.0,"EndTime":15557.0,"Column":2}]},{"RandomW":348373517,"RandomX":1386139427,"RandomY":4192918159,"RandomZ":735692759,"StartTime":15741.0,"Objects":[{"StartTime":15741.0,"EndTime":15741.0,"Column":5},{"StartTime":15741.0,"EndTime":15741.0,"Column":6}]},{"RandomW":521239132,"RandomX":735692759,"RandomY":348373517,"RandomZ":2961240161,"StartTime":16106.0,"Objects":[{"StartTime":16106.0,"EndTime":16288.0,"Column":1}]},{"RandomW":1199465075,"RandomX":521239132,"RandomY":4195606806,"RandomZ":4039804915,"StartTime":16472.0,"Objects":[{"StartTime":16472.0,"EndTime":16654.0,"Column":6},{"StartTime":16472.0,"EndTime":16654.0,"Column":3}]},{"RandomW":3059180408,"RandomX":4039804915,"RandomY":1199465075,"RandomZ":3542692698,"StartTime":16838.0,"Objects":[{"StartTime":16838.0,"EndTime":17020.0,"Column":2}]},{"RandomW":834119344,"RandomX":302423902,"RandomY":2799635095,"RandomZ":1022775029,"StartTime":17204.0,"Objects":[{"StartTime":17204.0,"EndTime":17204.0,"Column":4},{"StartTime":17204.0,"EndTime":17204.0,"Column":5},{"StartTime":17386.0,"EndTime":17386.0,"Column":2},{"StartTime":17386.0,"EndTime":17386.0,"Column":3},{"StartTime":17568.0,"EndTime":17568.0,"Column":3},{"StartTime":17568.0,"EndTime":17568.0,"Column":4}]},{"RandomW":1236797567,"RandomX":1022775029,"RandomY":834119344,"RandomZ":393032631,"StartTime":17753.0,"Objects":[{"StartTime":17753.0,"EndTime":18118.0,"Column":4}]},{"RandomW":892840048,"RandomX":1236797567,"RandomY":3350685275,"RandomZ":1270471227,"StartTime":18302.0,"Objects":[{"StartTime":18302.0,"EndTime":18484.0,"Column":2}]},{"RandomW":3233581364,"RandomX":1270471227,"RandomY":892840048,"RandomZ":3158680921,"StartTime":18667.0,"Objects":[{"StartTime":18667.0,"EndTime":19032.0,"Column":3}]},{"RandomW":1163000602,"RandomX":892840048,"RandomY":3158680921,"RandomZ":3233581364,"StartTime":19216.0,"Objects":[{"StartTime":19216.0,"EndTime":19216.0,"Column":2}]},{"RandomW":1548989545,"RandomX":3233581364,"RandomY":1163000602,"RandomZ":3450712040,"StartTime":19399.0,"Objects":[{"StartTime":19399.0,"EndTime":19581.0,"Column":5}]},{"RandomW":313779584,"RandomX":1548989545,"RandomY":2021811198,"RandomZ":2999045855,"StartTime":19765.0,"Objects":[{"StartTime":19765.0,"EndTime":19947.0,"Column":2},{"StartTime":19765.0,"EndTime":19947.0,"Column":1}]},{"RandomW":3548572483,"RandomX":2021811198,"RandomY":2999045855,"RandomZ":313779584,"StartTime":20131.0,"Objects":[{"StartTime":20131.0,"EndTime":20131.0,"Column":6}]},{"RandomW":75459001,"RandomX":313779584,"RandomY":3548572483,"RandomZ":3094675294,"StartTime":20314.0,"Objects":[{"StartTime":20314.0,"EndTime":20496.0,"Column":0}]},{"RandomW":1299261902,"RandomX":3094675294,"RandomY":75459001,"RandomZ":2305626963,"StartTime":20680.0,"Objects":[{"StartTime":20680.0,"EndTime":21045.0,"Column":4}]},{"RandomW":2905421941,"RandomX":2305626963,"RandomY":1299261902,"RandomZ":1390453041,"StartTime":21228.0,"Objects":[{"StartTime":21228.0,"EndTime":21410.0,"Column":2}]},{"RandomW":2294300184,"RandomX":1390453041,"RandomY":2905421941,"RandomZ":1278955784,"StartTime":21594.0,"Objects":[{"StartTime":21594.0,"EndTime":22325.0,"Column":6},{"StartTime":21594.0,"EndTime":21594.0,"Column":4},{"StartTime":21959.0,"EndTime":21959.0,"Column":4},{"StartTime":22324.0,"EndTime":22324.0,"Column":4}]},{"RandomW":3749637912,"RandomX":2905421941,"RandomY":1278955784,"RandomZ":2294300184,"StartTime":22509.0,"Objects":[{"StartTime":22509.0,"EndTime":22509.0,"Column":6},{"StartTime":22509.0,"EndTime":22509.0,"Column":0}]},{"RandomW":753327495,"RandomX":458525202,"RandomY":2373004129,"RandomZ":80278569,"StartTime":22692.0,"Objects":[{"StartTime":22692.0,"EndTime":22874.0,"Column":2}]},{"RandomW":3562609217,"RandomX":753327495,"RandomY":2472396307,"RandomZ":2540952890,"StartTime":23058.0,"Objects":[{"StartTime":23058.0,"EndTime":23058.0,"Column":1},{"StartTime":23058.0,"EndTime":23058.0,"Column":5}]},{"RandomW":3562609217,"RandomX":753327495,"RandomY":2472396307,"RandomZ":2540952890,"StartTime":23241.0,"Objects":[{"StartTime":23241.0,"EndTime":23241.0,"Column":5},{"StartTime":23241.0,"EndTime":23241.0,"Column":1}]},{"RandomW":3009004844,"RandomX":2540952890,"RandomY":3562609217,"RandomZ":3460951976,"StartTime":23606.0,"Objects":[{"StartTime":23606.0,"EndTime":23971.0,"Column":2}]},{"RandomW":1524995266,"RandomX":3133817968,"RandomY":2791164538,"RandomZ":669533622,"StartTime":24155.0,"Objects":[{"StartTime":24155.0,"EndTime":24337.0,"Column":4}]},{"RandomW":2667749121,"RandomX":1524995266,"RandomY":3001332266,"RandomZ":4204965910,"StartTime":24521.0,"Objects":[{"StartTime":24521.0,"EndTime":24521.0,"Column":0},{"StartTime":24521.0,"EndTime":24521.0,"Column":6}]},{"RandomW":1230014889,"RandomX":2127937865,"RandomY":2434329733,"RandomZ":443126576,"StartTime":24704.0,"Objects":[{"StartTime":24704.0,"EndTime":25069.0,"Column":1},{"StartTime":24704.0,"EndTime":25069.0,"Column":4}]},{"RandomW":1409501366,"RandomX":2573194819,"RandomY":3480583465,"RandomZ":2580776932,"StartTime":25253.0,"Objects":[{"StartTime":25253.0,"EndTime":25253.0,"Column":0},{"StartTime":25253.0,"EndTime":25253.0,"Column":1},{"StartTime":25435.0,"EndTime":25435.0,"Column":4},{"StartTime":25435.0,"EndTime":25435.0,"Column":5},{"StartTime":25617.0,"EndTime":25617.0,"Column":1},{"StartTime":25617.0,"EndTime":25617.0,"Column":2}]},{"RandomW":864641467,"RandomX":3480583465,"RandomY":2580776932,"RandomZ":1409501366,"StartTime":25802.0,"Objects":[{"StartTime":25802.0,"EndTime":25802.0,"Column":1}]},{"RandomW":1467076310,"RandomX":2580776932,"RandomY":1409501366,"RandomZ":864641467,"StartTime":25985.0,"Objects":[{"StartTime":25985.0,"EndTime":25985.0,"Column":2}]},{"RandomW":479214438,"RandomX":864641467,"RandomY":1467076310,"RandomZ":1385729915,"StartTime":26167.0,"Objects":[{"StartTime":26167.0,"EndTime":26532.0,"Column":1}]},{"RandomW":3054605916,"RandomX":1684801014,"RandomY":3182588115,"RandomZ":734516041,"StartTime":26716.0,"Objects":[{"StartTime":26716.0,"EndTime":26716.0,"Column":4},{"StartTime":26716.0,"EndTime":26716.0,"Column":2},{"StartTime":26898.0,"EndTime":26898.0,"Column":3},{"StartTime":26898.0,"EndTime":26898.0,"Column":1},{"StartTime":27080.0,"EndTime":27080.0,"Column":2},{"StartTime":27080.0,"EndTime":27080.0,"Column":6}]},{"RandomW":2992010973,"RandomX":3182588115,"RandomY":734516041,"RandomZ":3054605916,"StartTime":27265.0,"Objects":[{"StartTime":27265.0,"EndTime":27265.0,"Column":2}]},{"RandomW":2622274732,"RandomX":734516041,"RandomY":3054605916,"RandomZ":2992010973,"StartTime":27448.0,"Objects":[{"StartTime":27448.0,"EndTime":27448.0,"Column":3}]},{"RandomW":3013455357,"RandomX":2992010973,"RandomY":2622274732,"RandomZ":2298767863,"StartTime":27631.0,"Objects":[{"StartTime":27631.0,"EndTime":27996.0,"Column":2}]},{"RandomW":2994521549,"RandomX":2622274732,"RandomY":2298767863,"RandomZ":3013455357,"StartTime":28180.0,"Objects":[{"StartTime":28180.0,"EndTime":28180.0,"Column":5}]},{"RandomW":3949426364,"RandomX":1261217522,"RandomY":3788322225,"RandomZ":3210845744,"StartTime":28363.0,"Objects":[{"StartTime":28363.0,"EndTime":28363.0,"Column":5},{"StartTime":28363.0,"EndTime":28363.0,"Column":2},{"StartTime":28545.0,"EndTime":28545.0,"Column":5},{"StartTime":28545.0,"EndTime":28545.0,"Column":2},{"StartTime":28727.0,"EndTime":28727.0,"Column":3},{"StartTime":28727.0,"EndTime":28727.0,"Column":6}]},{"RandomW":1304069042,"RandomX":3210845744,"RandomY":3949426364,"RandomZ":3310503444,"StartTime":28911.0,"Objects":[{"StartTime":28911.0,"EndTime":29276.0,"Column":4}]},{"RandomW":781934546,"RandomX":3310503444,"RandomY":1304069042,"RandomZ":4271440939,"StartTime":29460.0,"Objects":[{"StartTime":29460.0,"EndTime":29460.0,"Column":6},{"StartTime":29460.0,"EndTime":29460.0,"Column":2}]},{"RandomW":3592330498,"RandomX":781934546,"RandomY":2041503475,"RandomZ":3767559527,"StartTime":29643.0,"Objects":[{"StartTime":29643.0,"EndTime":30008.0,"Column":5},{"StartTime":29643.0,"EndTime":30008.0,"Column":4}]},{"RandomW":579808732,"RandomX":2041503475,"RandomY":3767559527,"RandomZ":3592330498,"StartTime":30192.0,"Objects":[{"StartTime":30192.0,"EndTime":30192.0,"Column":4}]},{"RandomW":769209912,"RandomX":3767559527,"RandomY":3592330498,"RandomZ":579808732,"StartTime":30375.0,"Objects":[{"StartTime":30375.0,"EndTime":30375.0,"Column":4}]},{"RandomW":1825941494,"RandomX":579808732,"RandomY":769209912,"RandomZ":1308743097,"StartTime":30558.0,"Objects":[{"StartTime":30558.0,"EndTime":30923.0,"Column":5}]},{"RandomW":1378114054,"RandomX":930055805,"RandomY":3554877022,"RandomZ":2467280262,"StartTime":31106.0,"Objects":[{"StartTime":31106.0,"EndTime":31106.0,"Column":2},{"StartTime":31106.0,"EndTime":31106.0,"Column":5},{"StartTime":31288.0,"EndTime":31288.0,"Column":4},{"StartTime":31288.0,"EndTime":31288.0,"Column":1},{"StartTime":31470.0,"EndTime":31470.0,"Column":1},{"StartTime":31470.0,"EndTime":31470.0,"Column":4}]},{"RandomW":422797905,"RandomX":3554877022,"RandomY":2467280262,"RandomZ":1378114054,"StartTime":31655.0,"Objects":[{"StartTime":31655.0,"EndTime":31655.0,"Column":1}]},{"RandomW":3538525895,"RandomX":2467280262,"RandomY":1378114054,"RandomZ":422797905,"StartTime":31838.0,"Objects":[{"StartTime":31838.0,"EndTime":31838.0,"Column":0}]},{"RandomW":1277180769,"RandomX":422797905,"RandomY":3538525895,"RandomZ":1017422489,"StartTime":32021.0,"Objects":[{"StartTime":32021.0,"EndTime":32386.0,"Column":4}]},{"RandomW":69027963,"RandomX":3464755550,"RandomY":1342331375,"RandomZ":1235978524,"StartTime":32570.0,"Objects":[{"StartTime":32570.0,"EndTime":32752.0,"Column":0}]},{"RandomW":3582265519,"RandomX":1342331375,"RandomY":1235978524,"RandomZ":69027963,"StartTime":32936.0,"Objects":[{"StartTime":32936.0,"EndTime":32936.0,"Column":2},{"StartTime":32936.0,"EndTime":32936.0,"Column":3}]},{"RandomW":2197579333,"RandomX":69027963,"RandomY":3582265519,"RandomZ":2534080209,"StartTime":33302.0,"Objects":[{"StartTime":33302.0,"EndTime":33667.0,"Column":0}]},{"RandomW":820123404,"RandomX":1816967409,"RandomY":2440103335,"RandomZ":1364041006,"StartTime":33850.0,"Objects":[{"StartTime":33850.0,"EndTime":34215.0,"Column":4},{"StartTime":33850.0,"EndTime":34215.0,"Column":2}]},{"RandomW":962636497,"RandomX":2440103335,"RandomY":1364041006,"RandomZ":820123404,"StartTime":34399.0,"Objects":[{"StartTime":34399.0,"EndTime":34399.0,"Column":3},{"StartTime":34399.0,"EndTime":34399.0,"Column":4}]},{"RandomW":539348071,"RandomX":1364041006,"RandomY":820123404,"RandomZ":962636497,"StartTime":34582.0,"Objects":[{"StartTime":34582.0,"EndTime":34582.0,"Column":4}]},{"RandomW":1036431212,"RandomX":962636497,"RandomY":539348071,"RandomZ":498893216,"StartTime":34765.0,"Objects":[{"StartTime":34765.0,"EndTime":34947.0,"Column":3}]},{"RandomW":30194727,"RandomX":539348071,"RandomY":498893216,"RandomZ":1036431212,"StartTime":35131.0,"Objects":[{"StartTime":35131.0,"EndTime":35131.0,"Column":4},{"StartTime":35131.0,"EndTime":35131.0,"Column":5}]},{"RandomW":4140580700,"RandomX":1036431212,"RandomY":30194727,"RandomZ":260312717,"StartTime":35314.0,"Objects":[{"StartTime":35314.0,"EndTime":35496.0,"Column":6}]},{"RandomW":4269364006,"RandomX":30194727,"RandomY":260312717,"RandomZ":4140580700,"StartTime":35680.0,"Objects":[{"StartTime":35680.0,"EndTime":35680.0,"Column":5},{"StartTime":35680.0,"EndTime":35680.0,"Column":6}]},{"RandomW":3052364007,"RandomX":4140580700,"RandomY":4269364006,"RandomZ":2586895690,"StartTime":35863.0,"Objects":[{"StartTime":35863.0,"EndTime":36045.0,"Column":2}]},{"RandomW":575578073,"RandomX":4269364006,"RandomY":2586895690,"RandomZ":3052364007,"StartTime":36228.0,"Objects":[{"StartTime":36228.0,"EndTime":36228.0,"Column":4}]},{"RandomW":379197653,"RandomX":2586895690,"RandomY":3052364007,"RandomZ":575578073,"StartTime":36411.0,"Objects":[{"StartTime":36411.0,"EndTime":36411.0,"Column":3}]},{"RandomW":2472409868,"RandomX":379197653,"RandomY":194885113,"RandomZ":3317367861,"StartTime":36594.0,"Objects":[{"StartTime":36594.0,"EndTime":36776.0,"Column":1}]},{"RandomW":3530386304,"RandomX":1439106306,"RandomY":3004383294,"RandomZ":2928959685,"StartTime":36960.0,"Objects":[{"StartTime":36960.0,"EndTime":36960.0,"Column":1},{"StartTime":36960.0,"EndTime":36960.0,"Column":5},{"StartTime":37142.0,"EndTime":37142.0,"Column":2},{"StartTime":37142.0,"EndTime":37142.0,"Column":6},{"StartTime":37324.0,"EndTime":37324.0,"Column":2},{"StartTime":37324.0,"EndTime":37324.0,"Column":6}]},{"RandomW":3220147162,"RandomX":3004383294,"RandomY":2928959685,"RandomZ":3530386304,"StartTime":37509.0,"Objects":[{"StartTime":37509.0,"EndTime":37509.0,"Column":2}]},{"RandomW":2530492073,"RandomX":2928959685,"RandomY":3530386304,"RandomZ":3220147162,"StartTime":37692.0,"Objects":[{"StartTime":37692.0,"EndTime":37692.0,"Column":1}]},{"RandomW":2605446910,"RandomX":3530386304,"RandomY":3220147162,"RandomZ":2530492073,"StartTime":37875.0,"Objects":[{"StartTime":37875.0,"EndTime":37875.0,"Column":2}]},{"RandomW":3786494373,"RandomX":2530492073,"RandomY":2605446910,"RandomZ":583253884,"StartTime":38058.0,"Objects":[{"StartTime":38058.0,"EndTime":38240.0,"Column":5}]},{"RandomW":1188028287,"RandomX":3601275468,"RandomY":312474208,"RandomZ":764976912,"StartTime":38424.0,"Objects":[{"StartTime":38424.0,"EndTime":38424.0,"Column":4},{"StartTime":38424.0,"EndTime":38424.0,"Column":2},{"StartTime":38606.0,"EndTime":38606.0,"Column":1},{"StartTime":38606.0,"EndTime":38606.0,"Column":5},{"StartTime":38788.0,"EndTime":38788.0,"Column":2},{"StartTime":38788.0,"EndTime":38788.0,"Column":6}]},{"RandomW":2824132752,"RandomX":312474208,"RandomY":764976912,"RandomZ":1188028287,"StartTime":38972.0,"Objects":[{"StartTime":38972.0,"EndTime":38972.0,"Column":3}]},{"RandomW":1173715712,"RandomX":764976912,"RandomY":1188028287,"RandomZ":2824132752,"StartTime":39155.0,"Objects":[{"StartTime":39155.0,"EndTime":39155.0,"Column":4}]},{"RandomW":2490370662,"RandomX":2824132752,"RandomY":1173715712,"RandomZ":2893810865,"StartTime":39338.0,"Objects":[{"StartTime":39338.0,"EndTime":39520.0,"Column":1}]},{"RandomW":1949144326,"RandomX":2893810865,"RandomY":2490370662,"RandomZ":2599342112,"StartTime":39704.0,"Objects":[{"StartTime":39704.0,"EndTime":40069.0,"Column":6}]},{"RandomW":743381221,"RandomX":2599342112,"RandomY":1949144326,"RandomZ":947390134,"StartTime":40253.0,"Objects":[{"StartTime":40253.0,"EndTime":40435.0,"Column":2}]},{"RandomW":3629226534,"RandomX":947390134,"RandomY":743381221,"RandomZ":3234636444,"StartTime":40619.0,"Objects":[{"StartTime":40619.0,"EndTime":40984.0,"Column":4}]},{"RandomW":551844396,"RandomX":743381221,"RandomY":3234636444,"RandomZ":3629226534,"StartTime":41167.0,"Objects":[{"StartTime":41167.0,"EndTime":41167.0,"Column":3}]},{"RandomW":2240897560,"RandomX":551844396,"RandomY":1949877989,"RandomZ":3510981308,"StartTime":41350.0,"Objects":[{"StartTime":41350.0,"EndTime":41532.0,"Column":4},{"StartTime":41350.0,"EndTime":41532.0,"Column":0}]},{"RandomW":874163267,"RandomX":3510981308,"RandomY":2240897560,"RandomZ":2259115420,"StartTime":41716.0,"Objects":[{"StartTime":41716.0,"EndTime":41898.0,"Column":2}]},{"RandomW":3476146382,"RandomX":2240897560,"RandomY":2259115420,"RandomZ":874163267,"StartTime":42082.0,"Objects":[{"StartTime":42082.0,"EndTime":42082.0,"Column":4}]},{"RandomW":2101943428,"RandomX":874163267,"RandomY":3476146382,"RandomZ":3250516626,"StartTime":42265.0,"Objects":[{"StartTime":42265.0,"EndTime":42447.0,"Column":6}]},{"RandomW":2630934490,"RandomX":3476146382,"RandomY":3250516626,"RandomZ":2101943428,"StartTime":42631.0,"Objects":[{"StartTime":42631.0,"EndTime":42631.0,"Column":4}]},{"RandomW":3294029476,"RandomX":3722838838,"RandomY":3959050362,"RandomZ":3731020989,"StartTime":42814.0,"Objects":[{"StartTime":42814.0,"EndTime":42814.0,"Column":6},{"StartTime":42814.0,"EndTime":42814.0,"Column":4},{"StartTime":42996.0,"EndTime":42996.0,"Column":5},{"StartTime":42996.0,"EndTime":42996.0,"Column":3},{"StartTime":43178.0,"EndTime":43178.0,"Column":5},{"StartTime":43178.0,"EndTime":43178.0,"Column":3}]},{"RandomW":692368043,"RandomX":3959050362,"RandomY":3731020989,"RandomZ":3294029476,"StartTime":43363.0,"Objects":[{"StartTime":43363.0,"EndTime":43363.0,"Column":5}]},{"RandomW":268717689,"RandomX":3731020989,"RandomY":3294029476,"RandomZ":692368043,"StartTime":43546.0,"Objects":[{"StartTime":43546.0,"EndTime":43546.0,"Column":4}]},{"RandomW":3628859376,"RandomX":3294029476,"RandomY":692368043,"RandomZ":268717689,"StartTime":43728.0,"Objects":[{"StartTime":43728.0,"EndTime":43728.0,"Column":3}]},{"RandomW":2810605489,"RandomX":268717689,"RandomY":3628859376,"RandomZ":2874884507,"StartTime":43911.0,"Objects":[{"StartTime":43911.0,"EndTime":44093.0,"Column":2}]},{"RandomW":317739913,"RandomX":2874884507,"RandomY":2810605489,"RandomZ":2512620222,"StartTime":44277.0,"Objects":[{"StartTime":44277.0,"EndTime":44459.0,"Column":1}]},{"RandomW":967116709,"RandomX":4156133369,"RandomY":2124840394,"RandomZ":3998877068,"StartTime":44643.0,"Objects":[{"StartTime":44643.0,"EndTime":44825.0,"Column":6},{"StartTime":44643.0,"EndTime":44825.0,"Column":3}]},{"RandomW":1331553411,"RandomX":3998877068,"RandomY":967116709,"RandomZ":39354671,"StartTime":45009.0,"Objects":[{"StartTime":45009.0,"EndTime":45374.0,"Column":4}]},{"RandomW":2785797100,"RandomX":1331553411,"RandomY":1897266817,"RandomZ":1620854569,"StartTime":45558.0,"Objects":[{"StartTime":45558.0,"EndTime":45923.0,"Column":5},{"StartTime":45558.0,"EndTime":45923.0,"Column":2}]},{"RandomW":114455122,"RandomX":1897266817,"RandomY":1620854569,"RandomZ":2785797100,"StartTime":46106.0,"Objects":[{"StartTime":46106.0,"EndTime":46106.0,"Column":3},{"StartTime":46106.0,"EndTime":46106.0,"Column":4}]},{"RandomW":3639436799,"RandomX":1620854569,"RandomY":2785797100,"RandomZ":114455122,"StartTime":46289.0,"Objects":[{"StartTime":46289.0,"EndTime":46289.0,"Column":4}]},{"RandomW":2239997850,"RandomX":1523242180,"RandomY":2737260786,"RandomZ":921894438,"StartTime":46472.0,"Objects":[{"StartTime":46472.0,"EndTime":46472.0,"Column":5},{"StartTime":46472.0,"EndTime":46472.0,"Column":3},{"StartTime":46654.0,"EndTime":46654.0,"Column":1},{"StartTime":46654.0,"EndTime":46654.0,"Column":5},{"StartTime":46836.0,"EndTime":46836.0,"Column":3},{"StartTime":46836.0,"EndTime":46836.0,"Column":1}]},{"RandomW":270173708,"RandomX":921894438,"RandomY":2239997850,"RandomZ":2313367322,"StartTime":47021.0,"Objects":[{"StartTime":47021.0,"EndTime":47386.0,"Column":0}]},{"RandomW":2981644775,"RandomX":2239997850,"RandomY":2313367322,"RandomZ":270173708,"StartTime":47570.0,"Objects":[{"StartTime":47570.0,"EndTime":47570.0,"Column":5}]},{"RandomW":698324797,"RandomX":2313367322,"RandomY":270173708,"RandomZ":2981644775,"StartTime":47936.0,"Objects":[{"StartTime":47936.0,"EndTime":47936.0,"Column":2}]},{"RandomW":2105158963,"RandomX":2981644775,"RandomY":698324797,"RandomZ":3113547499,"StartTime":48119.0,"Objects":[{"StartTime":48119.0,"EndTime":48667.0,"Column":6}]},{"RandomW":3675126935,"RandomX":3113547499,"RandomY":2105158963,"RandomZ":251569162,"StartTime":48850.0,"Objects":[{"StartTime":48850.0,"EndTime":49398.0,"Column":4}]},{"RandomW":1771033747,"RandomX":251569162,"RandomY":3675126935,"RandomZ":3308284595,"StartTime":49582.0,"Objects":[{"StartTime":49582.0,"EndTime":50130.0,"Column":5}]},{"RandomW":653741274,"RandomX":3308284595,"RandomY":1771033747,"RandomZ":2460676956,"StartTime":50314.0,"Objects":[{"StartTime":50314.0,"EndTime":50862.0,"Column":2}]},{"RandomW":3908591175,"RandomX":2011739264,"RandomY":2988284210,"RandomZ":772833847,"StartTime":51046.0,"Objects":[{"StartTime":51046.0,"EndTime":51594.0,"Column":6},{"StartTime":51046.0,"EndTime":51594.0,"Column":5}]},{"RandomW":782718603,"RandomX":3908591175,"RandomY":3666262892,"RandomZ":2215410951,"StartTime":51777.0,"Objects":[{"StartTime":51777.0,"EndTime":51959.0,"Column":0},{"StartTime":51777.0,"EndTime":51959.0,"Column":2}]},{"RandomW":3946166617,"RandomX":2215410951,"RandomY":782718603,"RandomZ":75972478,"StartTime":52143.0,"Objects":[{"StartTime":52143.0,"EndTime":52508.0,"Column":5}]},{"RandomW":204866941,"RandomX":782718603,"RandomY":75972478,"RandomZ":3946166617,"StartTime":52692.0,"Objects":[{"StartTime":52692.0,"EndTime":52692.0,"Column":3},{"StartTime":52692.0,"EndTime":52692.0,"Column":4}]},{"RandomW":628140489,"RandomX":3946166617,"RandomY":204866941,"RandomZ":405870974,"StartTime":52875.0,"Objects":[{"StartTime":52875.0,"EndTime":53240.0,"Column":2}]},{"RandomW":1325586396,"RandomX":628140489,"RandomY":1674126159,"RandomZ":3748192166,"StartTime":53424.0,"Objects":[{"StartTime":53424.0,"EndTime":53606.0,"Column":5},{"StartTime":53424.0,"EndTime":53606.0,"Column":4}]},{"RandomW":3311768819,"RandomX":3748192166,"RandomY":1325586396,"RandomZ":4019978516,"StartTime":53789.0,"Objects":[{"StartTime":53789.0,"EndTime":53789.0,"Column":4},{"StartTime":53789.0,"EndTime":53789.0,"Column":3}]},{"RandomW":1550448150,"RandomX":1325586396,"RandomY":4019978516,"RandomZ":3311768819,"StartTime":53972.0,"Objects":[{"StartTime":53972.0,"EndTime":53972.0,"Column":5}]},{"RandomW":169296756,"RandomX":3311768819,"RandomY":1550448150,"RandomZ":93091440,"StartTime":54155.0,"Objects":[{"StartTime":54155.0,"EndTime":54337.0,"Column":0}]},{"RandomW":2528106598,"RandomX":169296756,"RandomY":3812396233,"RandomZ":4042657790,"StartTime":54521.0,"Objects":[{"StartTime":54521.0,"EndTime":54703.0,"Column":6},{"StartTime":54521.0,"EndTime":54703.0,"Column":1}]},{"RandomW":1636289987,"RandomX":2528106598,"RandomY":638788900,"RandomZ":558809067,"StartTime":54887.0,"Objects":[{"StartTime":54887.0,"EndTime":55069.0,"Column":5}]},{"RandomW":914779004,"RandomX":558809067,"RandomY":1636289987,"RandomZ":2298692989,"StartTime":55253.0,"Objects":[{"StartTime":55253.0,"EndTime":55618.0,"Column":2}]},{"RandomW":1650670496,"RandomX":1636289987,"RandomY":2298692989,"RandomZ":914779004,"StartTime":55802.0,"Objects":[{"StartTime":55802.0,"EndTime":55802.0,"Column":2}]},{"RandomW":3497220679,"RandomX":1037372410,"RandomY":2926479760,"RandomZ":2880883370,"StartTime":55985.0,"Objects":[{"StartTime":55985.0,"EndTime":56350.0,"Column":4}]},{"RandomW":1164710248,"RandomX":2926479760,"RandomY":2880883370,"RandomZ":3497220679,"StartTime":56533.0,"Objects":[{"StartTime":56533.0,"EndTime":56533.0,"Column":5}]},{"RandomW":2188007582,"RandomX":3497220679,"RandomY":1164710248,"RandomZ":2677289564,"StartTime":56716.0,"Objects":[{"StartTime":56716.0,"EndTime":57081.0,"Column":0}]},{"RandomW":3363933174,"RandomX":1164710248,"RandomY":2677289564,"RandomZ":2188007582,"StartTime":57265.0,"Objects":[{"StartTime":57265.0,"EndTime":57265.0,"Column":3}]},{"RandomW":50721184,"RandomX":3363933174,"RandomY":3980600543,"RandomZ":3548114425,"StartTime":57448.0,"Objects":[{"StartTime":57448.0,"EndTime":57630.0,"Column":4},{"StartTime":57448.0,"EndTime":57630.0,"Column":0}]},{"RandomW":864990701,"RandomX":3548114425,"RandomY":50721184,"RandomZ":3340702733,"StartTime":57814.0,"Objects":[{"StartTime":57814.0,"EndTime":57996.0,"Column":2}]},{"RandomW":322108643,"RandomX":3340702733,"RandomY":864990701,"RandomZ":1066828352,"StartTime":58180.0,"Objects":[{"StartTime":58180.0,"EndTime":58362.0,"Column":1}]},{"RandomW":1792394322,"RandomX":1066828352,"RandomY":322108643,"RandomZ":749878772,"StartTime":58546.0,"Objects":[{"StartTime":58546.0,"EndTime":58728.0,"Column":5}]},{"RandomW":475567653,"RandomX":3789213642,"RandomY":1703666422,"RandomZ":3630902830,"StartTime":58911.0,"Objects":[{"StartTime":58911.0,"EndTime":59093.0,"Column":4},{"StartTime":58911.0,"EndTime":59093.0,"Column":1}]},{"RandomW":292381990,"RandomX":3630902830,"RandomY":475567653,"RandomZ":734768891,"StartTime":59277.0,"Objects":[{"StartTime":59277.0,"EndTime":59459.0,"Column":0}]},{"RandomW":1221027582,"RandomX":734768891,"RandomY":292381990,"RandomZ":2432050043,"StartTime":59643.0,"Objects":[{"StartTime":59643.0,"EndTime":60008.0,"Column":3}]},{"RandomW":1041081707,"RandomX":292381990,"RandomY":2432050043,"RandomZ":1221027582,"StartTime":60192.0,"Objects":[{"StartTime":60192.0,"EndTime":60192.0,"Column":0}]},{"RandomW":1144239065,"RandomX":2432050043,"RandomY":1221027582,"RandomZ":1041081707,"StartTime":60375.0,"Objects":[{"StartTime":60375.0,"EndTime":60375.0,"Column":1}]},{"RandomW":1711255007,"RandomX":1221027582,"RandomY":1041081707,"RandomZ":1144239065,"StartTime":60558.0,"Objects":[{"StartTime":60558.0,"EndTime":60558.0,"Column":2},{"StartTime":60558.0,"EndTime":60558.0,"Column":3}]},{"RandomW":377276168,"RandomX":1041081707,"RandomY":1144239065,"RandomZ":1711255007,"StartTime":60649.0,"Objects":[{"StartTime":60649.0,"EndTime":60649.0,"Column":1}]},{"RandomW":377276168,"RandomX":1041081707,"RandomY":1144239065,"RandomZ":1711255007,"StartTime":60741.0,"Objects":[{"StartTime":60741.0,"EndTime":60741.0,"Column":2}]},{"RandomW":1158225489,"RandomX":1144239065,"RandomY":1711255007,"RandomZ":377276168,"StartTime":60924.0,"Objects":[{"StartTime":60924.0,"EndTime":60924.0,"Column":3}]},{"RandomW":74717015,"RandomX":377276168,"RandomY":1158225489,"RandomZ":2625486930,"StartTime":61106.0,"Objects":[{"StartTime":61106.0,"EndTime":61288.0,"Column":0}]},{"RandomW":4106277974,"RandomX":1158225489,"RandomY":2625486930,"RandomZ":74717015,"StartTime":61472.0,"Objects":[{"StartTime":61472.0,"EndTime":61472.0,"Column":2},{"StartTime":61472.0,"EndTime":61472.0,"Column":3}]},{"RandomW":3720471658,"RandomX":4181108489,"RandomY":2335938349,"RandomZ":793896882,"StartTime":61655.0,"Objects":[{"StartTime":61655.0,"EndTime":61655.0,"Column":6},{"StartTime":61746.0,"EndTime":61746.0,"Column":0},{"StartTime":61837.0,"EndTime":61837.0,"Column":2}]},{"RandomW":3031050452,"RandomX":2441289268,"RandomY":3327554006,"RandomZ":1721397977,"StartTime":62021.0,"Objects":[{"StartTime":62021.0,"EndTime":62021.0,"Column":0},{"StartTime":62112.0,"EndTime":62112.0,"Column":3},{"StartTime":62203.0,"EndTime":62203.0,"Column":5}]},{"RandomW":1028780747,"RandomX":3327554006,"RandomY":1721397977,"RandomZ":3031050452,"StartTime":62387.0,"Objects":[{"StartTime":62387.0,"EndTime":62387.0,"Column":1}]},{"RandomW":4249178890,"RandomX":3031050452,"RandomY":1028780747,"RandomZ":1224535158,"StartTime":62570.0,"Objects":[{"StartTime":62570.0,"EndTime":62935.0,"Column":6}]},{"RandomW":407644414,"RandomX":1028780747,"RandomY":1224535158,"RandomZ":4249178890,"StartTime":63119.0,"Objects":[{"StartTime":63119.0,"EndTime":63119.0,"Column":4}]},{"RandomW":84513019,"RandomX":4249178890,"RandomY":407644414,"RandomZ":2855880342,"StartTime":63302.0,"Objects":[{"StartTime":63302.0,"EndTime":63667.0,"Column":0}]},{"RandomW":2876344117,"RandomX":2855880342,"RandomY":84513019,"RandomZ":3523432019,"StartTime":63850.0,"Objects":[{"StartTime":63850.0,"EndTime":63850.0,"Column":5},{"StartTime":63850.0,"EndTime":63850.0,"Column":2}]},{"RandomW":1247936821,"RandomX":2876344117,"RandomY":3407636795,"RandomZ":2195437291,"StartTime":64033.0,"Objects":[{"StartTime":64033.0,"EndTime":64033.0,"Column":1},{"StartTime":64033.0,"EndTime":64033.0,"Column":5}]},{"RandomW":1165002312,"RandomX":2195437291,"RandomY":1247936821,"RandomZ":1829597027,"StartTime":64216.0,"Objects":[{"StartTime":64216.0,"EndTime":64216.0,"Column":6},{"StartTime":64216.0,"EndTime":64216.0,"Column":3}]},{"RandomW":440601827,"RandomX":1247936821,"RandomY":1829597027,"RandomZ":1165002312,"StartTime":64399.0,"Objects":[{"StartTime":64399.0,"EndTime":64399.0,"Column":6},{"StartTime":64399.0,"EndTime":64399.0,"Column":0}]},{"RandomW":1174586413,"RandomX":1165002312,"RandomY":440601827,"RandomZ":1081265463,"StartTime":64582.0,"Objects":[{"StartTime":64582.0,"EndTime":64947.0,"Column":3}]},{"RandomW":1399461522,"RandomX":1174586413,"RandomY":2273396835,"RandomZ":2242340964,"StartTime":65131.0,"Objects":[{"StartTime":65131.0,"EndTime":65313.0,"Column":0},{"StartTime":65131.0,"EndTime":65313.0,"Column":4}]},{"RandomW":806141128,"RandomX":1399461522,"RandomY":52007806,"RandomZ":2388001070,"StartTime":65497.0,"Objects":[{"StartTime":65497.0,"EndTime":65862.0,"Column":2}]},{"RandomW":869393117,"RandomX":52007806,"RandomY":2388001070,"RandomZ":806141128,"StartTime":66046.0,"Objects":[{"StartTime":66046.0,"EndTime":66046.0,"Column":2}]},{"RandomW":2114055664,"RandomX":932480042,"RandomY":484530218,"RandomZ":2599754617,"StartTime":66228.0,"Objects":[{"StartTime":66228.0,"EndTime":66593.0,"Column":3},{"StartTime":66228.0,"EndTime":66593.0,"Column":1},{"StartTime":66228.0,"EndTime":66593.0,"Column":6}]},{"RandomW":4212241992,"RandomX":2599754617,"RandomY":2114055664,"RandomZ":3978789838,"StartTime":66777.0,"Objects":[{"StartTime":66777.0,"EndTime":66777.0,"Column":0},{"StartTime":66777.0,"EndTime":66777.0,"Column":6}]},{"RandomW":1778029315,"RandomX":4212241992,"RandomY":3373094016,"RandomZ":3088207420,"StartTime":66960.0,"Objects":[{"StartTime":66960.0,"EndTime":67142.0,"Column":3},{"StartTime":66960.0,"EndTime":67142.0,"Column":5}]},{"RandomW":523225986,"RandomX":3373094016,"RandomY":3088207420,"RandomZ":1778029315,"StartTime":67326.0,"Objects":[{"StartTime":67326.0,"EndTime":67326.0,"Column":2},{"StartTime":67326.0,"EndTime":67326.0,"Column":3}]},{"RandomW":2523721637,"RandomX":1778029315,"RandomY":523225986,"RandomZ":3156555187,"StartTime":67509.0,"Objects":[{"StartTime":67509.0,"EndTime":67874.0,"Column":1}]},{"RandomW":3753678213,"RandomX":2523721637,"RandomY":733156576,"RandomZ":1252112847,"StartTime":68058.0,"Objects":[{"StartTime":68058.0,"EndTime":68240.0,"Column":4},{"StartTime":68058.0,"EndTime":68240.0,"Column":5}]},{"RandomW":765988363,"RandomX":2650496303,"RandomY":3671318686,"RandomZ":3791148796,"StartTime":68424.0,"Objects":[{"StartTime":68424.0,"EndTime":68789.0,"Column":1},{"StartTime":68424.0,"EndTime":68789.0,"Column":2}]},{"RandomW":1639351583,"RandomX":1794981044,"RandomY":795866725,"RandomZ":201525954,"StartTime":68972.0,"Objects":[{"StartTime":68972.0,"EndTime":69337.0,"Column":0},{"StartTime":68972.0,"EndTime":69337.0,"Column":5}]},{"RandomW":3794603265,"RandomX":795866725,"RandomY":201525954,"RandomZ":1639351583,"StartTime":69521.0,"Objects":[{"StartTime":69521.0,"EndTime":69521.0,"Column":4},{"StartTime":69521.0,"EndTime":69521.0,"Column":5}]},{"RandomW":2799716979,"RandomX":1639351583,"RandomY":3794603265,"RandomZ":2996900863,"StartTime":69704.0,"Objects":[{"StartTime":69704.0,"EndTime":69886.0,"Column":2}]},{"RandomW":1138768260,"RandomX":2799716979,"RandomY":1940635085,"RandomZ":4184142780,"StartTime":70070.0,"Objects":[{"StartTime":70070.0,"EndTime":70252.0,"Column":6},{"StartTime":70070.0,"EndTime":70252.0,"Column":3}]},{"RandomW":3382500543,"RandomX":4184142780,"RandomY":1138768260,"RandomZ":3891744857,"StartTime":70436.0,"Objects":[{"StartTime":70436.0,"EndTime":70436.0,"Column":3},{"StartTime":70436.0,"EndTime":70436.0,"Column":4}]},{"RandomW":665559990,"RandomX":398143267,"RandomY":1440028745,"RandomZ":150863666,"StartTime":70619.0,"Objects":[{"StartTime":70619.0,"EndTime":70984.0,"Column":0},{"StartTime":70619.0,"EndTime":70984.0,"Column":2}]},{"RandomW":340592762,"RandomX":150863666,"RandomY":665559990,"RandomZ":3920056919,"StartTime":71167.0,"Objects":[{"StartTime":71167.0,"EndTime":71167.0,"Column":5},{"StartTime":71167.0,"EndTime":71167.0,"Column":1}]},{"RandomW":1518605551,"RandomX":340592762,"RandomY":4088291758,"RandomZ":2304957054,"StartTime":71350.0,"Objects":[{"StartTime":71350.0,"EndTime":71532.0,"Column":0},{"StartTime":71350.0,"EndTime":71532.0,"Column":4}]},{"RandomW":972812530,"RandomX":1518605551,"RandomY":653707549,"RandomZ":2799009660,"StartTime":71716.0,"Objects":[{"StartTime":71716.0,"EndTime":71898.0,"Column":2},{"StartTime":71716.0,"EndTime":71898.0,"Column":3}]},{"RandomW":3736044692,"RandomX":972812530,"RandomY":1134737486,"RandomZ":3549179654,"StartTime":72082.0,"Objects":[{"StartTime":72082.0,"EndTime":72264.0,"Column":4},{"StartTime":72082.0,"EndTime":72264.0,"Column":5}]},{"RandomW":2646968586,"RandomX":3695561354,"RandomY":2121039538,"RandomZ":3939713463,"StartTime":72448.0,"Objects":[{"StartTime":72448.0,"EndTime":72630.0,"Column":6},{"StartTime":72448.0,"EndTime":72630.0,"Column":1}]},{"RandomW":34357760,"RandomX":2646968586,"RandomY":1864765858,"RandomZ":1923246874,"StartTime":72814.0,"Objects":[{"StartTime":72814.0,"EndTime":72814.0,"Column":0},{"StartTime":72814.0,"EndTime":72814.0,"Column":6}]},{"RandomW":34357760,"RandomX":2646968586,"RandomY":1864765858,"RandomZ":1923246874,"StartTime":72997.0,"Objects":[{"StartTime":72997.0,"EndTime":72997.0,"Column":6},{"StartTime":72997.0,"EndTime":72997.0,"Column":0}]},{"RandomW":3006273170,"RandomX":1864765858,"RandomY":1923246874,"RandomZ":34357760,"StartTime":73363.0,"Objects":[{"StartTime":73363.0,"EndTime":73363.0,"Column":4},{"StartTime":73363.0,"EndTime":73363.0,"Column":5}]},{"RandomW":3978541447,"RandomX":3006273170,"RandomY":3972311639,"RandomZ":2371876462,"StartTime":73728.0,"Objects":[{"StartTime":73728.0,"EndTime":73728.0,"Column":2},{"StartTime":73819.0,"EndTime":73819.0,"Column":5},{"StartTime":73910.0,"EndTime":73910.0,"Column":0}]},{"RandomW":399194528,"RandomX":2371876462,"RandomY":3978541447,"RandomZ":3734283831,"StartTime":74094.0,"Objects":[{"StartTime":74094.0,"EndTime":74094.0,"Column":3},{"StartTime":74094.0,"EndTime":74094.0,"Column":1}]},{"RandomW":2883430810,"RandomX":4002716317,"RandomY":2698819798,"RandomZ":1875619237,"StartTime":74277.0,"Objects":[{"StartTime":74277.0,"EndTime":74642.0,"Column":6},{"StartTime":74277.0,"EndTime":74642.0,"Column":2}]},{"RandomW":3502984571,"RandomX":3789000206,"RandomY":2760409322,"RandomZ":2518464347,"StartTime":74826.0,"Objects":[{"StartTime":74826.0,"EndTime":74826.0,"Column":1},{"StartTime":74826.0,"EndTime":74826.0,"Column":4}]},{"RandomW":2447473462,"RandomX":1834893326,"RandomY":512459921,"RandomZ":2493625006,"StartTime":75009.0,"Objects":[{"StartTime":75009.0,"EndTime":75374.0,"Column":5},{"StartTime":75009.0,"EndTime":75374.0,"Column":0}]},{"RandomW":236980020,"RandomX":512459921,"RandomY":2493625006,"RandomZ":2447473462,"StartTime":75558.0,"Objects":[{"StartTime":75558.0,"EndTime":75558.0,"Column":4}]},{"RandomW":1338160073,"RandomX":236980020,"RandomY":1288545645,"RandomZ":3579861656,"StartTime":75741.0,"Objects":[{"StartTime":75741.0,"EndTime":75741.0,"Column":1},{"StartTime":75741.0,"EndTime":75741.0,"Column":5}]},{"RandomW":1104479394,"RandomX":1288545645,"RandomY":3579861656,"RandomZ":1338160073,"StartTime":75924.0,"Objects":[{"StartTime":75924.0,"EndTime":75924.0,"Column":6}]},{"RandomW":1611802424,"RandomX":3579861656,"RandomY":1338160073,"RandomZ":1104479394,"StartTime":76106.0,"Objects":[{"StartTime":76106.0,"EndTime":76106.0,"Column":5},{"StartTime":76106.0,"EndTime":76106.0,"Column":6}]},{"RandomW":74337788,"RandomX":1611802424,"RandomY":3077637432,"RandomZ":3984045284,"StartTime":76289.0,"Objects":[{"StartTime":76289.0,"EndTime":76654.0,"Column":0}]},{"RandomW":2589155279,"RandomX":74337788,"RandomY":4122247598,"RandomZ":3402826469,"StartTime":76838.0,"Objects":[{"StartTime":76838.0,"EndTime":77020.0,"Column":4},{"StartTime":76838.0,"EndTime":77020.0,"Column":1}]},{"RandomW":4015672441,"RandomX":2589155279,"RandomY":3961839828,"RandomZ":3184309519,"StartTime":77204.0,"Objects":[{"StartTime":77204.0,"EndTime":77569.0,"Column":3},{"StartTime":77204.0,"EndTime":77569.0,"Column":6}]},{"RandomW":605987856,"RandomX":3184309519,"RandomY":4015672441,"RandomZ":4025998202,"StartTime":77753.0,"Objects":[{"StartTime":77753.0,"EndTime":77753.0,"Column":0},{"StartTime":77753.0,"EndTime":77753.0,"Column":1}]},{"RandomW":1497070673,"RandomX":2430309501,"RandomY":1093966930,"RandomZ":2905669028,"StartTime":77936.0,"Objects":[{"StartTime":77936.0,"EndTime":78301.0,"Column":3},{"StartTime":77936.0,"EndTime":78301.0,"Column":2},{"StartTime":77936.0,"EndTime":78301.0,"Column":4}]},{"RandomW":353334135,"RandomX":1093966930,"RandomY":2905669028,"RandomZ":1497070673,"StartTime":78485.0,"Objects":[{"StartTime":78485.0,"EndTime":78485.0,"Column":1}]},{"RandomW":912971684,"RandomX":4030507912,"RandomY":3670783478,"RandomZ":1485865738,"StartTime":78667.0,"Objects":[{"StartTime":78667.0,"EndTime":78849.0,"Column":4},{"StartTime":78667.0,"EndTime":78849.0,"Column":2}]},{"RandomW":589257226,"RandomX":3670783478,"RandomY":1485865738,"RandomZ":912971684,"StartTime":79033.0,"Objects":[{"StartTime":79033.0,"EndTime":79033.0,"Column":3},{"StartTime":79033.0,"EndTime":79033.0,"Column":4}]},{"RandomW":2024304860,"RandomX":912971684,"RandomY":589257226,"RandomZ":2767994778,"StartTime":79216.0,"Objects":[{"StartTime":79216.0,"EndTime":79581.0,"Column":6}]},{"RandomW":2219601613,"RandomX":2024304860,"RandomY":404709274,"RandomZ":3238631833,"StartTime":79765.0,"Objects":[{"StartTime":79765.0,"EndTime":79947.0,"Column":3},{"StartTime":79765.0,"EndTime":79947.0,"Column":0}]},{"RandomW":3490718869,"RandomX":2219601613,"RandomY":3210330120,"RandomZ":1566096374,"StartTime":80131.0,"Objects":[{"StartTime":80131.0,"EndTime":80496.0,"Column":5},{"StartTime":80131.0,"EndTime":80496.0,"Column":4}]},{"RandomW":1189469485,"RandomX":1566096374,"RandomY":3490718869,"RandomZ":936182364,"StartTime":80680.0,"Objects":[{"StartTime":80680.0,"EndTime":81045.0,"Column":3}]},{"RandomW":3740948748,"RandomX":3490718869,"RandomY":936182364,"RandomZ":1189469485,"StartTime":81228.0,"Objects":[{"StartTime":81228.0,"EndTime":81228.0,"Column":5},{"StartTime":81228.0,"EndTime":81228.0,"Column":6}]},{"RandomW":3491747463,"RandomX":1189469485,"RandomY":3740948748,"RandomZ":2409626314,"StartTime":81411.0,"Objects":[{"StartTime":81411.0,"EndTime":81776.0,"Column":4}]},{"RandomW":3095098652,"RandomX":3740948748,"RandomY":2409626314,"RandomZ":3491747463,"StartTime":81960.0,"Objects":[{"StartTime":81960.0,"EndTime":81960.0,"Column":3},{"StartTime":81960.0,"EndTime":81960.0,"Column":4}]},{"RandomW":3024447782,"RandomX":2409626314,"RandomY":3491747463,"RandomZ":3095098652,"StartTime":82143.0,"Objects":[{"StartTime":82143.0,"EndTime":82143.0,"Column":2},{"StartTime":82143.0,"EndTime":82143.0,"Column":3}]},{"RandomW":3942236456,"RandomX":3095098652,"RandomY":3024447782,"RandomZ":3296500942,"StartTime":82326.0,"Objects":[{"StartTime":82326.0,"EndTime":82508.0,"Column":5}]},{"RandomW":912304721,"RandomX":3942236456,"RandomY":2303302398,"RandomZ":383442600,"StartTime":82692.0,"Objects":[{"StartTime":82692.0,"EndTime":82874.0,"Column":1},{"StartTime":82692.0,"EndTime":82874.0,"Column":2}]},{"RandomW":2431170151,"RandomX":3622775798,"RandomY":385908797,"RandomZ":604082862,"StartTime":83058.0,"Objects":[{"StartTime":83058.0,"EndTime":83240.0,"Column":4},{"StartTime":83058.0,"EndTime":83240.0,"Column":0}]},{"RandomW":4088921973,"RandomX":1523770388,"RandomY":1345324755,"RandomZ":2436511051,"StartTime":83424.0,"Objects":[{"StartTime":83424.0,"EndTime":83606.0,"Column":2},{"StartTime":83424.0,"EndTime":83606.0,"Column":6}]},{"RandomW":2663434012,"RandomX":3999189199,"RandomY":2928551970,"RandomZ":3800966865,"StartTime":83789.0,"Objects":[{"StartTime":83789.0,"EndTime":83971.0,"Column":5},{"StartTime":83789.0,"EndTime":83971.0,"Column":1}]},{"RandomW":183339481,"RandomX":3405481532,"RandomY":1385906264,"RandomZ":3611020052,"StartTime":84155.0,"Objects":[{"StartTime":84155.0,"EndTime":84337.0,"Column":4},{"StartTime":84155.0,"EndTime":84337.0,"Column":0}]},{"RandomW":472982750,"RandomX":1385906264,"RandomY":3611020052,"RandomZ":183339481,"StartTime":84521.0,"Objects":[{"StartTime":84521.0,"EndTime":84521.0,"Column":4}]},{"RandomW":2485141120,"RandomX":3611020052,"RandomY":183339481,"RandomZ":472982750,"StartTime":84704.0,"Objects":[{"StartTime":84704.0,"EndTime":84704.0,"Column":5}]},{"RandomW":2638881915,"RandomX":183339481,"RandomY":472982750,"RandomZ":2485141120,"StartTime":84887.0,"Objects":[{"StartTime":84887.0,"EndTime":84887.0,"Column":6},{"StartTime":84887.0,"EndTime":84887.0,"Column":0}]},{"RandomW":2991178386,"RandomX":1846348081,"RandomY":4216122958,"RandomZ":938042528,"StartTime":85070.0,"Objects":[{"StartTime":85070.0,"EndTime":85070.0,"Column":5},{"StartTime":85161.0,"EndTime":85161.0,"Column":6},{"StartTime":85252.0,"EndTime":85252.0,"Column":3}]},{"RandomW":2830634920,"RandomX":3020624235,"RandomY":682207034,"RandomZ":1410927339,"StartTime":85436.0,"Objects":[{"StartTime":85436.0,"EndTime":85436.0,"Column":4},{"StartTime":85527.0,"EndTime":85527.0,"Column":2},{"StartTime":85618.0,"EndTime":85618.0,"Column":4}]},{"RandomW":1154798493,"RandomX":682207034,"RandomY":1410927339,"RandomZ":2830634920,"StartTime":85802.0,"Objects":[{"StartTime":85802.0,"EndTime":85802.0,"Column":3}]},{"RandomW":3579754894,"RandomX":1154798493,"RandomY":555826250,"RandomZ":3186828503,"StartTime":85985.0,"Objects":[{"StartTime":85985.0,"EndTime":86167.0,"Column":4}]},{"RandomW":522156379,"RandomX":3186828503,"RandomY":3579754894,"RandomZ":938791043,"StartTime":86350.0,"Objects":[{"StartTime":86350.0,"EndTime":86532.0,"Column":1}]},{"RandomW":2327696617,"RandomX":522156379,"RandomY":1005466611,"RandomZ":459042761,"StartTime":86716.0,"Objects":[{"StartTime":86716.0,"EndTime":86898.0,"Column":0}]},{"RandomW":3698157493,"RandomX":2327696617,"RandomY":1854714180,"RandomZ":615999181,"StartTime":87082.0,"Objects":[{"StartTime":87082.0,"EndTime":87264.0,"Column":2},{"StartTime":87082.0,"EndTime":87264.0,"Column":5}]},{"RandomW":2615638464,"RandomX":3088317005,"RandomY":3005119130,"RandomZ":738255674,"StartTime":87448.0,"Objects":[{"StartTime":87448.0,"EndTime":87448.0,"Column":4},{"StartTime":87448.0,"EndTime":87448.0,"Column":1},{"StartTime":87630.0,"EndTime":87630.0,"Column":2},{"StartTime":87630.0,"EndTime":87630.0,"Column":5},{"StartTime":87812.0,"EndTime":87812.0,"Column":2},{"StartTime":87812.0,"EndTime":87812.0,"Column":5}]},{"RandomW":4236988115,"RandomX":738255674,"RandomY":2615638464,"RandomZ":3154196835,"StartTime":87997.0,"Objects":[{"StartTime":87997.0,"EndTime":88362.0,"Column":6}]},{"RandomW":3260011681,"RandomX":4236988115,"RandomY":3619257163,"RandomZ":1999646981,"StartTime":88546.0,"Objects":[{"StartTime":88546.0,"EndTime":88728.0,"Column":3}]},{"RandomW":1679091693,"RandomX":3619257163,"RandomY":1999646981,"RandomZ":3260011681,"StartTime":88911.0,"Objects":[{"StartTime":88911.0,"EndTime":88911.0,"Column":1},{"StartTime":88911.0,"EndTime":88911.0,"Column":2}]},{"RandomW":4053500035,"RandomX":2020322055,"RandomY":2384790806,"RandomZ":846406319,"StartTime":89277.0,"Objects":[{"StartTime":89277.0,"EndTime":89459.0,"Column":0},{"StartTime":89277.0,"EndTime":89459.0,"Column":6}]},{"RandomW":3656101543,"RandomX":4053500035,"RandomY":3566026276,"RandomZ":1915132950,"StartTime":89643.0,"Objects":[{"StartTime":89643.0,"EndTime":89825.0,"Column":4}]},{"RandomW":3002483376,"RandomX":1234751024,"RandomY":253242681,"RandomZ":2332173547,"StartTime":90009.0,"Objects":[{"StartTime":90009.0,"EndTime":90191.0,"Column":0},{"StartTime":90009.0,"EndTime":90191.0,"Column":2}]},{"RandomW":1769147212,"RandomX":1032909712,"RandomY":4079968510,"RandomZ":1771054860,"StartTime":90375.0,"Objects":[{"StartTime":90375.0,"EndTime":90375.0,"Column":3},{"StartTime":90375.0,"EndTime":90375.0,"Column":6},{"StartTime":90557.0,"EndTime":90557.0,"Column":6},{"StartTime":90557.0,"EndTime":90557.0,"Column":3},{"StartTime":90739.0,"EndTime":90739.0,"Column":5},{"StartTime":90739.0,"EndTime":90739.0,"Column":2}]},{"RandomW":1533402007,"RandomX":1771054860,"RandomY":1769147212,"RandomZ":3552934273,"StartTime":90924.0,"Objects":[{"StartTime":90924.0,"EndTime":91289.0,"Column":4}]},{"RandomW":1123904499,"RandomX":3552934273,"RandomY":1533402007,"RandomZ":3005562800,"StartTime":91472.0,"Objects":[{"StartTime":91472.0,"EndTime":91654.0,"Column":3}]},{"RandomW":3485521641,"RandomX":3005562800,"RandomY":1123904499,"RandomZ":3121355612,"StartTime":91838.0,"Objects":[{"StartTime":91838.0,"EndTime":92203.0,"Column":4}]},{"RandomW":1434626078,"RandomX":1123904499,"RandomY":3121355612,"RandomZ":3485521641,"StartTime":92387.0,"Objects":[{"StartTime":92387.0,"EndTime":92387.0,"Column":4}]},{"RandomW":4013632575,"RandomX":1434626078,"RandomY":4236899246,"RandomZ":646300056,"StartTime":92570.0,"Objects":[{"StartTime":92570.0,"EndTime":92752.0,"Column":2},{"StartTime":92570.0,"EndTime":92752.0,"Column":6}]},{"RandomW":471738692,"RandomX":646300056,"RandomY":4013632575,"RandomZ":2948180894,"StartTime":92936.0,"Objects":[{"StartTime":92936.0,"EndTime":93118.0,"Column":1}]},{"RandomW":1081382077,"RandomX":471738692,"RandomY":346006110,"RandomZ":586362406,"StartTime":93302.0,"Objects":[{"StartTime":93302.0,"EndTime":93302.0,"Column":1},{"StartTime":93302.0,"EndTime":93302.0,"Column":5}]},{"RandomW":1151929163,"RandomX":586362406,"RandomY":1081382077,"RandomZ":2915942910,"StartTime":93485.0,"Objects":[{"StartTime":93485.0,"EndTime":93667.0,"Column":3}]},{"RandomW":3634683246,"RandomX":1151929163,"RandomY":4287668198,"RandomZ":463810005,"StartTime":93850.0,"Objects":[{"StartTime":93850.0,"EndTime":94215.0,"Column":1},{"StartTime":93850.0,"EndTime":94215.0,"Column":4}]},{"RandomW":2941238432,"RandomX":463810005,"RandomY":3634683246,"RandomZ":3562759778,"StartTime":94399.0,"Objects":[{"StartTime":94399.0,"EndTime":94581.0,"Column":2}]},{"RandomW":1661408876,"RandomX":3562759778,"RandomY":2941238432,"RandomZ":2646009625,"StartTime":94765.0,"Objects":[{"StartTime":94765.0,"EndTime":95130.0,"Column":5}]},{"RandomW":3189251976,"RandomX":2646009625,"RandomY":1661408876,"RandomZ":1818231832,"StartTime":95314.0,"Objects":[{"StartTime":95314.0,"EndTime":95314.0,"Column":5},{"StartTime":95314.0,"EndTime":95314.0,"Column":3}]},{"RandomW":2743067846,"RandomX":3189251976,"RandomY":2495392125,"RandomZ":3478354416,"StartTime":95497.0,"Objects":[{"StartTime":95497.0,"EndTime":95497.0,"Column":0},{"StartTime":95497.0,"EndTime":95497.0,"Column":6}]},{"RandomW":2762867836,"RandomX":3722791806,"RandomY":2892228350,"RandomZ":4171994747,"StartTime":95680.0,"Objects":[{"StartTime":95680.0,"EndTime":95680.0,"Column":5},{"StartTime":95680.0,"EndTime":95680.0,"Column":3},{"StartTime":95862.0,"EndTime":95862.0,"Column":2},{"StartTime":95862.0,"EndTime":95862.0,"Column":6},{"StartTime":96044.0,"EndTime":96044.0,"Column":6},{"StartTime":96044.0,"EndTime":96044.0,"Column":4}]},{"RandomW":1153177485,"RandomX":2762867836,"RandomY":1407653164,"RandomZ":3758120376,"StartTime":96228.0,"Objects":[{"StartTime":96228.0,"EndTime":96228.0,"Column":1},{"StartTime":96228.0,"EndTime":96228.0,"Column":5}]},{"RandomW":1153177485,"RandomX":2762867836,"RandomY":1407653164,"RandomZ":3758120376,"StartTime":96411.0,"Objects":[{"StartTime":96411.0,"EndTime":96411.0,"Column":5},{"StartTime":96411.0,"EndTime":96411.0,"Column":1}]},{"RandomW":2430957186,"RandomX":1407653164,"RandomY":3758120376,"RandomZ":1153177485,"StartTime":96777.0,"Objects":[{"StartTime":96777.0,"EndTime":96777.0,"Column":3},{"StartTime":96777.0,"EndTime":96777.0,"Column":4}]},{"RandomW":4223688647,"RandomX":3758120376,"RandomY":1153177485,"RandomZ":2430957186,"StartTime":97143.0,"Objects":[{"StartTime":97143.0,"EndTime":97143.0,"Column":4},{"StartTime":97143.0,"EndTime":97143.0,"Column":5}]},{"RandomW":433008794,"RandomX":1153177485,"RandomY":2430957186,"RandomZ":4223688647,"StartTime":97509.0,"Objects":[{"StartTime":97509.0,"EndTime":97509.0,"Column":5},{"StartTime":97509.0,"EndTime":97509.0,"Column":6}]},{"RandomW":3177925713,"RandomX":2430957186,"RandomY":4223688647,"RandomZ":433008794,"StartTime":97692.0,"Objects":[{"StartTime":97692.0,"EndTime":100619.0,"Column":3}]}]} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162.osu b/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162.osu new file mode 100644 index 0000000000..42669b1516 --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/Resources/Testing/Beatmaps/1450162.osu @@ -0,0 +1,297 @@ +osu file format v14 + +[General] +StackLeniency: 0.7 +Mode: 0 + +[Difficulty] +HPDrainRate:5 +CircleSize:4 +OverallDifficulty:7 +ApproachRate:7.5 +SliderMultiplier:1.4 +SliderTickRate:1 + +[Events] +//Background and Video events +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Sound Samples + +[TimingPoints] +1107,365.853658536585,4,2,1,50,1,0 +1107,-166.666666666667,4,2,1,50,0,0 +6960,-111.111111111111,4,2,1,50,0,0 +8424,-100,4,2,1,50,0,0 +48119,-125,4,2,1,50,0,0 +52143,-100,4,2,1,50,0,0 +62570,-100,4,2,1,60,0,1 +85985,-100,4,2,1,50,0,0 +97692,-100,4,2,1,30,0,0 +99155,-100,4,2,1,20,0,0 +100619,-100,4,2,1,5,0,0 + +[HitObjects] +38,247,1107,6,0,P|96:269|170:192,1,167.999994873047,2|0,0:0|0:0,0:0:0:0: +201,128,2570,6,0,L|205:221,1,83.9999974365235,2|0,0:0|0:0,0:0:0:0: +242,230,3302,2,0,L|234:324,1,83.9999974365235,2|0,0:0|0:0,0:0:0:0: +205,343,4033,6,0,P|246:296|351:314,1,167.999994873047,2|0,0:0|0:0,0:0:0:0: +400,368,5497,6,0,L|412:269,1,83.9999974365235,6|0,0:0|0:0,0:0:0:0: +436,251,6228,2,0,P|425:203|408:153,1,83.9999974365235,2|0,0:0|0:0,0:0:0:0: +304,200,6960,6,0,P|262:186|234:181,1,62.9999980773926,6|0,0:0|0:0,0:0:0:0: +202,179,7326,1,8,0:0:0:0: +276,94,7509,2,0,P|313:92|353:87,1,62.9999980773926,2|0,0:0|0:0,0:0:0:0: +398,31,7875,1,2,0:0:0:0: +464,81,8058,2,0,L|450:150,1,62.9999980773926,2|0,0:0|0:0,0:0:0:0: +449,230,8424,6,0,P|347:206|306:217,1,140,2|8,0:0|0:0,0:0:0:0: +229,273,8972,2,0,P|225:339|235:361,1,70,2|0,0:0|0:0,0:0:0:0: +304,313,9338,1,8,0:0:0:0: +224,190,9521,1,2,0:0:0:0: +296,45,9887,6,0,P|297:97|288:125,1,70,6|0,0:0|0:0,0:0:0:0: +224,190,10253,1,8,0:0:0:0: +167,118,10436,1,8,0:0:0:0: +76,126,10619,1,8,0:0:0:0: +39,209,10802,1,8,0:0:0:0: +93,282,10985,1,10,0:0:0:0: +184,280,11167,1,10,0:0:0:0: +102,136,12814,5,2,0:0:0:0: +102,136,13180,2,0,L|199:130,1,70,8|0,0:0|0:0,0:0:0:0: +256,167,13546,2,0,L|339:161,1,70,8|2,0:0|0:0,0:0:0:0: +408,201,13911,2,0,P|454:176|471:143,1,70,8|2,0:0|0:0,0:0:0:0: +373,54,14277,6,0,L|396:137,2,70,6|0|8,0:0|0:0|0:0,0:0:0:0: +305,111,14826,2,0,L|287:274,1,140,0|2,0:0|0:0,0:0:0:0: +262,337,15375,2,0,L|349:327,1,70,8|2,0:0|0:0,0:0:0:0: +419,354,15741,1,8,0:0:0:0: +477,197,16106,6,0,P|423:197|385:209,1,70,8|0,0:0|0:0,0:0:0:0: +321,170,16472,2,0,P|278:190|253:219,1,70,8|2,0:0|0:0,0:0:0:0: +171,213,16838,2,0,P|152:259|158:304,1,70,8|2,0:0|0:0,0:0:0:0: +305,294,17204,6,0,L|224:278,2,70,6|0|8,0:0|0:0|0:0,0:0:0:0: +310,202,17753,2,0,L|149:214,1,140,0|2,0:0|0:0,0:0:0:0: +84,244,18302,2,0,L|92:152,1,70,8|2,0:0|0:0,0:0:0:0: +47,93,18667,6,0,P|78:53|176:80,1,140,6|8,0:0|0:0,0:0:0:0: +218,130,19216,1,0,0:0:0:0: +299,88,19399,2,0,L|387:91,1,70,8|0,0:0|0:0,0:0:0:0: +458,106,19765,2,0,P|447:139|444:205,1,70,8|0,0:0|0:0,0:0:0:0: +455,274,20131,5,2,0:0:0:0: +366,292,20314,2,0,L|353:211,1,70,0|8,0:0|0:0,0:0:0:0: +277,173,20680,2,0,L|253:342,1,140,0|2,0:0|0:0,0:0:0:0: +322,376,21228,2,0,P|368:368|416:370,1,70,8|2,0:0|0:0,0:0:0:0: +500,287,21594,6,0,P|427:273|362:293,2,140,6|8|8,0:0|0:0|0:0,0:0:0:0: +496,111,22509,1,8,0:0:0:0: +499,189,22692,2,0,L|418:191,1,70,8|2,0:0|0:0,0:0:0:0: +344,164,23058,5,6,0:0:0:0: +344,164,23241,1,12,0:0:0:0: +261,326,23606,2,0,L|246:178,1,140,8|2,0:0|0:0,0:0:0:0: +277,100,24155,2,0,P|225:99|196:109,1,70,8|2,0:0|0:0,0:0:0:0: +165,273,24521,5,6,0:0:0:0: +83,235,24704,2,0,L|93:81,1,140,0|0,0:0|0:0,0:0:0:0: +21,37,25253,2,0,L|1:120,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +110,17,25802,1,0,0:0:0:0: +172,83,25985,5,2,0:0:0:0: +236,19,26167,2,0,P|223:70|227:170,1,140,0|0,0:0|0:0,0:0:0:0: +293,216,26716,2,0,P|316:165|314:134,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +206,245,27265,1,0,0:0:0:0: +274,305,27448,5,2,0:0:0:0: +194,348,27631,2,0,L|363:332,1,140,0|0,0:0|0:0,0:0:0:0: +424,336,28180,1,2,0:0:0:0: +431,245,28363,2,0,P|381:252|354:276,2,70,0|8|0,0:0|0:0|0:0,0:0:0:0: +509,291,28911,6,0,L|496:128,1,140,2|8,0:0|0:0,0:0:0:0: +504,60,29460,1,0,0:0:0:0: +417,34,29643,2,0,L|402:183,1,140,2|8,0:0|0:0,0:0:0:0: +365,262,30192,1,0,0:0:0:0: +295,202,30375,5,2,0:0:0:0: +309,112,30558,2,0,P|282:172|196:176,1,140,0|0,0:0|0:0,0:0:0:0: +148,120,31106,2,0,P|189:99|225:99,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +129,209,31655,1,0,0:0:0:0: +63,146,31838,5,2,0:0:0:0: +16,67,32021,2,0,L|27:220,1,140,0|0,0:0|0:0,0:0:0:0: +23,297,32570,2,0,P|81:286|111:290,1,70,2|0,0:0|0:0,0:0:0:0: +173,327,32936,1,8,0:0:0:0: +338,251,33302,6,0,P|268:254|227:199,1,140,2|8,0:0|0:0,0:0:0:0: +203,114,33850,2,0,L|185:262,1,140,0|0,0:0|0:0,0:0:0:0: +244,323,34399,1,8,0:0:0:0: +334,335,34582,1,0,0:0:0:0: +419,219,34765,6,0,L|410:304,1,70,2|0,0:0|0:0,0:0:0:0: +338,251,35131,1,8,0:0:0:0: +301,111,35314,2,0,L|301:190,1,70,6|0,0:0|0:0,0:0:0:0: +383,141,35680,1,8,0:0:0:0: +462,97,35863,2,0,P|427:64|393:54,1,70,2|0,0:0|0:0,0:0:0:0: +321,23,36228,5,2,0:0:0:0: +237,60,36411,1,0,0:0:0:0: +148,38,36594,2,0,P|107:33|56:43,1,70,8|0,0:0|0:0,0:0:0:0: +86,125,36960,2,0,P|51:125|17:117,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +175,123,37509,1,0,0:0:0:0: +129,201,37692,5,2,0:0:0:0: +198,259,37875,1,0,0:0:0:0: +205,349,38058,2,0,P|251:330|284:326,1,70,8|0,0:0|0:0,0:0:0:0: +352,285,38424,2,0,P|361:318|357:353,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +282,239,38972,1,0,0:0:0:0: +362,195,39155,5,2,0:0:0:0: +436,142,39338,2,0,P|398:115|354:112,1,70,0|8,0:0|0:0,0:0:0:0: +286,92,39704,2,0,L|451:74,1,140,0|0,0:0|0:0,0:0:0:0: +512,118,40253,2,0,L|494:198,1,70,8|0,0:0|0:0,0:0:0:0: +430,297,40619,6,0,P|423:236|336:195,1,140,2|8,0:0|0:0,0:0:0:0: +282,239,41167,1,0,0:0:0:0: +209,184,41350,2,0,L|222:112,1,70,2|2,0:0|0:0,0:0:0:0: +177,34,41716,2,0,P|230:26|269:38,1,70,8|0,0:0|0:0,0:0:0:0: +307,95,42082,5,2,0:0:0:0: +363,23,42265,2,0,L|359:114,1,70,0|8,0:0|0:0,0:0:0:0: +360,184,42631,1,0,0:0:0:0: +450,191,42814,2,0,P|443:145|424:119,2,70,2|0|8,0:0|0:0|0:0,0:0:0:0: +393,263,43363,1,0,0:0:0:0: +304,242,43546,5,2,0:0:0:0: +241,308,43728,1,0,0:0:0:0: +167,256,43911,2,0,P|205:228|245:226,1,70,8|0,0:0|0:0,0:0:0:0: +166,341,44277,2,0,P|118:325|90:289,1,70,2|0,0:0|0:0,0:0:0:0: +125,177,44643,2,0,P|168:152|201:153,1,70,8|0,0:0|0:0,0:0:0:0: +276,132,45009,6,0,L|119:105,1,140,2|8,0:0|0:0,0:0:0:0: +52,74,45558,2,0,L|210:57,1,140,2|0,0:0|0:0,0:0:0:0: +277,28,46106,1,8,0:0:0:0: +349,82,46289,1,0,0:0:0:0: +425,32,46472,6,0,L|451:110,2,70,6|2|8,0:0|0:0|0:0,0:0:0:0: +349,82,47021,2,0,L|344:235,1,140,2|8,0:0|0:0,0:0:0:0: +372,308,47570,1,2,0:0:0:0: +170,324,47936,5,2,0:0:0:0: +99,286,48119,2,0,L|112:112,1,168,2|2,0:0|0:0,0:0:0:0: +64,48,48850,2,0,P|125:36|195:111,1,168,2|2,0:0|0:0,0:0:0:0: +199,189,49582,6,0,L|369:166,1,168,2|2,0:0|0:0,0:0:0:0: +413,97,50314,2,0,P|390:180|377:274,1,168,2|2,0:0|0:0,0:0:0:0: +347,339,51046,6,0,P|424:333|463:251,1,168,2|2,0:0|0:0,0:0:0:0: +473,175,51777,2,0,L|477:105,1,56,2|2,0:0|0:0,0:0:0:0: +446,24,52143,6,0,P|363:22|308:82,1,140,12|2,0:0|0:0,0:0:0:0: +282,138,52692,1,8,0:0:0:0: +193,118,52875,2,0,L|213:281,1,140,2|8,0:0|0:0,0:0:0:0: +225,347,53424,2,0,P|268:328|286:301,1,70,2|0,0:0|0:0,0:0:0:0: +304,222,53789,5,2,0:0:0:0: +385,263,53972,1,0,0:0:0:0: +462,214,54155,2,0,P|421:185|383:179,1,70,8|0,0:0|0:0,0:0:0:0: +322,136,54521,2,0,P|360:105|400:93,1,70,2|0,0:0|0:0,0:0:0:0: +469,107,54887,2,0,L|483:24,1,70,8|0,0:0|0:0,0:0:0:0: +390,22,55253,6,0,L|223:30,1,140,2|8,0:0|0:0,0:0:0:0: +180,87,55802,1,0,0:0:0:0: +230,162,55985,2,0,L|391:154,1,140,2|8,0:0|0:0,0:0:0:0: +430,223,56533,1,0,0:0:0:0: +407,311,56716,6,0,P|356:347|285:307,1,140,2|8,0:0|0:0,0:0:0:0: +236,245,57265,1,0,0:0:0:0: +145,237,57448,2,0,L|162:316,1,70,2|0,0:0|0:0,0:0:0:0: +233,360,57814,6,0,P|185:349|142:350,1,70,8|0,0:0|0:0,0:0:0:0: +11,311,58180,2,0,P|64:302|104:306,1,70,2|0,0:0|0:0,0:0:0:0: +213,248,58546,2,0,P|162:237|130:237,1,70,8|0,0:0|0:0,0:0:0:0: +1,194,58911,2,0,P|47:183|74:185,1,70,2|0,0:0|0:0,0:0:0:0: +234,142,59277,2,0,P|175:129|152:128,1,70,8|0,0:0|0:0,0:0:0:0: +12,26,59643,6,0,P|66:38|71:140,1,140,2|8,0:0|0:0,0:0:0:0: +1,194,60192,1,0,0:0:0:0: +84,230,60375,1,2,0:0:0:0: +173,216,60558,1,8,0:0:0:0: +173,216,60649,1,8,0:0:0:0: +173,216,60741,1,8,0:0:0:0: +263,213,60924,1,2,0:0:0:0: +345,174,61106,6,0,P|320:144|286:130,1,70,2|0,0:0|0:0,0:0:0:0: +200,134,61472,1,8,0:0:0:0: +249,57,61655,2,0,L|263:12,2,35,12|8|8,0:0|0:0|0:0,0:0:0:0: +157,64,62021,2,0,L|153:13,2,35,12|8|8,0:0|0:0|0:0,0:0:0:0: +118,150,62387,1,2,0:0:0:0: +101,260,62570,6,0,P|207:236|257:243,1,140,2|8,0:0|0:0,0:0:0:0: +328,304,63119,1,0,0:0:0:0: +434,156,63302,2,0,P|373:157|329:217,1,140,2|8,0:0|0:0,0:0:0:0: +408,230,63850,1,2,0:0:0:0: +483,215,64033,5,6,0:0:0:0: +508,142,64216,1,0,0:0:0:0: +482,69,64399,1,8,0:0:0:0: +413,34,64582,2,0,P|336:30|256:49,1,140,0|2,0:0|0:0,0:0:0:0: +150,97,65131,2,0,P|190:97|243:107,1,70,8|2,0:0|0:0,0:0:0:0: +257,168,65497,6,0,L|225:323,1,140,2|8,0:0|0:0,0:0:0:0: +155,329,66046,1,0,0:0:0:0: +20,204,66228,2,0,P|92:202|133:271,1,140,8|8,0:0|0:0,0:0:0:0: +56,274,66777,1,2,0:0:0:0: +18,125,66960,6,0,L|93:119,1,70,6|0,0:0|0:0,0:0:0:0: +162,156,67326,1,8,0:0:0:0: +223,52,67509,2,0,L|227:219,1,140,0|2,0:0|0:0,0:0:0:0: +266,263,68058,2,0,P|300:229|308:199,1,70,8|2,0:0|0:0,0:0:0:0: +298,95,68424,6,0,L|458:75,1,140,6|8,0:0|0:0,0:0:0:0: +512,164,68972,2,0,L|358:154,1,140,0|2,0:0|0:0,0:0:0:0: +306,209,69521,1,8,0:0:0:0: +342,334,69704,6,0,P|361:289|369:244,1,70,2|6,0:0|0:0,0:0:0:0: +250,277,70070,2,0,P|223:228|219:186,1,70,0|8,0:0|0:0,0:0:0:0: +272,128,70436,1,0,0:0:0:0: +172,111,70619,2,0,L|343:97,1,140,8|8,0:0|0:0,0:0:0:0: +385,128,71167,1,2,0:0:0:0: +494,63,71350,6,0,L|413:54,1,70,6|0,0:0|0:0,0:0:0:0: +385,128,71716,2,0,L|475:140,1,70,8|0,0:0|0:0,0:0:0:0: +467,217,72082,2,0,L|386:208,1,70,8|2,0:0|0:0,0:0:0:0: +358,282,72448,2,0,L|448:294,1,70,8|2,0:0|0:0,0:0:0:0: +498,339,72814,5,12,0:0:0:0: +498,339,72997,1,12,0:0:0:0: +301,343,73363,1,8,0:0:0:0: +211,173,73728,2,0,L|221:216,2,35,2|2|8,0:0|0:0|0:0,0:0:0:0: +250,100,74094,1,2,0:0:0:0: +123,92,74277,6,0,P|129:156|129:236,1,140,2|8,0:0|0:0,0:0:0:0: +109,321,74826,1,0,0:0:0:0: +211,173,75009,2,0,P|266:165|333:237,1,140,8|8,0:0|0:0,0:0:0:0: +341,302,75558,1,2,0:0:0:0: +418,272,75741,5,6,0:0:0:0: +484,322,75924,1,0,0:0:0:0: +407,352,76106,1,8,0:0:0:0: +341,302,76289,2,0,L|364:147,1,140,0|2,0:0|0:0,0:0:0:0: +269,60,76838,2,0,P|315:69|349:94,1,70,8|0,0:0|0:0,0:0:0:0: +269,150,77204,6,0,P|228:160|114:139,1,140,2|8,0:0|0:0,0:0:0:0: +49,80,77753,1,0,0:0:0:0: +39,235,77936,2,0,P|103:222|160:277,1,140,8|8,0:0|0:0,0:0:0:0: +82,297,78485,1,2,0:0:0:0: +227,326,78667,6,0,L|233:241,1,70,4|0,0:0|0:0,0:0:0:0: +269,150,79033,1,8,0:0:0:0: +408,194,79216,2,0,P|359:172|271:187,1,140,0|2,0:0|0:0,0:0:0:0: +409,281,79765,2,0,P|447:272|478:250,1,70,8|2,0:0|0:0,0:0:0:0: +497,168,80131,6,0,L|481:332,1,140,6|8,0:0|0:0,0:0:0:0: +389,365,80680,2,0,L|376:198,1,140,0|2,0:0|0:0,0:0:0:0: +414,157,81228,1,8,0:0:0:0: +229,89,81411,6,0,P|304:91|338:167,1,140,2|0,0:0|0:0,0:0:0:0: +290,222,81960,1,8,0:0:0:0: +211,214,82143,1,8,0:0:0:0: +93,155,82326,2,0,P|137:143|172:150,1,70,2|2,0:0|0:0,0:0:0:0: +235,301,82692,2,0,P|177:296|141:279,1,70,8|2,0:0|0:0,0:0:0:0: +68,244,83058,6,0,L|72:328,1,70,6|0,0:0|0:0,0:0:0:0: +166,292,83424,2,0,L|157:372,1,70,8|0,0:0|0:0,0:0:0:0: +254,227,83789,2,0,L|258:310,1,70,8|2,0:0|0:0,0:0:0:0: +345,265,84155,2,0,L|336:349,1,70,8|0,0:0|0:0,0:0:0:0: +331,175,84521,5,2,0:0:0:0: +416,205,84704,1,2,0:0:0:0: +481,141,84887,1,8,0:0:0:0: +431,64,85070,2,0,L|444:26,2,35,8|8|2,0:0|0:0|0:0,0:0:0:0: +339,79,85436,2,0,L|341:39,2,35,8|8|8,0:0|0:0|0:0,0:0:0:0: +256,109,85802,1,2,0:0:0:0: +165,97,85985,6,0,P|167:150|164:187,1,70,2|0,0:0|0:0,0:0:0:0: +117,244,86350,2,0,P|163:241|204:235,1,70,8|0,0:0|0:0,0:0:0:0: +229,317,86716,2,0,P|273:305|300:294,1,70,8|2,0:0|0:0,0:0:0:0: +365,354,87082,2,0,P|404:334|430:310,1,70,8|0,0:0|0:0,0:0:0:0: +352,230,87448,6,0,L|271:216,2,70,6|0|8,0:0|0:0|0:0,0:0:0:0: +378,142,87997,2,0,L|222:144,1,140,0|2,0:0|0:0,0:0:0:0: +152,112,88546,2,0,L|166:214,1,70,8|2,0:0|0:0,0:0:0:0: +139,270,88911,5,8,0:0:0:0: +12,138,89277,2,0,L|29:55,1,70,8|0,0:0|0:0,0:0:0:0: +91,5,89643,2,0,L|104:97,1,70,8|2,0:0|0:0,0:0:0:0: +153,149,90009,2,0,L|175:78,1,70,8|0,0:0|0:0,0:0:0:0: +279,36,90375,6,0,L|357:27,2,70,6|0|8,0:0|0:0|0:0,0:0:0:0: +248,122,90924,2,0,L|398:125,1,140,0|2,0:0|0:0,0:0:0:0: +479,123,91472,2,0,P|468:170|445:195,1,70,8|2,0:0|0:0,0:0:0:0: +365,204,91838,6,0,P|414:220|409:320,1,140,6|8,0:0|0:0,0:0:0:0: +354,354,92387,1,0,0:0:0:0: +262,353,92570,2,0,L|271:273,1,70,8|2,0:0|0:0,0:0:0:0: +297,196,92936,2,0,P|243:198|216:215,1,70,8|0,0:0|0:0,0:0:0:0: +172,276,93302,5,6,0:0:0:0: +137,360,93485,2,0,L|127:265,1,70,0|8,0:0|0:0,0:0:0:0: +81,212,93850,2,0,P|93:138|118:67,1,140,0|2,0:0|0:0,0:0:0:0: +170,4,94399,2,0,P|195:37|204:74,1,70,8|2,0:0|0:0,0:0:0:0: +186,153,94765,6,0,L|340:139,1,140,6|8,0:0|0:0,0:0:0:0: +408,101,95314,1,2,0:0:0:0: +443,184,95497,1,6,0:0:0:0: +369,237,95680,2,0,L|300:224,2,70,8|8|2,0:0|0:0|0:0,0:0:0:0: +448,282,96228,5,12,0:0:0:0: +448,282,96411,1,12,0:0:0:0: +270,320,96777,1,8,0:0:0:0: +313,143,97143,1,8,0:0:0:0: +377,314,97509,1,8,0:0:0:0: +256,192,97692,12,0,100619,0:0:0:0: diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index ccfe1501bd..184c09f378 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -64,7 +64,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty); int countSliderOrSpinner = difficulty.TotalObjectCount - difficulty.CircleCount; - float percentSpecialObjects = (float)countSliderOrSpinner / difficulty.TotalObjectCount; + + // In osu!stable, this division appears as if it happens on floats, but due to release-mode + // optimisations, it actually ends up happening on doubles. + double percentSpecialObjects = (double)countSliderOrSpinner / difficulty.TotalObjectCount; if (percentSpecialObjects < 0.2) return 7; From 767d5c8018abb2a8aca3d8aaf8a3259862f976e2 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 9 Dec 2023 21:57:34 +0900 Subject: [PATCH 107/567] Add object counts to IBeatmapDifficultyInfo --- osu.Game/BackgroundDataStoreProcessor.cs | 38 +++++++++++++++++++ osu.Game/Beatmaps/BeatmapDifficulty.cs | 9 +++++ osu.Game/Beatmaps/BeatmapImporter.cs | 3 ++ osu.Game/Beatmaps/BeatmapUpdater.cs | 20 +++++++++- osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs | 13 +++++++ osu.Game/Database/RealmAccess.cs | 3 +- .../API/Requests/Responses/APIBeatmap.cs | 2 + .../LegacyBeatmapConversionDifficultyInfo.cs | 1 + 8 files changed, 87 insertions(+), 2 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 90e55dea6d..8195856991 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -21,6 +21,7 @@ using osu.Game.Rulesets; using osu.Game.Scoring; using osu.Game.Scoring.Legacy; using osu.Game.Screens.Play; +using Realms; namespace osu.Game { @@ -68,6 +69,7 @@ namespace osu.Game checkForOutdatedStarRatings(); processBeatmapSetsWithMissingMetrics(); + processBeatmapsWithMissingObjectCounts(); processScoresWithMissingStatistics(); convertLegacyTotalScoreToStandardised(); }, TaskCreationOptions.LongRunning).ContinueWith(t => @@ -178,6 +180,42 @@ namespace osu.Game } } + private void processBeatmapsWithMissingObjectCounts() + { + Logger.Log("Querying for beatmaps with missing hitobject counts to reprocess..."); + + HashSet beatmapIds = realmAccess.Run(r => new HashSet(r.All() + .Filter($"{nameof(BeatmapInfo.Difficulty)}.{nameof(BeatmapDifficulty.TotalObjectCount)} == 0") + .AsEnumerable().Select(b => b.ID))); + + Logger.Log($"Found {beatmapIds.Count} beatmaps which require reprocessing."); + + int i = 0; + + foreach (var id in beatmapIds) + { + sleepIfRequired(); + + realmAccess.Run(r => + { + var beatmap = r.Find(id); + + if (beatmap != null) + { + try + { + Logger.Log($"Background processing {beatmap} ({++i} / {beatmapIds.Count})"); + beatmapUpdater.ProcessObjectCounts(beatmap); + } + catch (Exception e) + { + Logger.Log($"Background processing failed on {beatmap}: {e}"); + } + } + }); + } + } + private void processScoresWithMissingStatistics() { HashSet scoreIds = new HashSet(); diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index ac2267380d..785728141e 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -21,6 +21,9 @@ namespace osu.Game.Beatmaps public double SliderMultiplier { get; set; } = 1.4; public double SliderTickRate { get; set; } = 1; + public int EndTimeObjectCount { get; set; } + public int TotalObjectCount { get; set; } + public BeatmapDifficulty() { } @@ -44,6 +47,9 @@ namespace osu.Game.Beatmaps difficulty.SliderMultiplier = SliderMultiplier; difficulty.SliderTickRate = SliderTickRate; + + difficulty.EndTimeObjectCount = EndTimeObjectCount; + difficulty.TotalObjectCount = TotalObjectCount; } public virtual void CopyFrom(IBeatmapDifficultyInfo other) @@ -55,6 +61,9 @@ namespace osu.Game.Beatmaps SliderMultiplier = other.SliderMultiplier; SliderTickRate = other.SliderTickRate; + + EndTimeObjectCount = other.EndTimeObjectCount; + TotalObjectCount = other.TotalObjectCount; } } } diff --git a/osu.Game/Beatmaps/BeatmapImporter.cs b/osu.Game/Beatmaps/BeatmapImporter.cs index e89e5339e1..31d6b0108e 100644 --- a/osu.Game/Beatmaps/BeatmapImporter.cs +++ b/osu.Game/Beatmaps/BeatmapImporter.cs @@ -20,6 +20,7 @@ using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; +using osu.Game.Rulesets.Objects.Types; using Realms; namespace osu.Game.Beatmaps @@ -388,6 +389,8 @@ namespace osu.Game.Beatmaps ApproachRate = decodedDifficulty.ApproachRate, SliderMultiplier = decodedDifficulty.SliderMultiplier, SliderTickRate = decodedDifficulty.SliderTickRate, + EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration), + TotalObjectCount = decoded.HitObjects.Count }; var metadata = new BeatmapMetadata diff --git a/osu.Game/Beatmaps/BeatmapUpdater.cs b/osu.Game/Beatmaps/BeatmapUpdater.cs index 56bfdc5001..472ac26ebe 100644 --- a/osu.Game/Beatmaps/BeatmapUpdater.cs +++ b/osu.Game/Beatmaps/BeatmapUpdater.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Linq; using System.Threading.Tasks; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Logging; @@ -10,6 +11,7 @@ using osu.Framework.Platform; using osu.Framework.Threading; using osu.Game.Database; using osu.Game.Online.API; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Beatmaps { @@ -44,7 +46,8 @@ namespace osu.Game.Beatmaps public void Queue(Live beatmapSet, MetadataLookupScope lookupScope = MetadataLookupScope.LocalCacheFirst) { Logger.Log($"Queueing change for local beatmap {beatmapSet}"); - Task.Factory.StartNew(() => beatmapSet.PerformRead(b => Process(b, lookupScope)), default, TaskCreationOptions.HideScheduler | TaskCreationOptions.RunContinuationsAsynchronously, updateScheduler); + Task.Factory.StartNew(() => beatmapSet.PerformRead(b => Process(b, lookupScope)), default, TaskCreationOptions.HideScheduler | TaskCreationOptions.RunContinuationsAsynchronously, + updateScheduler); } /// @@ -80,6 +83,21 @@ namespace osu.Game.Beatmaps workingBeatmapCache.Invalidate(beatmapSet); }); + public void ProcessObjectCounts(BeatmapInfo beatmapInfo, MetadataLookupScope lookupScope = MetadataLookupScope.LocalCacheFirst) => beatmapInfo.Realm!.Write(_ => + { + // Before we use below, we want to invalidate. + workingBeatmapCache.Invalidate(beatmapInfo); + + var working = workingBeatmapCache.GetWorkingBeatmap(beatmapInfo); + var beatmap = working.Beatmap; + + beatmapInfo.Difficulty.EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration); + beatmapInfo.Difficulty.TotalObjectCount = beatmap.HitObjects.Count; + + // And invalidate again afterwards as re-fetching the most up-to-date database metadata will be required. + workingBeatmapCache.Invalidate(beatmapInfo); + }); + #region Implementation of IDisposable public void Dispose() diff --git a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs index e7a3d87d0a..47b261d1f6 100644 --- a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs @@ -44,6 +44,19 @@ namespace osu.Game.Beatmaps /// double SliderTickRate { get; } + /// + /// The number of hitobjects in the beatmap with a distinct end time. + /// + /// + /// Canonically, these are hitobjects are either sliders or spinners. + /// + int EndTimeObjectCount { get; } + + /// + /// The total number of hitobjects in the beatmap. + /// + int TotalObjectCount { get; } + /// /// Maps a difficulty value [0, 10] to a two-piece linear range of values. /// diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index e9f49ec662..9c7fe464dd 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -88,8 +88,9 @@ namespace osu.Game.Database /// 34 2023-08-21 Add BackgroundReprocessingFailed flag to ScoreInfo to track upgrade failures. /// 35 2023-10-16 Clear key combinations of keybindings that are assigned to more than one action in a given settings section. /// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs. + /// 37 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapDifficulty. /// - private const int schema_version = 36; + private const int schema_version = 37; /// /// Lock object which is held during sections, blocking realm retrieval during blocking periods. diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index 902b651be9..c1ceff7c43 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -109,6 +109,8 @@ namespace osu.Game.Online.API.Requests.Responses CircleSize = CircleSize, ApproachRate = ApproachRate, OverallDifficulty = OverallDifficulty, + EndTimeObjectCount = SliderCount + SpinnerCount, + TotalObjectCount = CircleCount + SliderCount + SpinnerCount }; IBeatmapSetInfo? IBeatmapInfo.BeatmapSet => BeatmapSet; diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs index 97ccf787af..9c9294417f 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs @@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy float IBeatmapDifficultyInfo.ApproachRate => 0; double IBeatmapDifficultyInfo.SliderMultiplier => 0; double IBeatmapDifficultyInfo.SliderTickRate => 0; + int IBeatmapDifficultyInfo.EndTimeObjectCount => TotalObjectCount - CircleCount; public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => new LegacyBeatmapConversionDifficultyInfo { From b36db3518c79486a94fc97411fbf340fd3741a38 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 9 Dec 2023 22:09:49 +0900 Subject: [PATCH 108/567] Add keycount to song select details panel and carousel panels --- .../Beatmaps/ManiaBeatmapConverter.cs | 13 ++----- .../ManiaFilterCriteria.cs | 3 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 3 ++ osu.Game/Rulesets/ILegacyRuleset.cs | 7 ++++ .../LegacyBeatmapConversionDifficultyInfo.cs | 28 +++++--------- .../Carousel/DrawableCarouselBeatmap.cs | 37 +++++++++++++++++++ .../Screens/Select/Details/AdvancedStats.cs | 16 ++++++-- 7 files changed, 74 insertions(+), 33 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index ccfe1501bd..c4a8db92ed 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -57,10 +57,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps public static int GetColumnCount(LegacyBeatmapConversionDifficultyInfo difficulty) { - if (new ManiaRuleset().RulesetInfo.Equals(difficulty.SourceRuleset)) - return GetColumnCountForNonConvert(difficulty); - double roundedCircleSize = Math.Round(difficulty.CircleSize); + + if (new ManiaRuleset().RulesetInfo.Equals(difficulty.SourceRuleset)) + return (int)Math.Max(1, roundedCircleSize); + double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty); int countSliderOrSpinner = difficulty.TotalObjectCount - difficulty.CircleCount; @@ -76,12 +77,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps return Math.Max(4, Math.Min((int)roundedOverallDifficulty + 1, 7)); } - public static int GetColumnCountForNonConvert(IBeatmapDifficultyInfo difficulty) - { - double roundedCircleSize = Math.Round(difficulty.CircleSize); - return (int)Math.Max(1, roundedCircleSize); - } - public override bool CanConvert() => Beatmap.HitObjects.All(h => h is IHasXPosition); protected override Beatmap ConvertBeatmap(IBeatmap original, CancellationToken cancellationToken) diff --git a/osu.Game.Rulesets.Mania/ManiaFilterCriteria.cs b/osu.Game.Rulesets.Mania/ManiaFilterCriteria.cs index 7f8a00bf88..930ca217cd 100644 --- a/osu.Game.Rulesets.Mania/ManiaFilterCriteria.cs +++ b/osu.Game.Rulesets.Mania/ManiaFilterCriteria.cs @@ -4,6 +4,7 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Filter; using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Scoring.Legacy; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; @@ -15,7 +16,7 @@ namespace osu.Game.Rulesets.Mania public bool Matches(BeatmapInfo beatmapInfo) { - return !keys.HasFilter || (beatmapInfo.Ruleset.OnlineID == new ManiaRuleset().LegacyID && keys.IsInRange(ManiaBeatmapConverter.GetColumnCountForNonConvert(beatmapInfo.Difficulty))); + return !keys.HasFilter || keys.IsInRange(ManiaBeatmapConverter.GetColumnCount(LegacyBeatmapConversionDifficultyInfo.FromBeatmapInfo(beatmapInfo))); } public bool TryParseCustomKeywordCriteria(string key, Operator op, string value) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 0c317e0f8a..c38d6519bd 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -420,6 +420,9 @@ namespace osu.Game.Rulesets.Mania public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection(); public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection(); + + public int GetKeyCount(IBeatmapInfo beatmapInfo) + => ManiaBeatmapConverter.GetColumnCount(LegacyBeatmapConversionDifficultyInfo.FromBeatmapInfo(beatmapInfo)); } public enum PlayfieldType diff --git a/osu.Game/Rulesets/ILegacyRuleset.cs b/osu.Game/Rulesets/ILegacyRuleset.cs index 6900afa243..18d86f477a 100644 --- a/osu.Game/Rulesets/ILegacyRuleset.cs +++ b/osu.Game/Rulesets/ILegacyRuleset.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring.Legacy; namespace osu.Game.Rulesets @@ -14,6 +15,12 @@ namespace osu.Game.Rulesets /// int LegacyID { get; } + /// + /// Retrieves the number of mania keys required to play the beatmap. + /// + /// + int GetKeyCount(IBeatmapInfo beatmapInfo) => 0; + ILegacyScoreSimulator CreateLegacyScoreSimulator(); } } diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs index 9c9294417f..6f379e4ef1 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs @@ -1,10 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Linq; using osu.Game.Beatmaps; using osu.Game.Online.API.Requests.Responses; -using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Scoring.Legacy { @@ -31,9 +29,6 @@ namespace osu.Game.Rulesets.Scoring.Legacy /// /// The count of hitcircles in the beatmap. /// - /// - /// When converting from osu! ruleset beatmaps, this is equivalent to the sum of sliders and spinners in the beatmap. - /// public int CircleCount { get; set; } /// @@ -47,22 +42,17 @@ namespace osu.Game.Rulesets.Scoring.Legacy double IBeatmapDifficultyInfo.SliderTickRate => 0; int IBeatmapDifficultyInfo.EndTimeObjectCount => TotalObjectCount - CircleCount; - public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => new LegacyBeatmapConversionDifficultyInfo - { - SourceRuleset = apiBeatmap.Ruleset, - CircleSize = apiBeatmap.CircleSize, - OverallDifficulty = apiBeatmap.OverallDifficulty, - CircleCount = apiBeatmap.CircleCount, - TotalObjectCount = apiBeatmap.SliderCount + apiBeatmap.SpinnerCount + apiBeatmap.CircleCount - }; + public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => FromBeatmapInfo(apiBeatmap); - public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => new LegacyBeatmapConversionDifficultyInfo + public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => FromBeatmapInfo(beatmap.BeatmapInfo); + + public static LegacyBeatmapConversionDifficultyInfo FromBeatmapInfo(IBeatmapInfo beatmapInfo) => new LegacyBeatmapConversionDifficultyInfo { - SourceRuleset = beatmap.BeatmapInfo.Ruleset, - CircleSize = beatmap.Difficulty.CircleSize, - OverallDifficulty = beatmap.Difficulty.OverallDifficulty, - CircleCount = beatmap.HitObjects.Count(h => h is not IHasDuration), - TotalObjectCount = beatmap.HitObjects.Count + SourceRuleset = beatmapInfo.Ruleset, + CircleSize = beatmapInfo.Difficulty.CircleSize, + OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty, + CircleCount = beatmapInfo.Difficulty.TotalObjectCount - beatmapInfo.Difficulty.EndTimeObjectCount, + TotalObjectCount = beatmapInfo.Difficulty.TotalObjectCount }; } } diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index 3dfd801f02..cda95a9d29 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -27,6 +27,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; using osu.Game.Resources.Localisation.Web; +using osu.Game.Rulesets; using osuTK; using osuTK.Graphics; @@ -57,6 +58,8 @@ namespace osu.Game.Screens.Select.Carousel private StarCounter starCounter = null!; private DifficultyIcon difficultyIcon = null!; + private OsuSpriteText keyCountText = null!; + [Resolved] private BeatmapSetOverlay? beatmapOverlay { get; set; } @@ -69,6 +72,9 @@ namespace osu.Game.Screens.Select.Carousel [Resolved] private RealmAccess realm { get; set; } = null!; + [Resolved] + private IBindable ruleset { get; set; } = null!; + private IBindable starDifficultyBindable = null!; private CancellationTokenSource? starDifficultyCancellationSource; @@ -133,6 +139,13 @@ namespace osu.Game.Screens.Select.Carousel AutoSizeAxes = Axes.Both, Children = new[] { + keyCountText = new OsuSpriteText + { + Font = OsuFont.GetFont(size: 20), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Alpha = 0, + }, new OsuSpriteText { Text = beatmapInfo.DifficultyName, @@ -167,6 +180,13 @@ namespace osu.Game.Screens.Select.Carousel }; } + protected override void LoadComplete() + { + base.LoadComplete(); + + ruleset.BindValueChanged(_ => updateKeyCount()); + } + protected override void Selected() { base.Selected(); @@ -216,11 +236,28 @@ namespace osu.Game.Screens.Select.Carousel if (d.NewValue != null) difficultyIcon.Current.Value = d.NewValue.Value; }, true); + + updateKeyCount(); } base.ApplyState(); } + private void updateKeyCount() + { + if (ruleset.Value.OnlineID == 3) + { + // Account for mania differences locally for now. + // Eventually this should be handled in a more modular way, allowing rulesets to add more information to the panel. + ILegacyRuleset legacyRuleset = (ILegacyRuleset)ruleset.Value.CreateInstance(); + + keyCountText.Alpha = 1; + keyCountText.Text = $"[{legacyRuleset.GetKeyCount(beatmapInfo)}K]"; + } + else + keyCountText.Alpha = 0; + } + public MenuItem[] ContextMenuItems { get diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index a383298faa..87185c351e 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -126,13 +126,21 @@ namespace osu.Game.Screens.Select.Details mod.ApplyToDifficulty(adjustedDifficulty); } - switch (BeatmapInfo?.Ruleset.OnlineID) + switch (gameRuleset.Value.OnlineID) { case 3: - // Account for mania differences locally for now - // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes + // Account for mania differences locally for now. + // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes. + ILegacyRuleset legacyRuleset = (ILegacyRuleset)gameRuleset.Value.CreateInstance(); + + // For the time being, the key count is static no matter what, because: + // a) The method doesn't have knowledge of the active keymods. Doing so may require considerations for filtering. + // b) Using the difficulty adjustment mod to adjust OD doesn't have an effect on conversion. + int keyCount = baseDifficulty == null ? 0 : legacyRuleset.GetKeyCount(BeatmapInfo); + FirstValue.Title = BeatmapsetsStrings.ShowStatsCsMania; - FirstValue.Value = (baseDifficulty?.CircleSize ?? 0, null); + FirstValue.Value = (keyCount, keyCount); + break; default: From 1d0c37e13875b57b4f8dfaf2f0b4ab299b222a15 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sun, 10 Dec 2023 00:40:05 +0200 Subject: [PATCH 109/567] fixed test errors --- osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs | 10 ++++++---- osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs | 6 +++--- osu.Game/Screens/Select/Details/AdvancedStats.cs | 8 -------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index 3e800bfaf1..5314c6f4a9 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -17,11 +17,11 @@ namespace osu.Game.Overlays.Mods { public partial class AdjustedAttributesTooltip : CompositeDrawable, ITooltip { - private Dictionary> attributes = new Dictionary>(); + private readonly Dictionary> attributes = new Dictionary>(); - private Container content; + private readonly Container content; - private FillFlowContainer attributesFillFlow; + private readonly FillFlowContainer attributesFillFlow; [Resolved] private OsuColour colours { get; set; } = null!; @@ -83,8 +83,8 @@ namespace osu.Game.Overlays.Mods return; } } - content.Hide(); + content.Hide(); } public void AddAttribute(string name) @@ -97,6 +97,8 @@ namespace osu.Game.Overlays.Mods public void UpdateAttribute(string name, double oldValue, double newValue) { + if (!attributes.ContainsKey(name)) return; + Bindable attribute = attributes[name]; OldNewPair attributeValue = attribute.Value; diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index fa8f9cb7a4..d74f088ac2 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -104,6 +104,9 @@ namespace osu.Game.Overlays.Mods { base.LoadComplete(); + rateAdjustTooltip.AddAttribute("AR"); + rateAdjustTooltip.AddAttribute("OD"); + mods.BindValueChanged(_ => { modSettingChangeTracker?.Dispose(); @@ -126,9 +129,6 @@ namespace osu.Game.Overlays.Mods BeatmapInfo.BindValueChanged(_ => updateValues(), true); - rateAdjustTooltip.AddAttribute("AR"); - rateAdjustTooltip.AddAttribute("OD"); - updateCollapsedState(); } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index d3a6a88c68..30cb0601f3 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -214,14 +214,6 @@ namespace osu.Game.Screens.Select.Details starDifficultyCancellationSource?.Cancel(); } - private static bool hasRateAdjustedProperties(BeatmapDifficulty a, BeatmapDifficulty b) - { - if (!Precision.AlmostEquals(a.ApproachRate, b.ApproachRate)) return true; - if (!Precision.AlmostEquals(a.OverallDifficulty, b.OverallDifficulty)) return true; - - return false; - } - public partial class StatisticRow : Container, IHasAccentColour { private const float value_width = 25; From 78cdedf34d1f0c24b5b1f7d342c58fc96d27e18a Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sun, 10 Dec 2023 00:42:02 +0200 Subject: [PATCH 110/567] Update BeatmapAttributesDisplay.cs --- osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index d74f088ac2..0c35e55df5 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -62,7 +62,6 @@ namespace osu.Game.Overlays.Mods public ITooltip GetCustomTooltip() => rateAdjustTooltip; public object TooltipContent => this; - private const float transition_duration = 250; [BackgroundDependencyLoader] From f5b93121f1194591aab5d538062e48e7315f6589 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sun, 10 Dec 2023 00:51:50 +0200 Subject: [PATCH 111/567] Update AdjustedAttributesTooltip.cs --- osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index 5314c6f4a9..e9b7ee5c54 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -111,6 +111,7 @@ namespace osu.Game.Overlays.Mods protected override void Update() { } + public void SetContent(object content) { } @@ -128,12 +129,13 @@ namespace osu.Game.Overlays.Mods private partial class AttributeDisplay : CompositeDrawable { public readonly Bindable AttributeValues; - public string AttributeName; + public readonly string AttributeName; - private OsuSpriteText text = new OsuSpriteText + private readonly OsuSpriteText text = new OsuSpriteText { Font = OsuFont.Default.With(weight: FontWeight.Bold) }; + public AttributeDisplay(string name, Bindable boundCopy) { AutoSizeAxes = Axes.Both; From 2d94841929aae312a09b81c8aee45d2befabcb27 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sun, 10 Dec 2023 02:00:32 +0200 Subject: [PATCH 112/567] fixed one test --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 30cb0601f3..819fe122fa 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -128,7 +128,8 @@ namespace osu.Game.Screens.Select.Details IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; - if (baseDifficulty != null) + if (baseDifficulty != null && + (mods.Value.Any(m => m is IApplicableToDifficulty) || mods.Value.Any(m => m is IApplicableToRate))) { BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(baseDifficulty); From 6320194e19510bcd7cb26ad69b84a492fb0db6ab Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 11 Dec 2023 21:52:39 +0900 Subject: [PATCH 113/567] Fix catch applying positional clamping too early --- .../CatchBeatmapConversionTest.cs | 1 + .../Beatmaps/112643-expected-conversion.json | 1 + .../Resources/Testing/Beatmaps/112643.osu | 582 ++++++++++++++++++ .../Beatmaps/CatchBeatmapProcessor.cs | 12 + .../Objects/JuiceStream.cs | 12 +- 5 files changed, 600 insertions(+), 8 deletions(-) create mode 100644 osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643-expected-conversion.json create mode 100644 osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643.osu diff --git a/osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs b/osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs index 7572c6670f..d0ecb828df 100644 --- a/osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs +++ b/osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs @@ -52,6 +52,7 @@ namespace osu.Game.Rulesets.Catch.Tests [TestCase("3644427", new[] { typeof(CatchModEasy), typeof(CatchModFlashlight) })] [TestCase("3689906", new[] { typeof(CatchModDoubleTime), typeof(CatchModEasy) })] [TestCase("3949367", new[] { typeof(CatchModDoubleTime), typeof(CatchModEasy) })] + [TestCase("112643")] public new void Test(string name, params Type[] mods) => base.Test(name, mods); protected override IEnumerable CreateConvertValue(HitObject hitObject) diff --git a/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643-expected-conversion.json b/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643-expected-conversion.json new file mode 100644 index 0000000000..7d6e29b6c1 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643-expected-conversion.json @@ -0,0 +1 @@ +{"Mappings":[{"StartTime":2375.0,"Objects":[{"StartTime":2375.0,"Position":64.0,"HyperDash":false}]},{"StartTime":2625.0,"Objects":[{"StartTime":2625.0,"Position":172.0,"HyperDash":false}]},{"StartTime":2875.0,"Objects":[{"StartTime":2875.0,"Position":152.0,"HyperDash":false}]},{"StartTime":3125.0,"Objects":[{"StartTime":3125.0,"Position":80.0,"HyperDash":false}]},{"StartTime":3375.0,"Objects":[{"StartTime":3375.0,"Position":224.0,"HyperDash":false}]},{"StartTime":3625.0,"Objects":[{"StartTime":3625.0,"Position":192.0,"HyperDash":false}]},{"StartTime":3875.0,"Objects":[{"StartTime":3875.0,"Position":136.0,"HyperDash":false}]},{"StartTime":4125.0,"Objects":[{"StartTime":4125.0,"Position":272.0,"HyperDash":false},{"StartTime":4187.0,"Position":295.965057,"HyperDash":false},{"StartTime":4250.0,"Position":339.30658,"HyperDash":false},{"StartTime":4312.0,"Position":372.55603,"HyperDash":false},{"StartTime":4375.0,"Position":372.509583,"HyperDash":false},{"StartTime":4437.0,"Position":372.203644,"HyperDash":false},{"StartTime":4500.0,"Position":340.885864,"HyperDash":false},{"StartTime":4562.0,"Position":348.843384,"HyperDash":false},{"StartTime":4625.0,"Position":384.566772,"HyperDash":false},{"StartTime":4749.0,"Position":462.643433,"HyperDash":false}]},{"StartTime":4875.0,"Objects":[{"StartTime":4875.0,"Position":504.0,"HyperDash":false},{"StartTime":4937.0,"Position":456.809235,"HyperDash":false},{"StartTime":5000.0,"Position":413.577362,"HyperDash":false},{"StartTime":5062.0,"Position":384.032623,"HyperDash":false},{"StartTime":5125.0,"Position":351.76297,"HyperDash":false},{"StartTime":5178.0,"Position":327.56488,"HyperDash":false},{"StartTime":5232.0,"Position":288.905457,"HyperDash":false},{"StartTime":5285.0,"Position":281.458923,"HyperDash":false},{"StartTime":5375.0,"Position":249.3499,"HyperDash":false}]},{"StartTime":5625.0,"Objects":[{"StartTime":5625.0,"Position":384.0,"HyperDash":false}]},{"StartTime":5875.0,"Objects":[{"StartTime":5875.0,"Position":272.0,"HyperDash":false}]},{"StartTime":6000.0,"Objects":[{"StartTime":6000.0,"Position":272.0,"HyperDash":false}]},{"StartTime":6125.0,"Objects":[{"StartTime":6125.0,"Position":272.0,"HyperDash":false}]},{"StartTime":6375.0,"Objects":[{"StartTime":6375.0,"Position":92.0,"HyperDash":false}]},{"StartTime":6625.0,"Objects":[{"StartTime":6625.0,"Position":124.0,"HyperDash":false}]},{"StartTime":6875.0,"Objects":[{"StartTime":6875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":7125.0,"Objects":[{"StartTime":7125.0,"Position":388.0,"HyperDash":false}]},{"StartTime":7375.0,"Objects":[{"StartTime":7375.0,"Position":420.0,"HyperDash":false}]},{"StartTime":7625.0,"Objects":[{"StartTime":7625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":7875.0,"Objects":[{"StartTime":7875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":8125.0,"Objects":[{"StartTime":8125.0,"Position":443.0,"HyperDash":false},{"StartTime":8187.0,"Position":392.598877,"HyperDash":false},{"StartTime":8250.0,"Position":365.1502,"HyperDash":false},{"StartTime":8312.0,"Position":352.954926,"HyperDash":false},{"StartTime":8375.0,"Position":294.614716,"HyperDash":false},{"StartTime":8437.0,"Position":268.171936,"HyperDash":false},{"StartTime":8500.0,"Position":207.09552,"HyperDash":false},{"StartTime":8562.0,"Position":158.395874,"HyperDash":false},{"StartTime":8625.0,"Position":135.590256,"HyperDash":false},{"StartTime":8749.0,"Position":67.66239,"HyperDash":false}]},{"StartTime":8875.0,"Objects":[{"StartTime":8875.0,"Position":24.0,"HyperDash":false},{"StartTime":8937.0,"Position":54.41505,"HyperDash":false},{"StartTime":9000.0,"Position":92.0854,"HyperDash":false},{"StartTime":9062.0,"Position":91.62684,"HyperDash":false},{"StartTime":9125.0,"Position":114.961037,"HyperDash":false},{"StartTime":9178.0,"Position":112.725426,"HyperDash":false},{"StartTime":9232.0,"Position":118.526962,"HyperDash":false},{"StartTime":9285.0,"Position":72.53759,"HyperDash":false},{"StartTime":9374.0,"Position":43.35332,"HyperDash":false}]},{"StartTime":9625.0,"Objects":[{"StartTime":9625.0,"Position":16.0,"HyperDash":false}]},{"StartTime":9875.0,"Objects":[{"StartTime":9875.0,"Position":136.0,"HyperDash":false}]},{"StartTime":10000.0,"Objects":[{"StartTime":10000.0,"Position":136.0,"HyperDash":false}]},{"StartTime":10125.0,"Objects":[{"StartTime":10125.0,"Position":136.0,"HyperDash":false}]},{"StartTime":10375.0,"Objects":[{"StartTime":10375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":10625.0,"Objects":[{"StartTime":10625.0,"Position":368.0,"HyperDash":false}]},{"StartTime":10875.0,"Objects":[{"StartTime":10875.0,"Position":196.0,"HyperDash":false}]},{"StartTime":11125.0,"Objects":[{"StartTime":11125.0,"Position":316.0,"HyperDash":false}]},{"StartTime":11375.0,"Objects":[{"StartTime":11375.0,"Position":144.0,"HyperDash":false}]},{"StartTime":11625.0,"Objects":[{"StartTime":11625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":11875.0,"Objects":[{"StartTime":11875.0,"Position":112.0,"HyperDash":false}]},{"StartTime":12125.0,"Objects":[{"StartTime":12125.0,"Position":164.0,"HyperDash":false},{"StartTime":12250.0,"Position":238.49942,"HyperDash":false}]},{"StartTime":12500.0,"Objects":[{"StartTime":12500.0,"Position":100.0,"HyperDash":false},{"StartTime":12625.0,"Position":25.50058,"HyperDash":false}]},{"StartTime":12875.0,"Objects":[{"StartTime":12875.0,"Position":144.0,"HyperDash":false},{"StartTime":13000.0,"Position":69.50058,"HyperDash":false}]},{"StartTime":13250.0,"Objects":[{"StartTime":13250.0,"Position":208.0,"HyperDash":false},{"StartTime":13375.0,"Position":282.49942,"HyperDash":false}]},{"StartTime":13625.0,"Objects":[{"StartTime":13625.0,"Position":332.0,"HyperDash":false}]},{"StartTime":13875.0,"Objects":[{"StartTime":13875.0,"Position":180.0,"HyperDash":false}]},{"StartTime":14125.0,"Objects":[{"StartTime":14125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":14250.0,"Objects":[{"StartTime":14250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":14500.0,"Objects":[{"StartTime":14500.0,"Position":324.0,"HyperDash":false}]},{"StartTime":14625.0,"Objects":[{"StartTime":14625.0,"Position":324.0,"HyperDash":false}]},{"StartTime":14875.0,"Objects":[{"StartTime":14875.0,"Position":192.0,"HyperDash":false}]},{"StartTime":15000.0,"Objects":[{"StartTime":15000.0,"Position":192.0,"HyperDash":false}]},{"StartTime":15250.0,"Objects":[{"StartTime":15250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":15375.0,"Objects":[{"StartTime":15375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":15625.0,"Objects":[{"StartTime":15625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":15875.0,"Objects":[{"StartTime":15875.0,"Position":120.0,"HyperDash":false}]},{"StartTime":16125.0,"Objects":[{"StartTime":16125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":18375.0,"Objects":[{"StartTime":18375.0,"Position":20.0,"HyperDash":false}]},{"StartTime":18625.0,"Objects":[{"StartTime":18625.0,"Position":180.0,"HyperDash":false}]},{"StartTime":18875.0,"Objects":[{"StartTime":18875.0,"Position":52.0,"HyperDash":false}]},{"StartTime":19125.0,"Objects":[{"StartTime":19125.0,"Position":120.0,"HyperDash":false}]},{"StartTime":19375.0,"Objects":[{"StartTime":19375.0,"Position":128.0,"HyperDash":false}]},{"StartTime":19625.0,"Objects":[{"StartTime":19625.0,"Position":48.0,"HyperDash":false}]},{"StartTime":19875.0,"Objects":[{"StartTime":19875.0,"Position":192.0,"HyperDash":false}]},{"StartTime":20125.0,"Objects":[{"StartTime":20125.0,"Position":300.0,"HyperDash":false},{"StartTime":20187.0,"Position":319.510284,"HyperDash":false},{"StartTime":20250.0,"Position":361.959717,"HyperDash":false},{"StartTime":20312.0,"Position":410.823639,"HyperDash":false},{"StartTime":20375.0,"Position":393.9937,"HyperDash":false},{"StartTime":20428.0,"Position":389.407,"HyperDash":false},{"StartTime":20482.0,"Position":394.563232,"HyperDash":false},{"StartTime":20535.0,"Position":430.098541,"HyperDash":false},{"StartTime":20624.0,"Position":486.9303,"HyperDash":false}]},{"StartTime":20875.0,"Objects":[{"StartTime":20875.0,"Position":472.0,"HyperDash":false},{"StartTime":20937.0,"Position":454.614349,"HyperDash":false},{"StartTime":21000.0,"Position":395.812744,"HyperDash":false},{"StartTime":21062.0,"Position":377.009979,"HyperDash":false},{"StartTime":21125.0,"Position":345.3677,"HyperDash":false},{"StartTime":21178.0,"Position":342.8652,"HyperDash":false},{"StartTime":21232.0,"Position":325.856567,"HyperDash":false},{"StartTime":21285.0,"Position":310.223846,"HyperDash":false},{"StartTime":21374.0,"Position":280.7244,"HyperDash":false}]},{"StartTime":21625.0,"Objects":[{"StartTime":21625.0,"Position":404.0,"HyperDash":false}]},{"StartTime":21875.0,"Objects":[{"StartTime":21875.0,"Position":432.0,"HyperDash":false}]},{"StartTime":22000.0,"Objects":[{"StartTime":22000.0,"Position":432.0,"HyperDash":false}]},{"StartTime":22125.0,"Objects":[{"StartTime":22125.0,"Position":432.0,"HyperDash":false}]},{"StartTime":22375.0,"Objects":[{"StartTime":22375.0,"Position":296.0,"HyperDash":false}]},{"StartTime":22625.0,"Objects":[{"StartTime":22625.0,"Position":168.0,"HyperDash":false},{"StartTime":22678.0,"Position":157.672318,"HyperDash":false},{"StartTime":22732.0,"Position":121.82901,"HyperDash":false},{"StartTime":22785.0,"Position":68.50134,"HyperDash":false},{"StartTime":22875.0,"Position":39.09584,"HyperDash":false}]},{"StartTime":23125.0,"Objects":[{"StartTime":23125.0,"Position":268.0,"HyperDash":false},{"StartTime":23178.0,"Position":252.906113,"HyperDash":false},{"StartTime":23232.0,"Position":215.4331,"HyperDash":false},{"StartTime":23285.0,"Position":192.339218,"HyperDash":false},{"StartTime":23375.0,"Position":173.217529,"HyperDash":false}]},{"StartTime":23625.0,"Objects":[{"StartTime":23625.0,"Position":252.0,"HyperDash":false},{"StartTime":23678.0,"Position":297.327667,"HyperDash":false},{"StartTime":23732.0,"Position":299.171,"HyperDash":false},{"StartTime":23785.0,"Position":350.498657,"HyperDash":false},{"StartTime":23875.0,"Position":380.904175,"HyperDash":false}]},{"StartTime":24125.0,"Objects":[{"StartTime":24125.0,"Position":484.0,"HyperDash":false},{"StartTime":24187.0,"Position":459.330444,"HyperDash":false},{"StartTime":24250.0,"Position":410.3108,"HyperDash":false},{"StartTime":24312.0,"Position":381.927948,"HyperDash":false},{"StartTime":24375.0,"Position":342.702942,"HyperDash":false},{"StartTime":24437.0,"Position":307.727,"HyperDash":false},{"StartTime":24500.0,"Position":254.618744,"HyperDash":false},{"StartTime":24562.0,"Position":219.823792,"HyperDash":false},{"StartTime":24625.0,"Position":195.842667,"HyperDash":false},{"StartTime":24750.0,"Position":124.114441,"HyperDash":false}]},{"StartTime":24875.0,"Objects":[{"StartTime":24875.0,"Position":72.0,"HyperDash":false},{"StartTime":24937.0,"Position":90.6446,"HyperDash":false},{"StartTime":25000.0,"Position":102.976662,"HyperDash":false},{"StartTime":25062.0,"Position":121.259918,"HyperDash":false},{"StartTime":25125.0,"Position":115.072632,"HyperDash":false},{"StartTime":25178.0,"Position":104.017952,"HyperDash":false},{"StartTime":25232.0,"Position":66.87554,"HyperDash":false},{"StartTime":25285.0,"Position":53.7148743,"HyperDash":false},{"StartTime":25374.0,"Position":0.0,"HyperDash":false}]},{"StartTime":25625.0,"Objects":[{"StartTime":25625.0,"Position":56.0,"HyperDash":false}]},{"StartTime":25875.0,"Objects":[{"StartTime":25875.0,"Position":176.0,"HyperDash":false}]},{"StartTime":26000.0,"Objects":[{"StartTime":26000.0,"Position":176.0,"HyperDash":false}]},{"StartTime":26125.0,"Objects":[{"StartTime":26125.0,"Position":176.0,"HyperDash":false}]},{"StartTime":26375.0,"Objects":[{"StartTime":26375.0,"Position":316.0,"HyperDash":false}]},{"StartTime":26625.0,"Objects":[{"StartTime":26625.0,"Position":464.0,"HyperDash":false},{"StartTime":26678.0,"Position":423.678864,"HyperDash":false},{"StartTime":26732.0,"Position":428.026764,"HyperDash":false},{"StartTime":26785.0,"Position":431.558746,"HyperDash":false},{"StartTime":26875.0,"Position":408.8022,"HyperDash":false}]},{"StartTime":27125.0,"Objects":[{"StartTime":27125.0,"Position":232.0,"HyperDash":false},{"StartTime":27178.0,"Position":266.0937,"HyperDash":false},{"StartTime":27232.0,"Position":284.472229,"HyperDash":false},{"StartTime":27285.0,"Position":289.223022,"HyperDash":false},{"StartTime":27374.0,"Position":288.2113,"HyperDash":false}]},{"StartTime":27625.0,"Objects":[{"StartTime":27625.0,"Position":136.0,"HyperDash":false}]},{"StartTime":27875.0,"Objects":[{"StartTime":27875.0,"Position":60.0,"HyperDash":false}]},{"StartTime":28125.0,"Objects":[{"StartTime":28125.0,"Position":212.0,"HyperDash":false},{"StartTime":28250.0,"Position":244.219086,"HyperDash":false}]},{"StartTime":28500.0,"Objects":[{"StartTime":28500.0,"Position":340.0,"HyperDash":false},{"StartTime":28625.0,"Position":372.2191,"HyperDash":false}]},{"StartTime":28875.0,"Objects":[{"StartTime":28875.0,"Position":256.0,"HyperDash":false},{"StartTime":29000.0,"Position":223.780914,"HyperDash":false}]},{"StartTime":29250.0,"Objects":[{"StartTime":29250.0,"Position":128.0,"HyperDash":false},{"StartTime":29375.0,"Position":95.7809143,"HyperDash":false}]},{"StartTime":29625.0,"Objects":[{"StartTime":29625.0,"Position":238.0,"HyperDash":false},{"StartTime":29678.0,"Position":279.04657,"HyperDash":false},{"StartTime":29731.0,"Position":322.09314,"HyperDash":false},{"StartTime":29784.0,"Position":325.1397,"HyperDash":false},{"StartTime":29874.0,"Position":397.954651,"HyperDash":false}]},{"StartTime":30125.0,"Objects":[{"StartTime":30125.0,"Position":512.0,"HyperDash":false}]},{"StartTime":30250.0,"Objects":[{"StartTime":30250.0,"Position":512.0,"HyperDash":false}]},{"StartTime":30500.0,"Objects":[{"StartTime":30500.0,"Position":416.0,"HyperDash":false}]},{"StartTime":30625.0,"Objects":[{"StartTime":30625.0,"Position":416.0,"HyperDash":false}]},{"StartTime":30875.0,"Objects":[{"StartTime":30875.0,"Position":300.0,"HyperDash":false}]},{"StartTime":31000.0,"Objects":[{"StartTime":31000.0,"Position":300.0,"HyperDash":false}]},{"StartTime":31250.0,"Objects":[{"StartTime":31250.0,"Position":236.0,"HyperDash":false}]},{"StartTime":31375.0,"Objects":[{"StartTime":31375.0,"Position":236.0,"HyperDash":false}]},{"StartTime":31625.0,"Objects":[{"StartTime":31625.0,"Position":152.0,"HyperDash":false}]},{"StartTime":31875.0,"Objects":[{"StartTime":31875.0,"Position":300.0,"HyperDash":false}]},{"StartTime":32125.0,"Objects":[{"StartTime":32125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":34625.0,"Objects":[{"StartTime":34625.0,"Position":52.0,"HyperDash":false}]},{"StartTime":34875.0,"Objects":[{"StartTime":34875.0,"Position":152.0,"HyperDash":false}]},{"StartTime":35125.0,"Objects":[{"StartTime":35125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":35625.0,"Objects":[{"StartTime":35625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":36125.0,"Objects":[{"StartTime":36125.0,"Position":256.0,"HyperDash":false},{"StartTime":36178.0,"Position":285.74295,"HyperDash":false},{"StartTime":36232.0,"Position":306.695557,"HyperDash":false},{"StartTime":36285.0,"Position":338.9461,"HyperDash":false},{"StartTime":36375.0,"Position":338.0262,"HyperDash":false}]},{"StartTime":36625.0,"Objects":[{"StartTime":36625.0,"Position":320.0,"HyperDash":false}]},{"StartTime":36875.0,"Objects":[{"StartTime":36875.0,"Position":204.0,"HyperDash":false}]},{"StartTime":37125.0,"Objects":[{"StartTime":37125.0,"Position":104.0,"HyperDash":false},{"StartTime":37178.0,"Position":84.88513,"HyperDash":false},{"StartTime":37232.0,"Position":58.02897,"HyperDash":false},{"StartTime":37285.0,"Position":32.3897247,"HyperDash":false},{"StartTime":37375.0,"Position":42.93435,"HyperDash":false}]},{"StartTime":37625.0,"Objects":[{"StartTime":37625.0,"Position":92.0,"HyperDash":false}]},{"StartTime":37875.0,"Objects":[{"StartTime":37875.0,"Position":212.0,"HyperDash":false}]},{"StartTime":38000.0,"Objects":[{"StartTime":38000.0,"Position":268.0,"HyperDash":false}]},{"StartTime":38125.0,"Objects":[{"StartTime":38125.0,"Position":324.0,"HyperDash":false},{"StartTime":38178.0,"Position":338.3627,"HyperDash":false},{"StartTime":38232.0,"Position":380.1851,"HyperDash":false},{"StartTime":38285.0,"Position":411.5478,"HyperDash":false},{"StartTime":38375.0,"Position":438.918457,"HyperDash":false}]},{"StartTime":38625.0,"Objects":[{"StartTime":38625.0,"Position":504.0,"HyperDash":false}]},{"StartTime":38875.0,"Objects":[{"StartTime":38875.0,"Position":364.0,"HyperDash":false}]},{"StartTime":39125.0,"Objects":[{"StartTime":39125.0,"Position":232.0,"HyperDash":false},{"StartTime":39187.0,"Position":199.986359,"HyperDash":false},{"StartTime":39250.0,"Position":169.811844,"HyperDash":false},{"StartTime":39312.0,"Position":133.274048,"HyperDash":false},{"StartTime":39375.0,"Position":115.502953,"HyperDash":false},{"StartTime":39437.0,"Position":95.79658,"HyperDash":false},{"StartTime":39500.0,"Position":126.272606,"HyperDash":false},{"StartTime":39562.0,"Position":153.43367,"HyperDash":false},{"StartTime":39625.0,"Position":177.594223,"HyperDash":false},{"StartTime":39687.0,"Position":138.43367,"HyperDash":false},{"StartTime":39750.0,"Position":126.007256,"HyperDash":false},{"StartTime":39812.0,"Position":110.796577,"HyperDash":false},{"StartTime":39875.0,"Position":115.652954,"HyperDash":false},{"StartTime":39928.0,"Position":111.270706,"HyperDash":false},{"StartTime":39982.0,"Position":160.599289,"HyperDash":false},{"StartTime":40035.0,"Position":158.120911,"HyperDash":false},{"StartTime":40124.0,"Position":232.0,"HyperDash":false}]},{"StartTime":40375.0,"Objects":[{"StartTime":40375.0,"Position":280.0,"HyperDash":false}]},{"StartTime":40625.0,"Objects":[{"StartTime":40625.0,"Position":400.0,"HyperDash":false},{"StartTime":40678.0,"Position":429.074829,"HyperDash":false},{"StartTime":40732.0,"Position":455.5662,"HyperDash":false},{"StartTime":40785.0,"Position":457.641022,"HyperDash":false},{"StartTime":40875.0,"Position":504.126617,"HyperDash":false}]},{"StartTime":41125.0,"Objects":[{"StartTime":41125.0,"Position":480.0,"HyperDash":false}]},{"StartTime":41375.0,"Objects":[{"StartTime":41375.0,"Position":324.0,"HyperDash":false}]},{"StartTime":41625.0,"Objects":[{"StartTime":41625.0,"Position":168.0,"HyperDash":false}]},{"StartTime":41875.0,"Objects":[{"StartTime":41875.0,"Position":72.0,"HyperDash":false}]},{"StartTime":42000.0,"Objects":[{"StartTime":42000.0,"Position":48.0,"HyperDash":false}]},{"StartTime":42125.0,"Objects":[{"StartTime":42125.0,"Position":96.0,"HyperDash":false},{"StartTime":42178.0,"Position":114.931221,"HyperDash":false},{"StartTime":42232.0,"Position":153.604843,"HyperDash":false},{"StartTime":42285.0,"Position":193.4396,"HyperDash":false},{"StartTime":42374.0,"Position":240.778946,"HyperDash":false}]},{"StartTime":42625.0,"Objects":[{"StartTime":42625.0,"Position":400.0,"HyperDash":false}]},{"StartTime":42875.0,"Objects":[{"StartTime":42875.0,"Position":440.0,"HyperDash":false}]},{"StartTime":43000.0,"Objects":[{"StartTime":43000.0,"Position":464.0,"HyperDash":false}]},{"StartTime":43125.0,"Objects":[{"StartTime":43125.0,"Position":416.0,"HyperDash":false},{"StartTime":43178.0,"Position":375.182983,"HyperDash":false},{"StartTime":43232.0,"Position":366.663025,"HyperDash":false},{"StartTime":43285.0,"Position":335.968475,"HyperDash":false},{"StartTime":43375.0,"Position":271.221039,"HyperDash":false}]},{"StartTime":43625.0,"Objects":[{"StartTime":43625.0,"Position":112.0,"HyperDash":false}]},{"StartTime":43875.0,"Objects":[{"StartTime":43875.0,"Position":140.0,"HyperDash":false}]},{"StartTime":44125.0,"Objects":[{"StartTime":44125.0,"Position":52.0,"HyperDash":false}]},{"StartTime":44375.0,"Objects":[{"StartTime":44375.0,"Position":208.0,"HyperDash":false}]},{"StartTime":44625.0,"Objects":[{"StartTime":44625.0,"Position":344.0,"HyperDash":false}]},{"StartTime":44875.0,"Objects":[{"StartTime":44875.0,"Position":448.0,"HyperDash":false},{"StartTime":44937.0,"Position":411.344635,"HyperDash":false},{"StartTime":45000.0,"Position":386.572845,"HyperDash":false},{"StartTime":45062.0,"Position":355.1799,"HyperDash":false},{"StartTime":45125.0,"Position":304.139374,"HyperDash":false},{"StartTime":45187.0,"Position":271.8332,"HyperDash":false},{"StartTime":45250.0,"Position":232.840988,"HyperDash":false},{"StartTime":45312.0,"Position":235.629944,"HyperDash":false},{"StartTime":45375.0,"Position":232.882874,"HyperDash":false},{"StartTime":45437.0,"Position":251.629944,"HyperDash":false},{"StartTime":45500.0,"Position":243.152222,"HyperDash":false},{"StartTime":45562.0,"Position":270.8332,"HyperDash":false},{"StartTime":45625.0,"Position":304.729126,"HyperDash":false},{"StartTime":45678.0,"Position":323.441345,"HyperDash":false},{"StartTime":45732.0,"Position":370.914246,"HyperDash":false},{"StartTime":45785.0,"Position":421.2586,"HyperDash":false},{"StartTime":45874.0,"Position":448.0,"HyperDash":false}]},{"StartTime":46125.0,"Objects":[{"StartTime":46125.0,"Position":326.0,"HyperDash":false},{"StartTime":46187.0,"Position":309.377716,"HyperDash":false},{"StartTime":46250.0,"Position":271.650543,"HyperDash":false},{"StartTime":46312.0,"Position":219.299332,"HyperDash":false},{"StartTime":46375.0,"Position":182.286819,"HyperDash":false},{"StartTime":46428.0,"Position":144.357529,"HyperDash":false},{"StartTime":46482.0,"Position":145.0256,"HyperDash":false},{"StartTime":46535.0,"Position":101.934631,"HyperDash":false},{"StartTime":46625.0,"Position":110.882874,"HyperDash":false}]},{"StartTime":46875.0,"Objects":[{"StartTime":46875.0,"Position":230.0,"HyperDash":false},{"StartTime":46937.0,"Position":247.622284,"HyperDash":false},{"StartTime":47000.0,"Position":299.3495,"HyperDash":false},{"StartTime":47062.0,"Position":322.700653,"HyperDash":false},{"StartTime":47125.0,"Position":373.7132,"HyperDash":false},{"StartTime":47178.0,"Position":390.642456,"HyperDash":false},{"StartTime":47232.0,"Position":424.974426,"HyperDash":false},{"StartTime":47285.0,"Position":428.065369,"HyperDash":false},{"StartTime":47375.0,"Position":445.1171,"HyperDash":false}]},{"StartTime":47625.0,"Objects":[{"StartTime":47625.0,"Position":376.0,"HyperDash":false}]},{"StartTime":48125.0,"Objects":[{"StartTime":48125.0,"Position":376.0,"HyperDash":false},{"StartTime":48178.0,"Position":340.223816,"HyperDash":false},{"StartTime":48232.0,"Position":305.204224,"HyperDash":false},{"StartTime":48285.0,"Position":270.449249,"HyperDash":false},{"StartTime":48375.0,"Position":222.9901,"HyperDash":false}]},{"StartTime":48625.0,"Objects":[{"StartTime":48625.0,"Position":84.0,"HyperDash":false}]},{"StartTime":48875.0,"Objects":[{"StartTime":48875.0,"Position":152.0,"HyperDash":false}]},{"StartTime":49125.0,"Objects":[{"StartTime":49125.0,"Position":44.0,"HyperDash":false},{"StartTime":49178.0,"Position":69.96314,"HyperDash":false},{"StartTime":49232.0,"Position":103.8065,"HyperDash":false},{"StartTime":49285.0,"Position":156.7781,"HyperDash":false},{"StartTime":49374.0,"Position":197.1017,"HyperDash":false}]},{"StartTime":49625.0,"Objects":[{"StartTime":49625.0,"Position":336.0,"HyperDash":false}]},{"StartTime":49875.0,"Objects":[{"StartTime":49875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":50125.0,"Objects":[{"StartTime":50125.0,"Position":176.0,"HyperDash":false}]},{"StartTime":50625.0,"Objects":[{"StartTime":50625.0,"Position":340.0,"HyperDash":false}]},{"StartTime":50875.0,"Objects":[{"StartTime":50875.0,"Position":420.0,"HyperDash":false}]},{"StartTime":51125.0,"Objects":[{"StartTime":51125.0,"Position":500.0,"HyperDash":false}]},{"StartTime":51625.0,"Objects":[{"StartTime":51625.0,"Position":172.0,"HyperDash":false}]},{"StartTime":51875.0,"Objects":[{"StartTime":51875.0,"Position":92.0,"HyperDash":false}]},{"StartTime":52125.0,"Objects":[{"StartTime":52125.0,"Position":12.0,"HyperDash":false},{"StartTime":52178.0,"Position":43.4575653,"HyperDash":false},{"StartTime":52232.0,"Position":57.4520721,"HyperDash":false},{"StartTime":52285.0,"Position":85.90964,"HyperDash":false},{"StartTime":52375.0,"Position":146.23381,"HyperDash":false}]},{"StartTime":52625.0,"Objects":[{"StartTime":52625.0,"Position":304.0,"HyperDash":false}]},{"StartTime":52875.0,"Objects":[{"StartTime":52875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":53125.0,"Objects":[{"StartTime":53125.0,"Position":216.0,"HyperDash":false},{"StartTime":53178.0,"Position":229.457565,"HyperDash":false},{"StartTime":53232.0,"Position":269.452057,"HyperDash":false},{"StartTime":53285.0,"Position":304.909637,"HyperDash":false},{"StartTime":53375.0,"Position":350.233826,"HyperDash":false}]},{"StartTime":53625.0,"Objects":[{"StartTime":53625.0,"Position":508.0,"HyperDash":false}]},{"StartTime":53875.0,"Objects":[{"StartTime":53875.0,"Position":460.0,"HyperDash":false}]},{"StartTime":54125.0,"Objects":[{"StartTime":54125.0,"Position":344.0,"HyperDash":false}]},{"StartTime":54375.0,"Objects":[{"StartTime":54375.0,"Position":228.0,"HyperDash":false}]},{"StartTime":54625.0,"Objects":[{"StartTime":54625.0,"Position":153.0,"HyperDash":false}]},{"StartTime":54875.0,"Objects":[{"StartTime":54875.0,"Position":72.0,"HyperDash":false}]},{"StartTime":55125.0,"Objects":[{"StartTime":55125.0,"Position":180.0,"HyperDash":false}]},{"StartTime":55375.0,"Objects":[{"StartTime":55375.0,"Position":284.0,"HyperDash":false}]},{"StartTime":55625.0,"Objects":[{"StartTime":55625.0,"Position":359.0,"HyperDash":false}]},{"StartTime":55875.0,"Objects":[{"StartTime":55875.0,"Position":440.0,"HyperDash":false}]},{"StartTime":56125.0,"Objects":[{"StartTime":56125.0,"Position":352.0,"HyperDash":false},{"StartTime":56178.0,"Position":355.0677,"HyperDash":false},{"StartTime":56231.0,"Position":396.135376,"HyperDash":false},{"StartTime":56284.0,"Position":431.2031,"HyperDash":false},{"StartTime":56374.0,"Position":455.6765,"HyperDash":false}]},{"StartTime":56625.0,"Objects":[{"StartTime":56625.0,"Position":312.0,"HyperDash":false}]},{"StartTime":56875.0,"Objects":[{"StartTime":56875.0,"Position":200.0,"HyperDash":false}]},{"StartTime":57125.0,"Objects":[{"StartTime":57125.0,"Position":160.0,"HyperDash":false},{"StartTime":57178.0,"Position":134.932312,"HyperDash":false},{"StartTime":57231.0,"Position":131.864609,"HyperDash":false},{"StartTime":57284.0,"Position":84.7969055,"HyperDash":false},{"StartTime":57374.0,"Position":56.32347,"HyperDash":false}]},{"StartTime":57625.0,"Objects":[{"StartTime":57625.0,"Position":200.0,"HyperDash":false}]},{"StartTime":57875.0,"Objects":[{"StartTime":57875.0,"Position":312.0,"HyperDash":false}]},{"StartTime":58125.0,"Objects":[{"StartTime":58125.0,"Position":444.0,"HyperDash":false},{"StartTime":58178.0,"Position":405.081421,"HyperDash":false},{"StartTime":58232.0,"Position":380.062256,"HyperDash":false},{"StartTime":58285.0,"Position":399.193085,"HyperDash":false},{"StartTime":58374.0,"Position":377.6735,"HyperDash":false}]},{"StartTime":58500.0,"Objects":[{"StartTime":58500.0,"Position":344.0,"HyperDash":false}]},{"StartTime":58625.0,"Objects":[{"StartTime":58625.0,"Position":272.0,"HyperDash":false},{"StartTime":58678.0,"Position":263.870544,"HyperDash":false},{"StartTime":58732.0,"Position":246.779541,"HyperDash":false},{"StartTime":58785.0,"Position":179.497513,"HyperDash":false},{"StartTime":58875.0,"Position":139.25528,"HyperDash":false}]},{"StartTime":59125.0,"Objects":[{"StartTime":59125.0,"Position":68.0,"HyperDash":false},{"StartTime":59178.0,"Position":89.57149,"HyperDash":false},{"StartTime":59232.0,"Position":123.207489,"HyperDash":false},{"StartTime":59285.0,"Position":141.936157,"HyperDash":false},{"StartTime":59375.0,"Position":133.961975,"HyperDash":false}]},{"StartTime":59500.0,"Objects":[{"StartTime":59500.0,"Position":168.0,"HyperDash":false}]},{"StartTime":59625.0,"Objects":[{"StartTime":59625.0,"Position":240.0,"HyperDash":false},{"StartTime":59678.0,"Position":245.129486,"HyperDash":false},{"StartTime":59732.0,"Position":270.220459,"HyperDash":false},{"StartTime":59785.0,"Position":296.5025,"HyperDash":false},{"StartTime":59875.0,"Position":372.74472,"HyperDash":false}]},{"StartTime":60125.0,"Objects":[{"StartTime":60125.0,"Position":456.0,"HyperDash":false}]},{"StartTime":60375.0,"Objects":[{"StartTime":60375.0,"Position":328.0,"HyperDash":false}]},{"StartTime":60625.0,"Objects":[{"StartTime":60625.0,"Position":216.0,"HyperDash":false}]},{"StartTime":60875.0,"Objects":[{"StartTime":60875.0,"Position":72.0,"HyperDash":false},{"StartTime":60937.0,"Position":71.25553,"HyperDash":false},{"StartTime":61000.0,"Position":61.5583878,"HyperDash":false},{"StartTime":61062.0,"Position":98.84126,"HyperDash":false},{"StartTime":61125.0,"Position":119.510284,"HyperDash":false},{"StartTime":61187.0,"Position":142.845825,"HyperDash":false},{"StartTime":61250.0,"Position":184.319992,"HyperDash":false},{"StartTime":61312.0,"Position":240.90744,"HyperDash":false},{"StartTime":61375.0,"Position":269.728363,"HyperDash":false},{"StartTime":61437.0,"Position":239.90744,"HyperDash":false},{"StartTime":61500.0,"Position":197.687851,"HyperDash":false},{"StartTime":61562.0,"Position":150.845825,"HyperDash":false},{"StartTime":61625.0,"Position":119.024872,"HyperDash":false},{"StartTime":61678.0,"Position":90.12531,"HyperDash":false},{"StartTime":61732.0,"Position":72.3374557,"HyperDash":false},{"StartTime":61785.0,"Position":89.06496,"HyperDash":false},{"StartTime":61874.0,"Position":72.0,"HyperDash":false}]},{"StartTime":62125.0,"Objects":[{"StartTime":62125.0,"Position":200.0,"HyperDash":false},{"StartTime":62187.0,"Position":191.234039,"HyperDash":false},{"StartTime":62250.0,"Position":203.319962,"HyperDash":false},{"StartTime":62312.0,"Position":235.3192,"HyperDash":false},{"StartTime":62375.0,"Position":246.7092,"HyperDash":false},{"StartTime":62428.0,"Position":291.675018,"HyperDash":false},{"StartTime":62482.0,"Position":309.9024,"HyperDash":false},{"StartTime":62535.0,"Position":336.449463,"HyperDash":false},{"StartTime":62625.0,"Position":396.8608,"HyperDash":false}]},{"StartTime":62875.0,"Objects":[{"StartTime":62875.0,"Position":480.0,"HyperDash":false},{"StartTime":62937.0,"Position":492.1737,"HyperDash":false},{"StartTime":63000.0,"Position":476.1641,"HyperDash":false},{"StartTime":63062.0,"Position":475.045135,"HyperDash":false},{"StartTime":63125.0,"Position":433.461975,"HyperDash":false},{"StartTime":63178.0,"Position":389.354034,"HyperDash":false},{"StartTime":63232.0,"Position":366.034546,"HyperDash":false},{"StartTime":63285.0,"Position":321.454956,"HyperDash":false},{"StartTime":63375.0,"Position":283.111176,"HyperDash":false}]},{"StartTime":63625.0,"Objects":[{"StartTime":63625.0,"Position":136.0,"HyperDash":false},{"StartTime":63678.0,"Position":111.887825,"HyperDash":false},{"StartTime":63732.0,"Position":108.904541,"HyperDash":false},{"StartTime":63785.0,"Position":105.234535,"HyperDash":false},{"StartTime":63874.0,"Position":128.127991,"HyperDash":false}]},{"StartTime":64125.0,"Objects":[{"StartTime":64125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":64375.0,"Objects":[{"StartTime":64375.0,"Position":284.0,"HyperDash":false}]},{"StartTime":64625.0,"Objects":[{"StartTime":64625.0,"Position":440.0,"HyperDash":false}]},{"StartTime":64875.0,"Objects":[{"StartTime":64875.0,"Position":420.0,"HyperDash":false}]},{"StartTime":65125.0,"Objects":[{"StartTime":65125.0,"Position":300.0,"HyperDash":false}]},{"StartTime":65375.0,"Objects":[{"StartTime":65375.0,"Position":272.0,"HyperDash":false}]},{"StartTime":65625.0,"Objects":[{"StartTime":65625.0,"Position":116.0,"HyperDash":false}]},{"StartTime":65875.0,"Objects":[{"StartTime":65875.0,"Position":136.0,"HyperDash":false}]},{"StartTime":66125.0,"Objects":[{"StartTime":66125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":68125.0,"Objects":[{"StartTime":68125.0,"Position":256.0,"HyperDash":false},{"StartTime":68187.0,"Position":266.157,"HyperDash":false},{"StartTime":68250.0,"Position":280.344269,"HyperDash":false},{"StartTime":68312.0,"Position":243.4508,"HyperDash":false},{"StartTime":68375.0,"Position":216.9601,"HyperDash":false},{"StartTime":68428.0,"Position":173.102234,"HyperDash":false},{"StartTime":68482.0,"Position":150.915558,"HyperDash":false},{"StartTime":68535.0,"Position":106.794662,"HyperDash":false},{"StartTime":68625.0,"Position":73.61266,"HyperDash":false}]},{"StartTime":68875.0,"Objects":[{"StartTime":68875.0,"Position":132.0,"HyperDash":false},{"StartTime":68937.0,"Position":160.783325,"HyperDash":false},{"StartTime":69000.0,"Position":193.9825,"HyperDash":false},{"StartTime":69062.0,"Position":205.765823,"HyperDash":false},{"StartTime":69125.0,"Position":235.965,"HyperDash":false},{"StartTime":69178.0,"Position":262.005585,"HyperDash":false},{"StartTime":69232.0,"Position":285.462,"HyperDash":false},{"StartTime":69285.0,"Position":302.5026,"HyperDash":false},{"StartTime":69375.0,"Position":339.93,"HyperDash":false}]},{"StartTime":69625.0,"Objects":[{"StartTime":69625.0,"Position":456.0,"HyperDash":false}]},{"StartTime":69875.0,"Objects":[{"StartTime":69875.0,"Position":340.0,"HyperDash":false}]},{"StartTime":70000.0,"Objects":[{"StartTime":70000.0,"Position":340.0,"HyperDash":false}]},{"StartTime":70125.0,"Objects":[{"StartTime":70125.0,"Position":340.0,"HyperDash":false}]},{"StartTime":70375.0,"Objects":[{"StartTime":70375.0,"Position":228.0,"HyperDash":false}]},{"StartTime":70625.0,"Objects":[{"StartTime":70625.0,"Position":256.0,"HyperDash":false},{"StartTime":70678.0,"Position":210.6065,"HyperDash":false},{"StartTime":70732.0,"Position":177.325424,"HyperDash":false},{"StartTime":70785.0,"Position":151.573288,"HyperDash":false},{"StartTime":70875.0,"Position":107.425896,"HyperDash":false}]},{"StartTime":71125.0,"Objects":[{"StartTime":71125.0,"Position":148.0,"HyperDash":false},{"StartTime":71178.0,"Position":184.328445,"HyperDash":false},{"StartTime":71232.0,"Position":200.780228,"HyperDash":false},{"StartTime":71285.0,"Position":257.6842,"HyperDash":false},{"StartTime":71374.0,"Position":296.433563,"HyperDash":false}]},{"StartTime":71625.0,"Objects":[{"StartTime":71625.0,"Position":424.0,"HyperDash":false}]},{"StartTime":71875.0,"Objects":[{"StartTime":71875.0,"Position":336.0,"HyperDash":false}]},{"StartTime":72000.0,"Objects":[{"StartTime":72000.0,"Position":336.0,"HyperDash":false}]},{"StartTime":72125.0,"Objects":[{"StartTime":72125.0,"Position":336.0,"HyperDash":false}]},{"StartTime":72375.0,"Objects":[{"StartTime":72375.0,"Position":228.0,"HyperDash":false},{"StartTime":72428.0,"Position":211.104858,"HyperDash":false},{"StartTime":72482.0,"Position":163.608932,"HyperDash":false},{"StartTime":72535.0,"Position":134.045914,"HyperDash":false},{"StartTime":72625.0,"Position":143.764755,"HyperDash":false}]},{"StartTime":72875.0,"Objects":[{"StartTime":72875.0,"Position":268.0,"HyperDash":false},{"StartTime":72937.0,"Position":248.6492,"HyperDash":false},{"StartTime":73000.0,"Position":273.503021,"HyperDash":false},{"StartTime":73062.0,"Position":247.768143,"HyperDash":false},{"StartTime":73125.0,"Position":228.062622,"HyperDash":false},{"StartTime":73178.0,"Position":204.959824,"HyperDash":false},{"StartTime":73232.0,"Position":170.633987,"HyperDash":false},{"StartTime":73285.0,"Position":155.368179,"HyperDash":false},{"StartTime":73375.0,"Position":103.8164,"HyperDash":false}]},{"StartTime":73625.0,"Objects":[{"StartTime":73625.0,"Position":24.0,"HyperDash":false}]},{"StartTime":73875.0,"Objects":[{"StartTime":73875.0,"Position":92.0,"HyperDash":false}]},{"StartTime":74000.0,"Objects":[{"StartTime":74000.0,"Position":92.0,"HyperDash":false}]},{"StartTime":74125.0,"Objects":[{"StartTime":74125.0,"Position":92.0,"HyperDash":false}]},{"StartTime":74375.0,"Objects":[{"StartTime":74375.0,"Position":224.0,"HyperDash":false}]},{"StartTime":74625.0,"Objects":[{"StartTime":74625.0,"Position":340.0,"HyperDash":false},{"StartTime":74678.0,"Position":381.308228,"HyperDash":false},{"StartTime":74732.0,"Position":376.477844,"HyperDash":false},{"StartTime":74785.0,"Position":399.771942,"HyperDash":false},{"StartTime":74875.0,"Position":387.2963,"HyperDash":false}]},{"StartTime":75125.0,"Objects":[{"StartTime":75125.0,"Position":268.0,"HyperDash":false},{"StartTime":75178.0,"Position":219.691772,"HyperDash":false},{"StartTime":75232.0,"Position":224.522156,"HyperDash":false},{"StartTime":75285.0,"Position":185.228043,"HyperDash":false},{"StartTime":75375.0,"Position":220.70369,"HyperDash":false}]},{"StartTime":75625.0,"Objects":[{"StartTime":75625.0,"Position":268.0,"HyperDash":false},{"StartTime":75678.0,"Position":251.437485,"HyperDash":false},{"StartTime":75732.0,"Position":209.2417,"HyperDash":false},{"StartTime":75785.0,"Position":166.6792,"HyperDash":false},{"StartTime":75875.0,"Position":109.686234,"HyperDash":false}]},{"StartTime":76125.0,"Objects":[{"StartTime":76125.0,"Position":24.0,"HyperDash":false},{"StartTime":76250.0,"Position":103.510704,"HyperDash":false}]},{"StartTime":76375.0,"Objects":[{"StartTime":76375.0,"Position":176.0,"HyperDash":false}]},{"StartTime":76625.0,"Objects":[{"StartTime":76625.0,"Position":348.0,"HyperDash":false}]},{"StartTime":76875.0,"Objects":[{"StartTime":76875.0,"Position":248.0,"HyperDash":false}]},{"StartTime":77125.0,"Objects":[{"StartTime":77125.0,"Position":264.0,"HyperDash":false}]},{"StartTime":77375.0,"Objects":[{"StartTime":77375.0,"Position":324.0,"HyperDash":false}]},{"StartTime":77625.0,"Objects":[{"StartTime":77625.0,"Position":180.0,"HyperDash":false}]},{"StartTime":77875.0,"Objects":[{"StartTime":77875.0,"Position":240.0,"HyperDash":false}]},{"StartTime":78125.0,"Objects":[{"StartTime":78125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":78375.0,"Objects":[{"StartTime":78375.0,"Position":100.0,"HyperDash":false}]},{"StartTime":78625.0,"Objects":[{"StartTime":78625.0,"Position":8.0,"HyperDash":false},{"StartTime":78678.0,"Position":30.0805969,"HyperDash":false},{"StartTime":78732.0,"Position":72.26928,"HyperDash":false},{"StartTime":78785.0,"Position":94.77067,"HyperDash":false},{"StartTime":78874.0,"Position":149.724487,"HyperDash":false}]},{"StartTime":79125.0,"Objects":[{"StartTime":79125.0,"Position":304.0,"HyperDash":false},{"StartTime":79178.0,"Position":282.0235,"HyperDash":false},{"StartTime":79232.0,"Position":238.981018,"HyperDash":false},{"StartTime":79285.0,"Position":222.634567,"HyperDash":false},{"StartTime":79375.0,"Position":162.2755,"HyperDash":false}]},{"StartTime":79625.0,"Objects":[{"StartTime":79625.0,"Position":304.0,"HyperDash":false}]},{"StartTime":79875.0,"Objects":[{"StartTime":79875.0,"Position":460.0,"HyperDash":false}]},{"StartTime":80125.0,"Objects":[{"StartTime":80125.0,"Position":420.0,"HyperDash":false},{"StartTime":80250.0,"Position":340.0,"HyperDash":false}]},{"StartTime":80375.0,"Objects":[{"StartTime":80375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":80625.0,"Objects":[{"StartTime":80625.0,"Position":344.0,"HyperDash":false}]},{"StartTime":80875.0,"Objects":[{"StartTime":80875.0,"Position":168.0,"HyperDash":false}]},{"StartTime":81125.0,"Objects":[{"StartTime":81125.0,"Position":384.0,"HyperDash":false}]},{"StartTime":81375.0,"Objects":[{"StartTime":81375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":81625.0,"Objects":[{"StartTime":81625.0,"Position":168.0,"HyperDash":false}]},{"StartTime":81875.0,"Objects":[{"StartTime":81875.0,"Position":344.0,"HyperDash":false}]},{"StartTime":82125.0,"Objects":[{"StartTime":82125.0,"Position":128.0,"HyperDash":false}]},{"StartTime":82250.0,"Objects":[{"StartTime":82250.0,"Position":48.0,"HyperDash":false},{"StartTime":82303.0,"Position":38.86482,"HyperDash":false},{"StartTime":82357.0,"Position":53.93512,"HyperDash":false},{"StartTime":82410.0,"Position":60.0134125,"HyperDash":false},{"StartTime":82500.0,"Position":124.821884,"HyperDash":false}]},{"StartTime":82625.0,"Objects":[{"StartTime":82625.0,"Position":204.0,"HyperDash":false},{"StartTime":82678.0,"Position":208.888657,"HyperDash":false},{"StartTime":82731.0,"Position":211.78508,"HyperDash":false},{"StartTime":82784.0,"Position":215.863892,"HyperDash":false},{"StartTime":82874.0,"Position":280.821869,"HyperDash":false}]},{"StartTime":83000.0,"Objects":[{"StartTime":83000.0,"Position":352.0,"HyperDash":false},{"StartTime":83053.0,"Position":303.246552,"HyperDash":false},{"StartTime":83107.0,"Position":291.2771,"HyperDash":false},{"StartTime":83160.0,"Position":254.710571,"HyperDash":false},{"StartTime":83250.0,"Position":222.496063,"HyperDash":false}]},{"StartTime":83375.0,"Objects":[{"StartTime":83375.0,"Position":192.0,"HyperDash":false},{"StartTime":83428.0,"Position":152.246567,"HyperDash":false},{"StartTime":83482.0,"Position":112.277092,"HyperDash":false},{"StartTime":83535.0,"Position":87.71058,"HyperDash":false},{"StartTime":83625.0,"Position":62.496067,"HyperDash":false}]},{"StartTime":83875.0,"Objects":[{"StartTime":83875.0,"Position":32.0,"HyperDash":false}]},{"StartTime":84125.0,"Objects":[{"StartTime":84125.0,"Position":172.0,"HyperDash":false}]},{"StartTime":84250.0,"Objects":[{"StartTime":84250.0,"Position":179.0,"HyperDash":false},{"StartTime":84308.0,"Position":278.0,"HyperDash":false},{"StartTime":84367.0,"Position":474.0,"HyperDash":false},{"StartTime":84425.0,"Position":50.0,"HyperDash":false},{"StartTime":84484.0,"Position":458.0,"HyperDash":false},{"StartTime":84542.0,"Position":425.0,"HyperDash":false},{"StartTime":84601.0,"Position":466.0,"HyperDash":false},{"StartTime":84660.0,"Position":56.0,"HyperDash":false},{"StartTime":84718.0,"Position":109.0,"HyperDash":false},{"StartTime":84777.0,"Position":482.0,"HyperDash":false},{"StartTime":84835.0,"Position":147.0,"HyperDash":false},{"StartTime":84894.0,"Position":285.0,"HyperDash":false},{"StartTime":84953.0,"Position":452.0,"HyperDash":false},{"StartTime":85011.0,"Position":419.0,"HyperDash":false},{"StartTime":85070.0,"Position":269.0,"HyperDash":false},{"StartTime":85128.0,"Position":249.0,"HyperDash":false},{"StartTime":85187.0,"Position":233.0,"HyperDash":false},{"StartTime":85246.0,"Position":449.0,"HyperDash":false},{"StartTime":85304.0,"Position":411.0,"HyperDash":false},{"StartTime":85363.0,"Position":75.0,"HyperDash":false},{"StartTime":85421.0,"Position":474.0,"HyperDash":false},{"StartTime":85480.0,"Position":176.0,"HyperDash":false},{"StartTime":85539.0,"Position":1.0,"HyperDash":false},{"StartTime":85597.0,"Position":37.0,"HyperDash":false},{"StartTime":85656.0,"Position":481.0,"HyperDash":false},{"StartTime":85714.0,"Position":375.0,"HyperDash":false},{"StartTime":85773.0,"Position":407.0,"HyperDash":false},{"StartTime":85832.0,"Position":231.0,"HyperDash":false},{"StartTime":85890.0,"Position":338.0,"HyperDash":false},{"StartTime":85949.0,"Position":322.0,"HyperDash":false},{"StartTime":86007.0,"Position":347.0,"HyperDash":false},{"StartTime":86066.0,"Position":365.0,"HyperDash":false},{"StartTime":86125.0,"Position":453.0,"HyperDash":false}]},{"StartTime":86250.0,"Objects":[{"StartTime":86250.0,"Position":486.0,"HyperDash":false},{"StartTime":86304.0,"Position":68.0,"HyperDash":false},{"StartTime":86359.0,"Position":498.0,"HyperDash":false},{"StartTime":86414.0,"Position":164.0,"HyperDash":false},{"StartTime":86468.0,"Position":1.0,"HyperDash":false},{"StartTime":86523.0,"Position":501.0,"HyperDash":false},{"StartTime":86578.0,"Position":82.0,"HyperDash":false},{"StartTime":86632.0,"Position":494.0,"HyperDash":false},{"StartTime":86687.0,"Position":479.0,"HyperDash":false},{"StartTime":86742.0,"Position":373.0,"HyperDash":false},{"StartTime":86796.0,"Position":450.0,"HyperDash":false},{"StartTime":86851.0,"Position":144.0,"HyperDash":false},{"StartTime":86906.0,"Position":365.0,"HyperDash":false},{"StartTime":86960.0,"Position":285.0,"HyperDash":false},{"StartTime":87015.0,"Position":45.0,"HyperDash":false},{"StartTime":87070.0,"Position":65.0,"HyperDash":false},{"StartTime":87125.0,"Position":337.0,"HyperDash":false}]},{"StartTime":88125.0,"Objects":[{"StartTime":88125.0,"Position":256.0,"HyperDash":false},{"StartTime":88178.0,"Position":292.30423,"HyperDash":false},{"StartTime":88232.0,"Position":341.450134,"HyperDash":false},{"StartTime":88285.0,"Position":358.591034,"HyperDash":false},{"StartTime":88375.0,"Position":390.822968,"HyperDash":false}]},{"StartTime":88625.0,"Objects":[{"StartTime":88625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":88875.0,"Objects":[{"StartTime":88875.0,"Position":136.0,"HyperDash":false}]},{"StartTime":89125.0,"Objects":[{"StartTime":89125.0,"Position":8.0,"HyperDash":false},{"StartTime":89178.0,"Position":0.0,"HyperDash":false},{"StartTime":89232.0,"Position":12.7492714,"HyperDash":false},{"StartTime":89285.0,"Position":7.342363,"HyperDash":false},{"StartTime":89375.0,"Position":41.059124,"HyperDash":false}]},{"StartTime":89625.0,"Objects":[{"StartTime":89625.0,"Position":164.0,"HyperDash":false}]},{"StartTime":89875.0,"Objects":[{"StartTime":89875.0,"Position":288.0,"HyperDash":false}]},{"StartTime":90000.0,"Objects":[{"StartTime":90000.0,"Position":288.0,"HyperDash":false}]},{"StartTime":90125.0,"Objects":[{"StartTime":90125.0,"Position":288.0,"HyperDash":false},{"StartTime":90178.0,"Position":307.058655,"HyperDash":false},{"StartTime":90232.0,"Position":366.7033,"HyperDash":false},{"StartTime":90285.0,"Position":400.761932,"HyperDash":false},{"StartTime":90375.0,"Position":434.503052,"HyperDash":false}]},{"StartTime":90625.0,"Objects":[{"StartTime":90625.0,"Position":476.0,"HyperDash":false}]},{"StartTime":90875.0,"Objects":[{"StartTime":90875.0,"Position":332.0,"HyperDash":false}]},{"StartTime":91125.0,"Objects":[{"StartTime":91125.0,"Position":180.0,"HyperDash":false}]},{"StartTime":91375.0,"Objects":[{"StartTime":91375.0,"Position":36.0,"HyperDash":false}]},{"StartTime":91625.0,"Objects":[{"StartTime":91625.0,"Position":56.0,"HyperDash":false}]},{"StartTime":92125.0,"Objects":[{"StartTime":92125.0,"Position":56.0,"HyperDash":false},{"StartTime":92178.0,"Position":78.15752,"HyperDash":false},{"StartTime":92232.0,"Position":134.940643,"HyperDash":false},{"StartTime":92285.0,"Position":142.098145,"HyperDash":false},{"StartTime":92375.0,"Position":212.403366,"HyperDash":false}]},{"StartTime":92625.0,"Objects":[{"StartTime":92625.0,"Position":84.0,"HyperDash":false}]},{"StartTime":92875.0,"Objects":[{"StartTime":92875.0,"Position":220.0,"HyperDash":false}]},{"StartTime":93125.0,"Objects":[{"StartTime":93125.0,"Position":320.0,"HyperDash":false},{"StartTime":93178.0,"Position":369.1575,"HyperDash":false},{"StartTime":93232.0,"Position":398.940643,"HyperDash":false},{"StartTime":93285.0,"Position":408.098145,"HyperDash":false},{"StartTime":93375.0,"Position":476.403381,"HyperDash":false}]},{"StartTime":93625.0,"Objects":[{"StartTime":93625.0,"Position":432.0,"HyperDash":false}]},{"StartTime":93875.0,"Objects":[{"StartTime":93875.0,"Position":296.0,"HyperDash":false}]},{"StartTime":94000.0,"Objects":[{"StartTime":94000.0,"Position":296.0,"HyperDash":false}]},{"StartTime":94125.0,"Objects":[{"StartTime":94125.0,"Position":296.0,"HyperDash":false},{"StartTime":94178.0,"Position":273.1039,"HyperDash":false},{"StartTime":94232.0,"Position":244.445969,"HyperDash":false},{"StartTime":94285.0,"Position":219.02182,"HyperDash":false},{"StartTime":94374.0,"Position":170.471848,"HyperDash":false}]},{"StartTime":94625.0,"Objects":[{"StartTime":94625.0,"Position":216.0,"HyperDash":false},{"StartTime":94678.0,"Position":259.7602,"HyperDash":false},{"StartTime":94732.0,"Position":282.299927,"HyperDash":false},{"StartTime":94785.0,"Position":294.678436,"HyperDash":false},{"StartTime":94875.0,"Position":341.528168,"HyperDash":false}]},{"StartTime":95000.0,"Objects":[{"StartTime":95000.0,"Position":341.0,"HyperDash":false}]},{"StartTime":95125.0,"Objects":[{"StartTime":95125.0,"Position":341.0,"HyperDash":false},{"StartTime":95178.0,"Position":347.282532,"HyperDash":false},{"StartTime":95232.0,"Position":344.6459,"HyperDash":false},{"StartTime":95285.0,"Position":339.928436,"HyperDash":false},{"StartTime":95375.0,"Position":361.200684,"HyperDash":false}]},{"StartTime":95625.0,"Objects":[{"StartTime":95625.0,"Position":171.0,"HyperDash":false},{"StartTime":95678.0,"Position":158.717453,"HyperDash":false},{"StartTime":95732.0,"Position":169.354111,"HyperDash":false},{"StartTime":95785.0,"Position":172.071564,"HyperDash":false},{"StartTime":95875.0,"Position":150.799316,"HyperDash":false}]},{"StartTime":96125.0,"Objects":[{"StartTime":96125.0,"Position":43.0,"HyperDash":false}]},{"StartTime":96375.0,"Objects":[{"StartTime":96375.0,"Position":81.0,"HyperDash":false}]},{"StartTime":96625.0,"Objects":[{"StartTime":96625.0,"Position":169.0,"HyperDash":false}]},{"StartTime":96875.0,"Objects":[{"StartTime":96875.0,"Position":304.0,"HyperDash":false},{"StartTime":96937.0,"Position":333.433136,"HyperDash":false},{"StartTime":97000.0,"Position":385.325043,"HyperDash":false},{"StartTime":97062.0,"Position":379.667,"HyperDash":false},{"StartTime":97125.0,"Position":401.778076,"HyperDash":false},{"StartTime":97187.0,"Position":418.125366,"HyperDash":false},{"StartTime":97250.0,"Position":403.005768,"HyperDash":false},{"StartTime":97312.0,"Position":375.9013,"HyperDash":false},{"StartTime":97375.0,"Position":343.426239,"HyperDash":false},{"StartTime":97437.0,"Position":382.9013,"HyperDash":false},{"StartTime":97499.0,"Position":392.005768,"HyperDash":false},{"StartTime":97561.0,"Position":388.066345,"HyperDash":false},{"StartTime":97624.0,"Position":401.778076,"HyperDash":false},{"StartTime":97677.0,"Position":380.074066,"HyperDash":false},{"StartTime":97731.0,"Position":366.190063,"HyperDash":false},{"StartTime":97785.0,"Position":348.305481,"HyperDash":false},{"StartTime":97874.0,"Position":304.0,"HyperDash":false}]},{"StartTime":98125.0,"Objects":[{"StartTime":98125.0,"Position":240.0,"HyperDash":false},{"StartTime":98187.0,"Position":220.193451,"HyperDash":false},{"StartTime":98250.0,"Position":179.67662,"HyperDash":false},{"StartTime":98312.0,"Position":167.455551,"HyperDash":false},{"StartTime":98375.0,"Position":115.407051,"HyperDash":false},{"StartTime":98428.0,"Position":97.24337,"HyperDash":false},{"StartTime":98482.0,"Position":115.416969,"HyperDash":false},{"StartTime":98535.0,"Position":122.237556,"HyperDash":false},{"StartTime":98624.0,"Position":166.963364,"HyperDash":false}]},{"StartTime":98875.0,"Objects":[{"StartTime":98875.0,"Position":240.0,"HyperDash":false},{"StartTime":98937.0,"Position":273.329651,"HyperDash":false},{"StartTime":99000.0,"Position":306.601349,"HyperDash":false},{"StartTime":99062.0,"Position":324.816467,"HyperDash":false},{"StartTime":99125.0,"Position":363.818481,"HyperDash":false},{"StartTime":99178.0,"Position":391.8492,"HyperDash":false},{"StartTime":99232.0,"Position":363.507568,"HyperDash":false},{"StartTime":99285.0,"Position":349.543182,"HyperDash":false},{"StartTime":99374.0,"Position":311.711731,"HyperDash":false}]},{"StartTime":99625.0,"Objects":[{"StartTime":99625.0,"Position":180.0,"HyperDash":false},{"StartTime":99678.0,"Position":143.011124,"HyperDash":false},{"StartTime":99732.0,"Position":113.192444,"HyperDash":false},{"StartTime":99785.0,"Position":79.4256439,"HyperDash":false},{"StartTime":99874.0,"Position":45.3982735,"HyperDash":false}]},{"StartTime":100125.0,"Objects":[{"StartTime":100125.0,"Position":48.0,"HyperDash":false},{"StartTime":100178.0,"Position":75.85622,"HyperDash":false},{"StartTime":100231.0,"Position":116.712425,"HyperDash":false},{"StartTime":100284.0,"Position":156.568634,"HyperDash":false},{"StartTime":100374.0,"Position":202.3622,"HyperDash":false}]},{"StartTime":100625.0,"Objects":[{"StartTime":100625.0,"Position":348.0,"HyperDash":false},{"StartTime":100678.0,"Position":383.8562,"HyperDash":false},{"StartTime":100731.0,"Position":402.712433,"HyperDash":false},{"StartTime":100784.0,"Position":456.568634,"HyperDash":false},{"StartTime":100874.0,"Position":502.362183,"HyperDash":false}]},{"StartTime":101125.0,"Objects":[{"StartTime":101125.0,"Position":504.0,"HyperDash":false},{"StartTime":101178.0,"Position":488.1438,"HyperDash":false},{"StartTime":101231.0,"Position":446.287567,"HyperDash":false},{"StartTime":101284.0,"Position":423.431366,"HyperDash":false},{"StartTime":101374.0,"Position":349.637817,"HyperDash":false}]},{"StartTime":101625.0,"Objects":[{"StartTime":101625.0,"Position":204.0,"HyperDash":false},{"StartTime":101678.0,"Position":156.143784,"HyperDash":false},{"StartTime":101731.0,"Position":133.287567,"HyperDash":false},{"StartTime":101784.0,"Position":117.431358,"HyperDash":false},{"StartTime":101874.0,"Position":49.6378021,"HyperDash":false}]},{"StartTime":102000.0,"Objects":[{"StartTime":102000.0,"Position":49.0,"HyperDash":false}]},{"StartTime":102125.0,"Objects":[{"StartTime":102125.0,"Position":49.0,"HyperDash":false}]},{"StartTime":102625.0,"Objects":[{"StartTime":102625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":102875.0,"Objects":[{"StartTime":102875.0,"Position":384.0,"HyperDash":false}]},{"StartTime":103125.0,"Objects":[{"StartTime":103125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":103625.0,"Objects":[{"StartTime":103625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":103875.0,"Objects":[{"StartTime":103875.0,"Position":128.0,"HyperDash":false}]},{"StartTime":104125.0,"Objects":[{"StartTime":104125.0,"Position":256.0,"HyperDash":false},{"StartTime":104178.0,"Position":272.994537,"HyperDash":false},{"StartTime":104232.0,"Position":332.6524,"HyperDash":false},{"StartTime":104285.0,"Position":355.331024,"HyperDash":false},{"StartTime":104375.0,"Position":402.7333,"HyperDash":false}]},{"StartTime":104625.0,"Objects":[{"StartTime":104625.0,"Position":492.0,"HyperDash":false}]},{"StartTime":104875.0,"Objects":[{"StartTime":104875.0,"Position":332.0,"HyperDash":false}]},{"StartTime":105125.0,"Objects":[{"StartTime":105125.0,"Position":256.0,"HyperDash":false},{"StartTime":105178.0,"Position":241.889923,"HyperDash":false},{"StartTime":105232.0,"Position":211.080078,"HyperDash":false},{"StartTime":105285.0,"Position":144.258759,"HyperDash":false},{"StartTime":105374.0,"Position":109.266708,"HyperDash":false}]},{"StartTime":105625.0,"Objects":[{"StartTime":105625.0,"Position":20.0,"HyperDash":false}]},{"StartTime":105875.0,"Objects":[{"StartTime":105875.0,"Position":180.0,"HyperDash":false}]},{"StartTime":106125.0,"Objects":[{"StartTime":106125.0,"Position":368.0,"HyperDash":false},{"StartTime":106178.0,"Position":376.172974,"HyperDash":false},{"StartTime":106231.0,"Position":410.418945,"HyperDash":false},{"StartTime":106284.0,"Position":421.151764,"HyperDash":false},{"StartTime":106374.0,"Position":416.485779,"HyperDash":false}]},{"StartTime":106625.0,"Objects":[{"StartTime":106625.0,"Position":220.0,"HyperDash":false},{"StartTime":106678.0,"Position":241.054184,"HyperDash":false},{"StartTime":106731.0,"Position":282.792328,"HyperDash":false},{"StartTime":106784.0,"Position":301.047577,"HyperDash":false},{"StartTime":106874.0,"Position":349.247284,"HyperDash":false}]},{"StartTime":107125.0,"Objects":[{"StartTime":107125.0,"Position":144.0,"HyperDash":false},{"StartTime":107178.0,"Position":125.932152,"HyperDash":false},{"StartTime":107232.0,"Position":88.3730545,"HyperDash":false},{"StartTime":107285.0,"Position":97.8173752,"HyperDash":false},{"StartTime":107375.0,"Position":95.51424,"HyperDash":false}]},{"StartTime":107625.0,"Objects":[{"StartTime":107625.0,"Position":292.0,"HyperDash":false},{"StartTime":107678.0,"Position":279.032471,"HyperDash":false},{"StartTime":107732.0,"Position":263.904663,"HyperDash":false},{"StartTime":107785.0,"Position":230.72316,"HyperDash":false},{"StartTime":107875.0,"Position":162.752716,"HyperDash":false}]},{"StartTime":108125.0,"Objects":[{"StartTime":108125.0,"Position":44.0,"HyperDash":false},{"StartTime":108178.0,"Position":95.98508,"HyperDash":false},{"StartTime":108232.0,"Position":110.3604,"HyperDash":false},{"StartTime":108285.0,"Position":123.706589,"HyperDash":false},{"StartTime":108374.0,"Position":169.6919,"HyperDash":false}]},{"StartTime":108625.0,"Objects":[{"StartTime":108625.0,"Position":304.0,"HyperDash":false}]},{"StartTime":108875.0,"Objects":[{"StartTime":108875.0,"Position":408.0,"HyperDash":false}]},{"StartTime":109125.0,"Objects":[{"StartTime":109125.0,"Position":468.0,"HyperDash":false},{"StartTime":109178.0,"Position":439.149963,"HyperDash":false},{"StartTime":109232.0,"Position":396.891418,"HyperDash":false},{"StartTime":109285.0,"Position":370.5935,"HyperDash":false},{"StartTime":109375.0,"Position":342.308075,"HyperDash":false}]},{"StartTime":109625.0,"Objects":[{"StartTime":109625.0,"Position":208.0,"HyperDash":false}]},{"StartTime":109875.0,"Objects":[{"StartTime":109875.0,"Position":104.0,"HyperDash":false}]},{"StartTime":110125.0,"Objects":[{"StartTime":110125.0,"Position":256.0,"HyperDash":false},{"StartTime":110178.0,"Position":239.263885,"HyperDash":false},{"StartTime":110232.0,"Position":204.098785,"HyperDash":false},{"StartTime":110285.0,"Position":187.362686,"HyperDash":false},{"StartTime":110375.0,"Position":148.7542,"HyperDash":false}]},{"StartTime":110625.0,"Objects":[{"StartTime":110625.0,"Position":256.0,"HyperDash":false},{"StartTime":110678.0,"Position":283.827423,"HyperDash":false},{"StartTime":110731.0,"Position":319.654846,"HyperDash":false},{"StartTime":110784.0,"Position":325.482239,"HyperDash":false},{"StartTime":110874.0,"Position":363.2458,"HyperDash":false}]},{"StartTime":111125.0,"Objects":[{"StartTime":111125.0,"Position":208.0,"HyperDash":false},{"StartTime":111178.0,"Position":185.263885,"HyperDash":false},{"StartTime":111232.0,"Position":170.098785,"HyperDash":false},{"StartTime":111285.0,"Position":123.362686,"HyperDash":false},{"StartTime":111375.0,"Position":100.754196,"HyperDash":false}]},{"StartTime":111625.0,"Objects":[{"StartTime":111625.0,"Position":304.0,"HyperDash":false},{"StartTime":111678.0,"Position":318.7361,"HyperDash":false},{"StartTime":111732.0,"Position":353.901184,"HyperDash":false},{"StartTime":111785.0,"Position":357.6373,"HyperDash":false},{"StartTime":111875.0,"Position":411.2458,"HyperDash":false}]},{"StartTime":112125.0,"Objects":[{"StartTime":112125.0,"Position":252.0,"HyperDash":false}]},{"StartTime":112375.0,"Objects":[{"StartTime":112375.0,"Position":112.0,"HyperDash":false}]},{"StartTime":112625.0,"Objects":[{"StartTime":112625.0,"Position":72.0,"HyperDash":false}]},{"StartTime":112875.0,"Objects":[{"StartTime":112875.0,"Position":158.0,"HyperDash":false},{"StartTime":112937.0,"Position":180.39856,"HyperDash":false},{"StartTime":113000.0,"Position":253.684036,"HyperDash":false},{"StartTime":113062.0,"Position":263.862976,"HyperDash":false},{"StartTime":113125.0,"Position":289.459473,"HyperDash":false},{"StartTime":113187.0,"Position":294.857574,"HyperDash":false},{"StartTime":113250.0,"Position":301.491974,"HyperDash":false},{"StartTime":113312.0,"Position":306.150818,"HyperDash":false},{"StartTime":113375.0,"Position":278.112,"HyperDash":false},{"StartTime":113437.0,"Position":308.150818,"HyperDash":false},{"StartTime":113500.0,"Position":291.538177,"HyperDash":false},{"StartTime":113562.0,"Position":288.857574,"HyperDash":false},{"StartTime":113625.0,"Position":289.160065,"HyperDash":false},{"StartTime":113678.0,"Position":275.785217,"HyperDash":false},{"StartTime":113732.0,"Position":261.88623,"HyperDash":false},{"StartTime":113785.0,"Position":219.895935,"HyperDash":false},{"StartTime":113874.0,"Position":158.0,"HyperDash":false}]},{"StartTime":114125.0,"Objects":[{"StartTime":114125.0,"Position":176.0,"HyperDash":false},{"StartTime":114187.0,"Position":215.46962,"HyperDash":false},{"StartTime":114250.0,"Position":243.459351,"HyperDash":false},{"StartTime":114312.0,"Position":280.9655,"HyperDash":false},{"StartTime":114375.0,"Position":311.184082,"HyperDash":false},{"StartTime":114428.0,"Position":345.321442,"HyperDash":false},{"StartTime":114482.0,"Position":372.3753,"HyperDash":false},{"StartTime":114535.0,"Position":414.472534,"HyperDash":false},{"StartTime":114624.0,"Position":431.115143,"HyperDash":false}]},{"StartTime":114875.0,"Objects":[{"StartTime":114875.0,"Position":328.0,"HyperDash":false},{"StartTime":114937.0,"Position":303.669556,"HyperDash":false},{"StartTime":115000.0,"Position":279.312225,"HyperDash":false},{"StartTime":115062.0,"Position":265.2286,"HyperDash":false},{"StartTime":115125.0,"Position":258.051422,"HyperDash":false},{"StartTime":115178.0,"Position":262.0706,"HyperDash":false},{"StartTime":115231.0,"Position":286.7301,"HyperDash":false},{"StartTime":115284.0,"Position":315.1607,"HyperDash":false},{"StartTime":115374.0,"Position":349.780029,"HyperDash":false}]},{"StartTime":115625.0,"Objects":[{"StartTime":115625.0,"Position":488.0,"HyperDash":false},{"StartTime":115678.0,"Position":480.653168,"HyperDash":false},{"StartTime":115732.0,"Position":483.186554,"HyperDash":false},{"StartTime":115785.0,"Position":463.839722,"HyperDash":false},{"StartTime":115875.0,"Position":458.062073,"HyperDash":false}]},{"StartTime":116125.0,"Objects":[{"StartTime":116125.0,"Position":416.0,"HyperDash":false}]},{"StartTime":116375.0,"Objects":[{"StartTime":116375.0,"Position":288.0,"HyperDash":false}]},{"StartTime":116625.0,"Objects":[{"StartTime":116625.0,"Position":164.0,"HyperDash":false}]},{"StartTime":116875.0,"Objects":[{"StartTime":116875.0,"Position":36.0,"HyperDash":false}]},{"StartTime":117125.0,"Objects":[{"StartTime":117125.0,"Position":104.0,"HyperDash":false}]},{"StartTime":117375.0,"Objects":[{"StartTime":117375.0,"Position":232.0,"HyperDash":false}]},{"StartTime":117625.0,"Objects":[{"StartTime":117625.0,"Position":356.0,"HyperDash":false}]},{"StartTime":117875.0,"Objects":[{"StartTime":117875.0,"Position":484.0,"HyperDash":false}]},{"StartTime":118125.0,"Objects":[{"StartTime":118125.0,"Position":356.0,"HyperDash":false}]},{"StartTime":128125.0,"Objects":[{"StartTime":128125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":128250.0,"Objects":[{"StartTime":128250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":128500.0,"Objects":[{"StartTime":128500.0,"Position":336.0,"HyperDash":false}]},{"StartTime":128625.0,"Objects":[{"StartTime":128625.0,"Position":336.0,"HyperDash":false}]},{"StartTime":128875.0,"Objects":[{"StartTime":128875.0,"Position":400.0,"HyperDash":false}]},{"StartTime":129000.0,"Objects":[{"StartTime":129000.0,"Position":400.0,"HyperDash":false}]},{"StartTime":129250.0,"Objects":[{"StartTime":129250.0,"Position":492.0,"HyperDash":false}]},{"StartTime":129375.0,"Objects":[{"StartTime":129375.0,"Position":492.0,"HyperDash":false}]},{"StartTime":129625.0,"Objects":[{"StartTime":129625.0,"Position":440.0,"HyperDash":false},{"StartTime":129678.0,"Position":420.699738,"HyperDash":false},{"StartTime":129731.0,"Position":376.399475,"HyperDash":false},{"StartTime":129784.0,"Position":327.099243,"HyperDash":false},{"StartTime":129874.0,"Position":283.551636,"HyperDash":false}]},{"StartTime":130125.0,"Objects":[{"StartTime":130125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":130250.0,"Objects":[{"StartTime":130250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":130500.0,"Objects":[{"StartTime":130500.0,"Position":176.0,"HyperDash":false}]},{"StartTime":130625.0,"Objects":[{"StartTime":130625.0,"Position":176.0,"HyperDash":false}]},{"StartTime":130875.0,"Objects":[{"StartTime":130875.0,"Position":112.0,"HyperDash":false}]},{"StartTime":131000.0,"Objects":[{"StartTime":131000.0,"Position":112.0,"HyperDash":false}]},{"StartTime":131250.0,"Objects":[{"StartTime":131250.0,"Position":20.0,"HyperDash":false}]},{"StartTime":131375.0,"Objects":[{"StartTime":131375.0,"Position":20.0,"HyperDash":false}]},{"StartTime":131625.0,"Objects":[{"StartTime":131625.0,"Position":72.0,"HyperDash":false},{"StartTime":131678.0,"Position":85.16705,"HyperDash":false},{"StartTime":131732.0,"Position":139.959915,"HyperDash":false},{"StartTime":131785.0,"Position":179.126953,"HyperDash":false},{"StartTime":131875.0,"Position":228.44838,"HyperDash":false}]},{"StartTime":132125.0,"Objects":[{"StartTime":132125.0,"Position":408.0,"HyperDash":false},{"StartTime":132187.0,"Position":432.7211,"HyperDash":false},{"StartTime":132250.0,"Position":463.48645,"HyperDash":false},{"StartTime":132312.0,"Position":484.605652,"HyperDash":false},{"StartTime":132375.0,"Position":511.913147,"HyperDash":false},{"StartTime":132437.0,"Position":511.3131,"HyperDash":false},{"StartTime":132500.0,"Position":512.0,"HyperDash":false},{"StartTime":132562.0,"Position":512.0,"HyperDash":false},{"StartTime":132625.0,"Position":491.9296,"HyperDash":false},{"StartTime":132687.0,"Position":477.671265,"HyperDash":false},{"StartTime":132750.0,"Position":455.869171,"HyperDash":false},{"StartTime":132812.0,"Position":413.826355,"HyperDash":false},{"StartTime":132875.0,"Position":366.962769,"HyperDash":false},{"StartTime":132937.0,"Position":340.888336,"HyperDash":false},{"StartTime":133000.0,"Position":273.617157,"HyperDash":false},{"StartTime":133062.0,"Position":263.5604,"HyperDash":false},{"StartTime":133125.0,"Position":210.586578,"HyperDash":false},{"StartTime":133187.0,"Position":176.064163,"HyperDash":false},{"StartTime":133250.0,"Position":127.187744,"HyperDash":false},{"StartTime":133312.0,"Position":131.32103,"HyperDash":false},{"StartTime":133375.0,"Position":102.106659,"HyperDash":false},{"StartTime":133437.0,"Position":101.403084,"HyperDash":false},{"StartTime":133500.0,"Position":84.85893,"HyperDash":false},{"StartTime":133562.0,"Position":83.863945,"HyperDash":false},{"StartTime":133625.0,"Position":119.323433,"HyperDash":false},{"StartTime":133687.0,"Position":159.490738,"HyperDash":false},{"StartTime":133750.0,"Position":179.476852,"HyperDash":false},{"StartTime":133812.0,"Position":207.3787,"HyperDash":false},{"StartTime":133875.0,"Position":256.6099,"HyperDash":false},{"StartTime":133937.0,"Position":289.899384,"HyperDash":false},{"StartTime":134000.0,"Position":322.431061,"HyperDash":false},{"StartTime":134062.0,"Position":371.9527,"HyperDash":false},{"StartTime":134125.0,"Position":392.617126,"HyperDash":false},{"StartTime":134187.0,"Position":422.877838,"HyperDash":false},{"StartTime":134250.0,"Position":425.129883,"HyperDash":false},{"StartTime":134312.0,"Position":404.693054,"HyperDash":false},{"StartTime":134375.0,"Position":409.929779,"HyperDash":false},{"StartTime":134437.0,"Position":384.0832,"HyperDash":false},{"StartTime":134500.0,"Position":354.885651,"HyperDash":false},{"StartTime":134562.0,"Position":326.547424,"HyperDash":false},{"StartTime":134625.0,"Position":301.508575,"HyperDash":false},{"StartTime":134687.0,"Position":255.1601,"HyperDash":false},{"StartTime":134750.0,"Position":222.486877,"HyperDash":false},{"StartTime":134812.0,"Position":183.853729,"HyperDash":false},{"StartTime":134875.0,"Position":145.138245,"HyperDash":false},{"StartTime":134937.0,"Position":107.848343,"HyperDash":false},{"StartTime":135000.0,"Position":58.21479,"HyperDash":false},{"StartTime":135062.0,"Position":57.82658,"HyperDash":false},{"StartTime":135125.0,"Position":20.1227779,"HyperDash":false},{"StartTime":135187.0,"Position":0.0,"HyperDash":false},{"StartTime":135250.0,"Position":0.0,"HyperDash":false},{"StartTime":135312.0,"Position":0.0,"HyperDash":false},{"StartTime":135375.0,"Position":0.05981236,"HyperDash":false},{"StartTime":135428.0,"Position":14.5409756,"HyperDash":false},{"StartTime":135482.0,"Position":36.1827965,"HyperDash":false},{"StartTime":135535.0,"Position":37.5372772,"HyperDash":false},{"StartTime":135625.0,"Position":103.892265,"HyperDash":false}]},{"StartTime":135875.0,"Objects":[{"StartTime":135875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":136000.0,"Objects":[{"StartTime":136000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":136125.0,"Objects":[{"StartTime":136125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":136375.0,"Objects":[{"StartTime":136375.0,"Position":136.0,"HyperDash":false}]},{"StartTime":136625.0,"Objects":[{"StartTime":136625.0,"Position":132.0,"HyperDash":false}]},{"StartTime":136750.0,"Objects":[{"StartTime":136750.0,"Position":133.0,"HyperDash":false}]},{"StartTime":137000.0,"Objects":[{"StartTime":137000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":137125.0,"Objects":[{"StartTime":137125.0,"Position":255.0,"HyperDash":false}]},{"StartTime":137250.0,"Objects":[{"StartTime":137250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":137375.0,"Objects":[{"StartTime":137375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":137625.0,"Objects":[{"StartTime":137625.0,"Position":380.0,"HyperDash":false}]},{"StartTime":137875.0,"Objects":[{"StartTime":137875.0,"Position":376.0,"HyperDash":false}]},{"StartTime":138125.0,"Objects":[{"StartTime":138125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":138375.0,"Objects":[{"StartTime":138375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":138625.0,"Objects":[{"StartTime":138625.0,"Position":144.0,"HyperDash":false}]},{"StartTime":138750.0,"Objects":[{"StartTime":138750.0,"Position":144.0,"HyperDash":false}]},{"StartTime":139000.0,"Objects":[{"StartTime":139000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":139125.0,"Objects":[{"StartTime":139125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":139250.0,"Objects":[{"StartTime":139250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":139375.0,"Objects":[{"StartTime":139375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":139625.0,"Objects":[{"StartTime":139625.0,"Position":368.0,"HyperDash":false}]},{"StartTime":139875.0,"Objects":[{"StartTime":139875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":140000.0,"Objects":[{"StartTime":140000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":140125.0,"Objects":[{"StartTime":140125.0,"Position":256.0,"HyperDash":false},{"StartTime":140178.0,"Position":227.121277,"HyperDash":false},{"StartTime":140232.0,"Position":201.278854,"HyperDash":false},{"StartTime":140285.0,"Position":210.432343,"HyperDash":false},{"StartTime":140374.0,"Position":256.095947,"HyperDash":false}]},{"StartTime":140625.0,"Objects":[{"StartTime":140625.0,"Position":332.0,"HyperDash":false}]},{"StartTime":140750.0,"Objects":[{"StartTime":140750.0,"Position":332.0,"HyperDash":false}]},{"StartTime":141000.0,"Objects":[{"StartTime":141000.0,"Position":332.0,"HyperDash":false}]},{"StartTime":141125.0,"Objects":[{"StartTime":141125.0,"Position":332.0,"HyperDash":false}]},{"StartTime":141250.0,"Objects":[{"StartTime":141250.0,"Position":332.0,"HyperDash":false}]},{"StartTime":141375.0,"Objects":[{"StartTime":141375.0,"Position":332.0,"HyperDash":false}]},{"StartTime":141625.0,"Objects":[{"StartTime":141625.0,"Position":180.0,"HyperDash":false}]},{"StartTime":141875.0,"Objects":[{"StartTime":141875.0,"Position":180.0,"HyperDash":false}]},{"StartTime":142125.0,"Objects":[{"StartTime":142125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":142375.0,"Objects":[{"StartTime":142375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":142625.0,"Objects":[{"StartTime":142625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":142750.0,"Objects":[{"StartTime":142750.0,"Position":256.0,"HyperDash":false}]},{"StartTime":143000.0,"Objects":[{"StartTime":143000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":143125.0,"Objects":[{"StartTime":143125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":143250.0,"Objects":[{"StartTime":143250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":143375.0,"Objects":[{"StartTime":143375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":143625.0,"Objects":[{"StartTime":143625.0,"Position":188.0,"HyperDash":false}]},{"StartTime":143875.0,"Objects":[{"StartTime":143875.0,"Position":324.0,"HyperDash":false}]},{"StartTime":144000.0,"Objects":[{"StartTime":144000.0,"Position":324.0,"HyperDash":false}]},{"StartTime":144125.0,"Objects":[{"StartTime":144125.0,"Position":324.0,"HyperDash":false},{"StartTime":144178.0,"Position":375.919983,"HyperDash":false},{"StartTime":144232.0,"Position":388.48,"HyperDash":false},{"StartTime":144285.0,"Position":424.4,"HyperDash":false},{"StartTime":144375.0,"Position":484.0,"HyperDash":false}]},{"StartTime":144625.0,"Objects":[{"StartTime":144625.0,"Position":392.0,"HyperDash":false}]},{"StartTime":144750.0,"Objects":[{"StartTime":144750.0,"Position":392.0,"HyperDash":false}]},{"StartTime":145000.0,"Objects":[{"StartTime":145000.0,"Position":324.0,"HyperDash":false}]},{"StartTime":145125.0,"Objects":[{"StartTime":145125.0,"Position":324.0,"HyperDash":false}]},{"StartTime":145250.0,"Objects":[{"StartTime":145250.0,"Position":324.0,"HyperDash":false}]},{"StartTime":145375.0,"Objects":[{"StartTime":145375.0,"Position":324.0,"HyperDash":false}]},{"StartTime":145625.0,"Objects":[{"StartTime":145625.0,"Position":188.0,"HyperDash":false}]},{"StartTime":145875.0,"Objects":[{"StartTime":145875.0,"Position":120.0,"HyperDash":false}]},{"StartTime":146125.0,"Objects":[{"StartTime":146125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":146375.0,"Objects":[{"StartTime":146375.0,"Position":256.0,"HyperDash":false}]},{"StartTime":146625.0,"Objects":[{"StartTime":146625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":146750.0,"Objects":[{"StartTime":146750.0,"Position":256.0,"HyperDash":false}]},{"StartTime":147000.0,"Objects":[{"StartTime":147000.0,"Position":176.0,"HyperDash":false}]},{"StartTime":147125.0,"Objects":[{"StartTime":147125.0,"Position":176.0,"HyperDash":false}]},{"StartTime":147250.0,"Objects":[{"StartTime":147250.0,"Position":176.0,"HyperDash":false}]},{"StartTime":147375.0,"Objects":[{"StartTime":147375.0,"Position":176.0,"HyperDash":false}]},{"StartTime":147625.0,"Objects":[{"StartTime":147625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":147875.0,"Objects":[{"StartTime":147875.0,"Position":336.0,"HyperDash":false}]},{"StartTime":148000.0,"Objects":[{"StartTime":148000.0,"Position":336.0,"HyperDash":false}]},{"StartTime":148125.0,"Objects":[{"StartTime":148125.0,"Position":336.0,"HyperDash":false},{"StartTime":148178.0,"Position":375.538025,"HyperDash":false},{"StartTime":148231.0,"Position":390.979462,"HyperDash":false},{"StartTime":148284.0,"Position":386.895447,"HyperDash":false},{"StartTime":148374.0,"Position":370.6822,"HyperDash":false}]},{"StartTime":148625.0,"Objects":[{"StartTime":148625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":148750.0,"Objects":[{"StartTime":148750.0,"Position":240.0,"HyperDash":false}]},{"StartTime":149000.0,"Objects":[{"StartTime":149000.0,"Position":240.0,"HyperDash":false}]},{"StartTime":149125.0,"Objects":[{"StartTime":149125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":149250.0,"Objects":[{"StartTime":149250.0,"Position":272.0,"HyperDash":false}]},{"StartTime":149375.0,"Objects":[{"StartTime":149375.0,"Position":288.0,"HyperDash":false}]},{"StartTime":149625.0,"Objects":[{"StartTime":149625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":149875.0,"Objects":[{"StartTime":149875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":150125.0,"Objects":[{"StartTime":150125.0,"Position":116.0,"HyperDash":false}]},{"StartTime":150250.0,"Objects":[{"StartTime":150250.0,"Position":120.0,"HyperDash":false}]},{"StartTime":150375.0,"Objects":[{"StartTime":150375.0,"Position":132.0,"HyperDash":false}]},{"StartTime":150500.0,"Objects":[{"StartTime":150500.0,"Position":152.0,"HyperDash":false}]},{"StartTime":150625.0,"Objects":[{"StartTime":150625.0,"Position":176.0,"HyperDash":false}]},{"StartTime":150750.0,"Objects":[{"StartTime":150750.0,"Position":208.0,"HyperDash":false}]},{"StartTime":150875.0,"Objects":[{"StartTime":150875.0,"Position":232.0,"HyperDash":false}]},{"StartTime":151000.0,"Objects":[{"StartTime":151000.0,"Position":248.0,"HyperDash":false}]},{"StartTime":151125.0,"Objects":[{"StartTime":151125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":151250.0,"Objects":[{"StartTime":151250.0,"Position":260.0,"HyperDash":false}]},{"StartTime":151375.0,"Objects":[{"StartTime":151375.0,"Position":272.0,"HyperDash":false}]},{"StartTime":151500.0,"Objects":[{"StartTime":151500.0,"Position":292.0,"HyperDash":false}]},{"StartTime":151625.0,"Objects":[{"StartTime":151625.0,"Position":316.0,"HyperDash":false}]},{"StartTime":151750.0,"Objects":[{"StartTime":151750.0,"Position":348.0,"HyperDash":false}]},{"StartTime":151875.0,"Objects":[{"StartTime":151875.0,"Position":372.0,"HyperDash":false}]},{"StartTime":152000.0,"Objects":[{"StartTime":152000.0,"Position":388.0,"HyperDash":false}]},{"StartTime":152125.0,"Objects":[{"StartTime":152125.0,"Position":404.0,"HyperDash":false},{"StartTime":152178.0,"Position":429.642151,"HyperDash":false},{"StartTime":152232.0,"Position":425.184479,"HyperDash":false},{"StartTime":152285.0,"Position":392.507416,"HyperDash":false},{"StartTime":152375.0,"Position":342.072266,"HyperDash":false}]},{"StartTime":152625.0,"Objects":[{"StartTime":152625.0,"Position":108.0,"HyperDash":false},{"StartTime":152678.0,"Position":112.349617,"HyperDash":false},{"StartTime":152732.0,"Position":112.903786,"HyperDash":false},{"StartTime":152785.0,"Position":119.761673,"HyperDash":false},{"StartTime":152874.0,"Position":169.927719,"HyperDash":false}]},{"StartTime":153125.0,"Objects":[{"StartTime":153125.0,"Position":256.0,"HyperDash":false},{"StartTime":153250.0,"Position":256.0,"HyperDash":false}]},{"StartTime":153375.0,"Objects":[{"StartTime":153375.0,"Position":256.0,"HyperDash":false},{"StartTime":153437.0,"Position":269.0,"HyperDash":false},{"StartTime":153500.0,"Position":241.0,"HyperDash":false},{"StartTime":153562.0,"Position":247.0,"HyperDash":false},{"StartTime":153625.0,"Position":256.0,"HyperDash":false},{"StartTime":153678.0,"Position":244.0,"HyperDash":false},{"StartTime":153732.0,"Position":258.0,"HyperDash":false},{"StartTime":153785.0,"Position":240.0,"HyperDash":false},{"StartTime":153875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":154125.0,"Objects":[{"StartTime":154125.0,"Position":360.0,"HyperDash":false}]},{"StartTime":154250.0,"Objects":[{"StartTime":154250.0,"Position":360.0,"HyperDash":false}]},{"StartTime":154375.0,"Objects":[{"StartTime":154375.0,"Position":360.0,"HyperDash":false}]},{"StartTime":154625.0,"Objects":[{"StartTime":154625.0,"Position":256.0,"HyperDash":false}]},{"StartTime":154750.0,"Objects":[{"StartTime":154750.0,"Position":256.0,"HyperDash":false}]},{"StartTime":154875.0,"Objects":[{"StartTime":154875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":155125.0,"Objects":[{"StartTime":155125.0,"Position":154.0,"HyperDash":false}]},{"StartTime":155250.0,"Objects":[{"StartTime":155250.0,"Position":154.0,"HyperDash":false}]},{"StartTime":155375.0,"Objects":[{"StartTime":155375.0,"Position":155.0,"HyperDash":false},{"StartTime":155437.0,"Position":134.040146,"HyperDash":false},{"StartTime":155500.0,"Position":134.7992,"HyperDash":false},{"StartTime":155562.0,"Position":112.444061,"HyperDash":false},{"StartTime":155625.0,"Position":165.451813,"HyperDash":false},{"StartTime":155678.0,"Position":137.274612,"HyperDash":false},{"StartTime":155732.0,"Position":123.117592,"HyperDash":false},{"StartTime":155785.0,"Position":139.026031,"HyperDash":false},{"StartTime":155874.0,"Position":155.0,"HyperDash":false}]},{"StartTime":156000.0,"Objects":[{"StartTime":156000.0,"Position":163.0,"HyperDash":false}]},{"StartTime":156125.0,"Objects":[{"StartTime":156125.0,"Position":163.0,"HyperDash":false}]},{"StartTime":156250.0,"Objects":[{"StartTime":156250.0,"Position":163.0,"HyperDash":false},{"StartTime":156312.0,"Position":183.5915,"HyperDash":false},{"StartTime":156375.0,"Position":203.198776,"HyperDash":false},{"StartTime":156437.0,"Position":232.230286,"HyperDash":false},{"StartTime":156500.0,"Position":268.618439,"HyperDash":false},{"StartTime":156562.0,"Position":314.36087,"HyperDash":false},{"StartTime":156625.0,"Position":335.6506,"HyperDash":false},{"StartTime":156687.0,"Position":380.1404,"HyperDash":false},{"StartTime":156750.0,"Position":422.05127,"HyperDash":false},{"StartTime":156874.0,"Position":473.144562,"HyperDash":false}]},{"StartTime":157125.0,"Objects":[{"StartTime":157125.0,"Position":320.0,"HyperDash":false},{"StartTime":157187.0,"Position":278.6829,"HyperDash":false},{"StartTime":157250.0,"Position":245.222778,"HyperDash":false},{"StartTime":157312.0,"Position":218.502289,"HyperDash":false},{"StartTime":157375.0,"Position":221.008591,"HyperDash":false},{"StartTime":157428.0,"Position":240.596039,"HyperDash":false},{"StartTime":157482.0,"Position":248.418259,"HyperDash":false},{"StartTime":157535.0,"Position":260.110321,"HyperDash":false},{"StartTime":157624.0,"Position":317.0907,"HyperDash":false}]},{"StartTime":157750.0,"Objects":[{"StartTime":157750.0,"Position":348.0,"HyperDash":false}]},{"StartTime":157875.0,"Objects":[{"StartTime":157875.0,"Position":380.0,"HyperDash":false}]},{"StartTime":158000.0,"Objects":[{"StartTime":158000.0,"Position":404.0,"HyperDash":false}]},{"StartTime":158125.0,"Objects":[{"StartTime":158125.0,"Position":412.0,"HyperDash":false}]},{"StartTime":158250.0,"Objects":[{"StartTime":158250.0,"Position":412.0,"HyperDash":false}]},{"StartTime":158375.0,"Objects":[{"StartTime":158375.0,"Position":404.0,"HyperDash":false}]},{"StartTime":158625.0,"Objects":[{"StartTime":158625.0,"Position":264.0,"HyperDash":false},{"StartTime":158687.0,"Position":234.814957,"HyperDash":false},{"StartTime":158750.0,"Position":191.04628,"HyperDash":false},{"StartTime":158875.0,"Position":264.0,"HyperDash":false}]},{"StartTime":159125.0,"Objects":[{"StartTime":159125.0,"Position":164.0,"HyperDash":false},{"StartTime":159187.0,"Position":197.185043,"HyperDash":false},{"StartTime":159250.0,"Position":236.95372,"HyperDash":false},{"StartTime":159375.0,"Position":164.0,"HyperDash":false}]},{"StartTime":159625.0,"Objects":[{"StartTime":159625.0,"Position":56.0,"HyperDash":false}]},{"StartTime":159875.0,"Objects":[{"StartTime":159875.0,"Position":64.0,"HyperDash":false}]},{"StartTime":160000.0,"Objects":[{"StartTime":160000.0,"Position":64.0,"HyperDash":false}]},{"StartTime":160125.0,"Objects":[{"StartTime":160125.0,"Position":64.0,"HyperDash":false},{"StartTime":160187.0,"Position":64.51918,"HyperDash":false},{"StartTime":160250.0,"Position":26.7402878,"HyperDash":false},{"StartTime":160375.0,"Position":64.0,"HyperDash":false}]},{"StartTime":160500.0,"Objects":[{"StartTime":160500.0,"Position":128.0,"HyperDash":false},{"StartTime":160562.0,"Position":132.164291,"HyperDash":false},{"StartTime":160625.0,"Position":134.379623,"HyperDash":false},{"StartTime":160750.0,"Position":128.0,"HyperDash":false}]},{"StartTime":160875.0,"Objects":[{"StartTime":160875.0,"Position":192.0,"HyperDash":false},{"StartTime":160937.0,"Position":189.164291,"HyperDash":false},{"StartTime":161000.0,"Position":198.379623,"HyperDash":false},{"StartTime":161125.0,"Position":192.0,"HyperDash":false}]},{"StartTime":161250.0,"Objects":[{"StartTime":161250.0,"Position":240.0,"HyperDash":false},{"StartTime":161312.0,"Position":248.7879,"HyperDash":false},{"StartTime":161375.0,"Position":289.975616,"HyperDash":false},{"StartTime":161500.0,"Position":240.0,"HyperDash":false}]},{"StartTime":161625.0,"Objects":[{"StartTime":161625.0,"Position":284.0,"HyperDash":false},{"StartTime":161687.0,"Position":327.2897,"HyperDash":false},{"StartTime":161750.0,"Position":339.019562,"HyperDash":false},{"StartTime":161875.0,"Position":284.0,"HyperDash":false}]},{"StartTime":162000.0,"Objects":[{"StartTime":162000.0,"Position":328.0,"HyperDash":false},{"StartTime":162062.0,"Position":364.361755,"HyperDash":false},{"StartTime":162124.0,"Position":407.040955,"HyperDash":false},{"StartTime":162249.0,"Position":328.0,"HyperDash":false}]},{"StartTime":162375.0,"Objects":[{"StartTime":162375.0,"Position":308.0,"HyperDash":false},{"StartTime":162437.0,"Position":269.638245,"HyperDash":false},{"StartTime":162499.0,"Position":228.959045,"HyperDash":false},{"StartTime":162624.0,"Position":308.0,"HyperDash":false}]},{"StartTime":162750.0,"Objects":[{"StartTime":162750.0,"Position":340.0,"HyperDash":false},{"StartTime":162812.0,"Position":374.361755,"HyperDash":false},{"StartTime":162874.0,"Position":419.040955,"HyperDash":false},{"StartTime":162999.0,"Position":340.0,"HyperDash":false}]},{"StartTime":163125.0,"Objects":[{"StartTime":163125.0,"Position":284.0,"HyperDash":false},{"StartTime":163187.0,"Position":280.849731,"HyperDash":false},{"StartTime":163249.0,"Position":271.649841,"HyperDash":false},{"StartTime":163374.0,"Position":284.0,"HyperDash":false}]},{"StartTime":163500.0,"Objects":[{"StartTime":163500.0,"Position":224.0,"HyperDash":false},{"StartTime":163562.0,"Position":227.849731,"HyperDash":false},{"StartTime":163624.0,"Position":211.649857,"HyperDash":false},{"StartTime":163749.0,"Position":224.0,"HyperDash":false}]},{"StartTime":163875.0,"Objects":[{"StartTime":163875.0,"Position":180.0,"HyperDash":false},{"StartTime":163937.0,"Position":134.564423,"HyperDash":false},{"StartTime":163999.0,"Position":102.8189,"HyperDash":false},{"StartTime":164124.0,"Position":180.0,"HyperDash":false}]},{"StartTime":164250.0,"Objects":[{"StartTime":164250.0,"Position":144.0,"HyperDash":false},{"StartTime":164312.0,"Position":107.832245,"HyperDash":false},{"StartTime":164375.0,"Position":79.14566,"HyperDash":false},{"StartTime":164500.0,"Position":144.0,"HyperDash":false}]},{"StartTime":164625.0,"Objects":[{"StartTime":164625.0,"Position":168.0,"HyperDash":false},{"StartTime":164687.0,"Position":182.167755,"HyperDash":false},{"StartTime":164750.0,"Position":232.85434,"HyperDash":false},{"StartTime":164875.0,"Position":168.0,"HyperDash":false}]},{"StartTime":165000.0,"Objects":[{"StartTime":165000.0,"Position":136.0,"HyperDash":false},{"StartTime":165062.0,"Position":117.871719,"HyperDash":false},{"StartTime":165124.0,"Position":101.605316,"HyperDash":false},{"StartTime":165249.0,"Position":136.0,"HyperDash":false}]},{"StartTime":165375.0,"Objects":[{"StartTime":165375.0,"Position":188.0,"HyperDash":false},{"StartTime":165437.0,"Position":220.128281,"HyperDash":false},{"StartTime":165499.0,"Position":222.394684,"HyperDash":false},{"StartTime":165624.0,"Position":188.0,"HyperDash":false}]},{"StartTime":165750.0,"Objects":[{"StartTime":165750.0,"Position":236.0,"HyperDash":false}]},{"StartTime":165875.0,"Objects":[{"StartTime":165875.0,"Position":236.0,"HyperDash":false}]},{"StartTime":166125.0,"Objects":[{"StartTime":166125.0,"Position":364.0,"HyperDash":false},{"StartTime":166187.0,"Position":369.388123,"HyperDash":false},{"StartTime":166250.0,"Position":391.656616,"HyperDash":false},{"StartTime":166312.0,"Position":357.6028,"HyperDash":false},{"StartTime":166375.0,"Position":309.5534,"HyperDash":false},{"StartTime":166499.0,"Position":282.373474,"HyperDash":false}]},{"StartTime":166625.0,"Objects":[{"StartTime":166625.0,"Position":264.0,"HyperDash":false},{"StartTime":166687.0,"Position":284.388123,"HyperDash":false},{"StartTime":166750.0,"Position":283.656616,"HyperDash":false},{"StartTime":166812.0,"Position":260.602844,"HyperDash":false},{"StartTime":166875.0,"Position":209.5534,"HyperDash":false},{"StartTime":166999.0,"Position":182.373489,"HyperDash":false}]},{"StartTime":167125.0,"Objects":[{"StartTime":167125.0,"Position":192.0,"HyperDash":false}]},{"StartTime":167375.0,"Objects":[{"StartTime":167375.0,"Position":320.0,"HyperDash":false}]},{"StartTime":167625.0,"Objects":[{"StartTime":167625.0,"Position":192.0,"HyperDash":false}]},{"StartTime":167750.0,"Objects":[{"StartTime":167750.0,"Position":256.0,"HyperDash":false}]},{"StartTime":167875.0,"Objects":[{"StartTime":167875.0,"Position":320.0,"HyperDash":false}]},{"StartTime":168125.0,"Objects":[{"StartTime":168125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":168250.0,"Objects":[{"StartTime":168250.0,"Position":193.0,"HyperDash":false},{"StartTime":168308.0,"Position":488.0,"HyperDash":false},{"StartTime":168367.0,"Position":314.0,"HyperDash":false},{"StartTime":168425.0,"Position":135.0,"HyperDash":false},{"StartTime":168484.0,"Position":399.0,"HyperDash":false},{"StartTime":168542.0,"Position":404.0,"HyperDash":false},{"StartTime":168601.0,"Position":152.0,"HyperDash":false},{"StartTime":168660.0,"Position":353.0,"HyperDash":false},{"StartTime":168718.0,"Position":358.0,"HyperDash":false},{"StartTime":168777.0,"Position":447.0,"HyperDash":false},{"StartTime":168835.0,"Position":222.0,"HyperDash":false},{"StartTime":168894.0,"Position":382.0,"HyperDash":false},{"StartTime":168953.0,"Position":433.0,"HyperDash":false},{"StartTime":169011.0,"Position":450.0,"HyperDash":false},{"StartTime":169070.0,"Position":326.0,"HyperDash":false},{"StartTime":169128.0,"Position":414.0,"HyperDash":false},{"StartTime":169187.0,"Position":285.0,"HyperDash":false},{"StartTime":169246.0,"Position":336.0,"HyperDash":false},{"StartTime":169304.0,"Position":509.0,"HyperDash":false},{"StartTime":169363.0,"Position":334.0,"HyperDash":false},{"StartTime":169421.0,"Position":72.0,"HyperDash":false},{"StartTime":169480.0,"Position":425.0,"HyperDash":false},{"StartTime":169539.0,"Position":451.0,"HyperDash":false},{"StartTime":169597.0,"Position":220.0,"HyperDash":false},{"StartTime":169656.0,"Position":25.0,"HyperDash":false},{"StartTime":169714.0,"Position":77.0,"HyperDash":false},{"StartTime":169773.0,"Position":509.0,"HyperDash":false},{"StartTime":169832.0,"Position":90.0,"HyperDash":false},{"StartTime":169890.0,"Position":118.0,"HyperDash":false},{"StartTime":169949.0,"Position":58.0,"HyperDash":false},{"StartTime":170007.0,"Position":12.0,"HyperDash":false},{"StartTime":170066.0,"Position":215.0,"HyperDash":false},{"StartTime":170125.0,"Position":487.0,"HyperDash":false}]},{"StartTime":171125.0,"Objects":[{"StartTime":171125.0,"Position":446.0,"HyperDash":false},{"StartTime":171187.0,"Position":491.0,"HyperDash":false},{"StartTime":171250.0,"Position":459.0,"HyperDash":false},{"StartTime":171312.0,"Position":37.0,"HyperDash":false},{"StartTime":171375.0,"Position":291.0,"HyperDash":false},{"StartTime":171437.0,"Position":315.0,"HyperDash":false},{"StartTime":171500.0,"Position":35.0,"HyperDash":false},{"StartTime":171562.0,"Position":208.0,"HyperDash":false},{"StartTime":171625.0,"Position":504.0,"HyperDash":false},{"StartTime":171687.0,"Position":296.0,"HyperDash":false},{"StartTime":171750.0,"Position":105.0,"HyperDash":false},{"StartTime":171812.0,"Position":488.0,"HyperDash":false},{"StartTime":171875.0,"Position":230.0,"HyperDash":false},{"StartTime":171937.0,"Position":446.0,"HyperDash":false},{"StartTime":172000.0,"Position":241.0,"HyperDash":false},{"StartTime":172062.0,"Position":413.0,"HyperDash":false},{"StartTime":172125.0,"Position":357.0,"HyperDash":false}]},{"StartTime":172375.0,"Objects":[{"StartTime":172375.0,"Position":48.0,"HyperDash":false}]},{"StartTime":172625.0,"Objects":[{"StartTime":172625.0,"Position":20.0,"HyperDash":false},{"StartTime":172678.0,"Position":23.1916313,"HyperDash":false},{"StartTime":172732.0,"Position":25.55497,"HyperDash":false},{"StartTime":172785.0,"Position":75.26404,"HyperDash":false},{"StartTime":172875.0,"Position":108.478035,"HyperDash":false}]},{"StartTime":173125.0,"Objects":[{"StartTime":173125.0,"Position":240.0,"HyperDash":false}]},{"StartTime":173375.0,"Objects":[{"StartTime":173375.0,"Position":200.0,"HyperDash":false}]},{"StartTime":173625.0,"Objects":[{"StartTime":173625.0,"Position":324.0,"HyperDash":false},{"StartTime":173678.0,"Position":349.476471,"HyperDash":false},{"StartTime":173732.0,"Position":378.649323,"HyperDash":false},{"StartTime":173785.0,"Position":384.945282,"HyperDash":false},{"StartTime":173875.0,"Position":412.1426,"HyperDash":false}]},{"StartTime":174000.0,"Objects":[{"StartTime":174000.0,"Position":412.0,"HyperDash":false}]},{"StartTime":174125.0,"Objects":[{"StartTime":174125.0,"Position":412.0,"HyperDash":false},{"StartTime":174178.0,"Position":426.1397,"HyperDash":false},{"StartTime":174232.0,"Position":445.433044,"HyperDash":false},{"StartTime":174285.0,"Position":425.572754,"HyperDash":false},{"StartTime":174375.0,"Position":450.394928,"HyperDash":false}]},{"StartTime":174625.0,"Objects":[{"StartTime":174625.0,"Position":398.0,"HyperDash":false},{"StartTime":174678.0,"Position":380.028442,"HyperDash":false},{"StartTime":174732.0,"Position":327.434753,"HyperDash":false},{"StartTime":174785.0,"Position":306.4632,"HyperDash":false},{"StartTime":174875.0,"Position":242.473724,"HyperDash":false}]},{"StartTime":175000.0,"Objects":[{"StartTime":175000.0,"Position":245.0,"HyperDash":false}]},{"StartTime":175125.0,"Objects":[{"StartTime":175125.0,"Position":245.0,"HyperDash":false},{"StartTime":175178.0,"Position":247.860275,"HyperDash":false},{"StartTime":175232.0,"Position":229.566971,"HyperDash":false},{"StartTime":175285.0,"Position":219.427246,"HyperDash":false},{"StartTime":175375.0,"Position":206.605072,"HyperDash":false}]},{"StartTime":175625.0,"Objects":[{"StartTime":175625.0,"Position":259.0,"HyperDash":false},{"StartTime":175678.0,"Position":271.971558,"HyperDash":false},{"StartTime":175732.0,"Position":338.565247,"HyperDash":false},{"StartTime":175785.0,"Position":339.5368,"HyperDash":false},{"StartTime":175875.0,"Position":414.526276,"HyperDash":false}]},{"StartTime":176125.0,"Objects":[{"StartTime":176125.0,"Position":424.0,"HyperDash":false}]},{"StartTime":176375.0,"Objects":[{"StartTime":176375.0,"Position":272.0,"HyperDash":false}]},{"StartTime":176625.0,"Objects":[{"StartTime":176625.0,"Position":116.0,"HyperDash":false}]},{"StartTime":176875.0,"Objects":[{"StartTime":176875.0,"Position":173.0,"HyperDash":false},{"StartTime":176937.0,"Position":220.433136,"HyperDash":false},{"StartTime":177000.0,"Position":248.325027,"HyperDash":false},{"StartTime":177062.0,"Position":256.667,"HyperDash":false},{"StartTime":177125.0,"Position":270.778076,"HyperDash":false},{"StartTime":177187.0,"Position":271.125366,"HyperDash":false},{"StartTime":177250.0,"Position":267.005768,"HyperDash":false},{"StartTime":177312.0,"Position":259.9013,"HyperDash":false},{"StartTime":177375.0,"Position":212.426208,"HyperDash":false},{"StartTime":177437.0,"Position":239.901321,"HyperDash":false},{"StartTime":177500.0,"Position":249.239349,"HyperDash":false},{"StartTime":177562.0,"Position":285.125366,"HyperDash":false},{"StartTime":177625.0,"Position":270.676758,"HyperDash":false},{"StartTime":177678.0,"Position":275.8453,"HyperDash":false},{"StartTime":177732.0,"Position":255.82901,"HyperDash":false},{"StartTime":177785.0,"Position":207.305466,"HyperDash":false},{"StartTime":177874.0,"Position":173.0,"HyperDash":false}]},{"StartTime":178125.0,"Objects":[{"StartTime":178125.0,"Position":28.0,"HyperDash":false},{"StartTime":178187.0,"Position":78.55116,"HyperDash":false},{"StartTime":178250.0,"Position":102.707985,"HyperDash":false},{"StartTime":178312.0,"Position":129.259155,"HyperDash":false},{"StartTime":178375.0,"Position":179.41597,"HyperDash":false},{"StartTime":178428.0,"Position":226.516159,"HyperDash":false},{"StartTime":178482.0,"Position":240.222,"HyperDash":false},{"StartTime":178535.0,"Position":283.3222,"HyperDash":false},{"StartTime":178625.0,"Position":330.83194,"HyperDash":false}]},{"StartTime":178875.0,"Objects":[{"StartTime":178875.0,"Position":172.0,"HyperDash":false},{"StartTime":178937.0,"Position":221.551163,"HyperDash":false},{"StartTime":179000.0,"Position":253.707977,"HyperDash":false},{"StartTime":179062.0,"Position":274.259155,"HyperDash":false},{"StartTime":179125.0,"Position":323.415955,"HyperDash":false},{"StartTime":179178.0,"Position":344.516174,"HyperDash":false},{"StartTime":179232.0,"Position":379.222,"HyperDash":false},{"StartTime":179285.0,"Position":429.3222,"HyperDash":false},{"StartTime":179375.0,"Position":474.83194,"HyperDash":false}]},{"StartTime":179625.0,"Objects":[{"StartTime":179625.0,"Position":384.0,"HyperDash":false},{"StartTime":179678.0,"Position":348.327026,"HyperDash":false},{"StartTime":179732.0,"Position":316.224579,"HyperDash":false},{"StartTime":179785.0,"Position":267.12973,"HyperDash":false},{"StartTime":179875.0,"Position":244.098541,"HyperDash":false}]},{"StartTime":180000.0,"Objects":[{"StartTime":180000.0,"Position":244.0,"HyperDash":false}]},{"StartTime":180125.0,"Objects":[{"StartTime":180125.0,"Position":244.0,"HyperDash":false},{"StartTime":180178.0,"Position":217.455292,"HyperDash":false},{"StartTime":180232.0,"Position":186.277634,"HyperDash":false},{"StartTime":180285.0,"Position":129.732925,"HyperDash":false},{"StartTime":180375.0,"Position":85.77019,"HyperDash":false}]},{"StartTime":180625.0,"Objects":[{"StartTime":180625.0,"Position":100.0,"HyperDash":false},{"StartTime":180678.0,"Position":146.386475,"HyperDash":false},{"StartTime":180732.0,"Position":185.4029,"HyperDash":false},{"StartTime":180785.0,"Position":189.789368,"HyperDash":false},{"StartTime":180875.0,"Position":257.4834,"HyperDash":false}]},{"StartTime":181000.0,"Objects":[{"StartTime":181000.0,"Position":257.0,"HyperDash":false}]},{"StartTime":181125.0,"Objects":[{"StartTime":181125.0,"Position":256.0,"HyperDash":false},{"StartTime":181178.0,"Position":273.4897,"HyperDash":false},{"StartTime":181231.0,"Position":332.9794,"HyperDash":false},{"StartTime":181284.0,"Position":358.4691,"HyperDash":false},{"StartTime":181374.0,"Position":413.338379,"HyperDash":false}]},{"StartTime":181625.0,"Objects":[{"StartTime":181625.0,"Position":426.0,"HyperDash":false},{"StartTime":181678.0,"Position":383.4294,"HyperDash":false},{"StartTime":181732.0,"Position":353.2254,"HyperDash":false},{"StartTime":181785.0,"Position":325.654816,"HyperDash":false},{"StartTime":181875.0,"Position":267.648163,"HyperDash":false}]},{"StartTime":182000.0,"Objects":[{"StartTime":182000.0,"Position":267.0,"HyperDash":false}]},{"StartTime":182125.0,"Objects":[{"StartTime":182125.0,"Position":267.0,"HyperDash":false},{"StartTime":182178.0,"Position":226.982559,"HyperDash":false},{"StartTime":182232.0,"Position":205.749466,"HyperDash":false},{"StartTime":182285.0,"Position":176.327576,"HyperDash":false},{"StartTime":182375.0,"Position":168.9247,"HyperDash":false}]},{"StartTime":182625.0,"Objects":[{"StartTime":182625.0,"Position":140.0,"HyperDash":false},{"StartTime":182678.0,"Position":155.139557,"HyperDash":false},{"StartTime":182731.0,"Position":203.985977,"HyperDash":false},{"StartTime":182784.0,"Position":216.5605,"HyperDash":false},{"StartTime":182874.0,"Position":238.0753,"HyperDash":false}]},{"StartTime":183125.0,"Objects":[{"StartTime":183125.0,"Position":62.0,"HyperDash":false},{"StartTime":183178.0,"Position":70.6348648,"HyperDash":false},{"StartTime":183232.0,"Position":74.16411,"HyperDash":false},{"StartTime":183285.0,"Position":122.076561,"HyperDash":false},{"StartTime":183375.0,"Position":173.7103,"HyperDash":false}]},{"StartTime":183625.0,"Objects":[{"StartTime":183625.0,"Position":348.0,"HyperDash":false},{"StartTime":183678.0,"Position":324.143158,"HyperDash":false},{"StartTime":183732.0,"Position":333.585327,"HyperDash":false},{"StartTime":183785.0,"Position":270.711,"HyperDash":false},{"StartTime":183874.0,"Position":236.603912,"HyperDash":false}]},{"StartTime":184125.0,"Objects":[{"StartTime":184125.0,"Position":64.0,"HyperDash":false}]},{"StartTime":184250.0,"Objects":[{"StartTime":184250.0,"Position":488.0,"HyperDash":false},{"StartTime":184335.0,"Position":482.0,"HyperDash":false},{"StartTime":184421.0,"Position":321.0,"HyperDash":false},{"StartTime":184507.0,"Position":474.0,"HyperDash":false},{"StartTime":184593.0,"Position":252.0,"HyperDash":false},{"StartTime":184679.0,"Position":247.0,"HyperDash":false},{"StartTime":184765.0,"Position":406.0,"HyperDash":false},{"StartTime":184851.0,"Position":319.0,"HyperDash":false},{"StartTime":184937.0,"Position":253.0,"HyperDash":false},{"StartTime":185023.0,"Position":411.0,"HyperDash":false},{"StartTime":185109.0,"Position":205.0,"HyperDash":false},{"StartTime":185195.0,"Position":54.0,"HyperDash":false},{"StartTime":185281.0,"Position":224.0,"HyperDash":false},{"StartTime":185367.0,"Position":465.0,"HyperDash":false},{"StartTime":185453.0,"Position":432.0,"HyperDash":false},{"StartTime":185539.0,"Position":108.0,"HyperDash":false},{"StartTime":185625.0,"Position":95.0,"HyperDash":false}]},{"StartTime":186125.0,"Objects":[{"StartTime":186125.0,"Position":48.0,"HyperDash":false},{"StartTime":186187.0,"Position":89.47744,"HyperDash":false},{"StartTime":186250.0,"Position":93.06244,"HyperDash":false},{"StartTime":186312.0,"Position":160.382751,"HyperDash":false},{"StartTime":186375.0,"Position":190.718857,"HyperDash":false},{"StartTime":186437.0,"Position":209.265518,"HyperDash":false},{"StartTime":186500.0,"Position":273.188416,"HyperDash":false},{"StartTime":186562.0,"Position":294.6259,"HyperDash":false},{"StartTime":186625.0,"Position":321.75354,"HyperDash":false},{"StartTime":186678.0,"Position":352.728241,"HyperDash":false},{"StartTime":186732.0,"Position":377.1885,"HyperDash":false},{"StartTime":186785.0,"Position":409.4063,"HyperDash":false},{"StartTime":186874.0,"Position":463.955,"HyperDash":false}]},{"StartTime":187125.0,"Objects":[{"StartTime":187125.0,"Position":328.0,"HyperDash":false},{"StartTime":187178.0,"Position":313.795776,"HyperDash":false},{"StartTime":187232.0,"Position":325.474457,"HyperDash":false},{"StartTime":187285.0,"Position":313.270233,"HyperDash":false},{"StartTime":187375.0,"Position":298.734741,"HyperDash":false}]},{"StartTime":187625.0,"Objects":[{"StartTime":187625.0,"Position":184.0,"HyperDash":false},{"StartTime":187678.0,"Position":198.204239,"HyperDash":false},{"StartTime":187732.0,"Position":213.525543,"HyperDash":false},{"StartTime":187785.0,"Position":188.729767,"HyperDash":false},{"StartTime":187875.0,"Position":213.265274,"HyperDash":false}]},{"StartTime":188125.0,"Objects":[{"StartTime":188125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":188250.0,"Objects":[{"StartTime":188250.0,"Position":175.0,"HyperDash":false},{"StartTime":188335.0,"Position":48.0,"HyperDash":false},{"StartTime":188421.0,"Position":307.0,"HyperDash":false},{"StartTime":188507.0,"Position":375.0,"HyperDash":false},{"StartTime":188593.0,"Position":149.0,"HyperDash":false},{"StartTime":188679.0,"Position":250.0,"HyperDash":false},{"StartTime":188765.0,"Position":142.0,"HyperDash":false},{"StartTime":188851.0,"Position":170.0,"HyperDash":false},{"StartTime":188937.0,"Position":281.0,"HyperDash":false},{"StartTime":189023.0,"Position":444.0,"HyperDash":false},{"StartTime":189109.0,"Position":414.0,"HyperDash":false},{"StartTime":189195.0,"Position":321.0,"HyperDash":false},{"StartTime":189281.0,"Position":328.0,"HyperDash":false},{"StartTime":189367.0,"Position":32.0,"HyperDash":false},{"StartTime":189453.0,"Position":259.0,"HyperDash":false},{"StartTime":189539.0,"Position":169.0,"HyperDash":false},{"StartTime":189625.0,"Position":207.0,"HyperDash":false}]},{"StartTime":190125.0,"Objects":[{"StartTime":190125.0,"Position":464.0,"HyperDash":false},{"StartTime":190187.0,"Position":452.522552,"HyperDash":false},{"StartTime":190250.0,"Position":408.937561,"HyperDash":false},{"StartTime":190312.0,"Position":358.617249,"HyperDash":false},{"StartTime":190375.0,"Position":321.281128,"HyperDash":false},{"StartTime":190437.0,"Position":281.7345,"HyperDash":false},{"StartTime":190500.0,"Position":240.811569,"HyperDash":false},{"StartTime":190562.0,"Position":234.374115,"HyperDash":false},{"StartTime":190625.0,"Position":190.246445,"HyperDash":false},{"StartTime":190678.0,"Position":161.271759,"HyperDash":false},{"StartTime":190732.0,"Position":103.811485,"HyperDash":false},{"StartTime":190785.0,"Position":84.59368,"HyperDash":false},{"StartTime":190874.0,"Position":48.04496,"HyperDash":false}]},{"StartTime":191125.0,"Objects":[{"StartTime":191125.0,"Position":184.0,"HyperDash":false},{"StartTime":191178.0,"Position":177.204239,"HyperDash":false},{"StartTime":191232.0,"Position":205.525543,"HyperDash":false},{"StartTime":191285.0,"Position":211.729767,"HyperDash":false},{"StartTime":191375.0,"Position":213.265274,"HyperDash":false}]},{"StartTime":191625.0,"Objects":[{"StartTime":191625.0,"Position":328.0,"HyperDash":false},{"StartTime":191678.0,"Position":303.795776,"HyperDash":false},{"StartTime":191732.0,"Position":318.474457,"HyperDash":false},{"StartTime":191785.0,"Position":296.270233,"HyperDash":false},{"StartTime":191875.0,"Position":298.734741,"HyperDash":false}]},{"StartTime":192125.0,"Objects":[{"StartTime":192125.0,"Position":164.0,"HyperDash":false}]},{"StartTime":192375.0,"Objects":[{"StartTime":192375.0,"Position":28.0,"HyperDash":false}]},{"StartTime":192625.0,"Objects":[{"StartTime":192625.0,"Position":28.0,"HyperDash":false}]},{"StartTime":192875.0,"Objects":[{"StartTime":192875.0,"Position":128.0,"HyperDash":false},{"StartTime":192937.0,"Position":126.887405,"HyperDash":false},{"StartTime":193000.0,"Position":175.597244,"HyperDash":false},{"StartTime":193062.0,"Position":198.553162,"HyperDash":false},{"StartTime":193125.0,"Position":235.7683,"HyperDash":false},{"StartTime":193187.0,"Position":291.259583,"HyperDash":false},{"StartTime":193250.0,"Position":330.488678,"HyperDash":false},{"StartTime":193312.0,"Position":338.450653,"HyperDash":false},{"StartTime":193375.0,"Position":390.71225,"HyperDash":false},{"StartTime":193437.0,"Position":356.065,"HyperDash":false},{"StartTime":193500.0,"Position":315.488678,"HyperDash":false},{"StartTime":193562.0,"Position":279.894,"HyperDash":false},{"StartTime":193625.0,"Position":235.7683,"HyperDash":false},{"StartTime":193678.0,"Position":221.0309,"HyperDash":false},{"StartTime":193732.0,"Position":168.99295,"HyperDash":false},{"StartTime":193785.0,"Position":164.902176,"HyperDash":false},{"StartTime":193875.0,"Position":128.0,"HyperDash":false}]},{"StartTime":194125.0,"Objects":[{"StartTime":194125.0,"Position":276.0,"HyperDash":false},{"StartTime":194187.0,"Position":324.316467,"HyperDash":false},{"StartTime":194250.0,"Position":328.094818,"HyperDash":false},{"StartTime":194312.0,"Position":373.795776,"HyperDash":false},{"StartTime":194375.0,"Position":386.318756,"HyperDash":false},{"StartTime":194428.0,"Position":376.7576,"HyperDash":false},{"StartTime":194482.0,"Position":404.218842,"HyperDash":false},{"StartTime":194535.0,"Position":384.551483,"HyperDash":false},{"StartTime":194624.0,"Position":374.339844,"HyperDash":false}]},{"StartTime":194875.0,"Objects":[{"StartTime":194875.0,"Position":236.0,"HyperDash":false},{"StartTime":194937.0,"Position":201.752014,"HyperDash":false},{"StartTime":195000.0,"Position":162.019058,"HyperDash":false},{"StartTime":195062.0,"Position":146.331146,"HyperDash":false},{"StartTime":195125.0,"Position":125.789307,"HyperDash":false},{"StartTime":195178.0,"Position":127.304863,"HyperDash":false},{"StartTime":195232.0,"Position":133.772476,"HyperDash":false},{"StartTime":195285.0,"Position":111.34684,"HyperDash":false},{"StartTime":195375.0,"Position":137.660187,"HyperDash":false}]},{"StartTime":195625.0,"Objects":[{"StartTime":195625.0,"Position":280.0,"HyperDash":false},{"StartTime":195678.0,"Position":279.7856,"HyperDash":false},{"StartTime":195732.0,"Position":250.37854,"HyperDash":false},{"StartTime":195785.0,"Position":235.164154,"HyperDash":false},{"StartTime":195875.0,"Position":231.818985,"HyperDash":false}]},{"StartTime":196125.0,"Objects":[{"StartTime":196125.0,"Position":104.0,"HyperDash":false}]},{"StartTime":196375.0,"Objects":[{"StartTime":196375.0,"Position":136.0,"HyperDash":false}]},{"StartTime":196625.0,"Objects":[{"StartTime":196625.0,"Position":116.0,"HyperDash":false}]},{"StartTime":196875.0,"Objects":[{"StartTime":196875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":197000.0,"Objects":[{"StartTime":197000.0,"Position":332.0,"HyperDash":false}]},{"StartTime":197125.0,"Objects":[{"StartTime":197125.0,"Position":408.0,"HyperDash":false}]},{"StartTime":197250.0,"Objects":[{"StartTime":197250.0,"Position":392.0,"HyperDash":false}]},{"StartTime":197375.0,"Objects":[{"StartTime":197375.0,"Position":376.0,"HyperDash":false}]},{"StartTime":197625.0,"Objects":[{"StartTime":197625.0,"Position":396.0,"HyperDash":false}]},{"StartTime":197875.0,"Objects":[{"StartTime":197875.0,"Position":256.0,"HyperDash":false}]},{"StartTime":198000.0,"Objects":[{"StartTime":198000.0,"Position":256.0,"HyperDash":false}]},{"StartTime":198125.0,"Objects":[{"StartTime":198125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":198625.0,"Objects":[{"StartTime":198625.0,"Position":136.0,"HyperDash":false}]},{"StartTime":199125.0,"Objects":[{"StartTime":199125.0,"Position":256.0,"HyperDash":false}]},{"StartTime":199625.0,"Objects":[{"StartTime":199625.0,"Position":376.0,"HyperDash":false}]},{"StartTime":200125.0,"Objects":[{"StartTime":200125.0,"Position":256.0,"HyperDash":false}]}]} \ No newline at end of file diff --git a/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643.osu b/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643.osu new file mode 100644 index 0000000000..35ef17ae34 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/Resources/Testing/Beatmaps/112643.osu @@ -0,0 +1,582 @@ +osu file format v9 + +[General] +StackLeniency: 0.7 +Mode: 0 + +[Difficulty] +HPDrainRate:7 +CircleSize:5 +OverallDifficulty:8 +ApproachRate:8 +SliderMultiplier:3.2 +SliderTickRate:2 + +[Events] +//Background and Video events +//Break Periods +2,16325,17625 +2,32325,33875 +2,66325,67375 +2,120135,127375 +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Sound Samples +//Background Colour Transformations +3,100,163,162,255 + +[TimingPoints] +125,500,4,1,0,50,1,0 +36125,-100,4,1,0,50,0,1 +66125,-100,4,1,0,50,0,0 +88125,-100,4,1,0,50,0,1 +120125,-100,4,1,0,50,0,0 +170125,-100,4,2,0,5,0,0 +170250,-100,4,1,0,50,0,0 +172125,-100,4,1,0,50,0,1 +200125,-100,4,1,0,50,0,0 + +[HitObjects] +64,80,2375,5,0 +172,192,2625,1,2 +152,36,2875,1,0 +80,176,3125,1,2 +224,112,3375,1,0 +192,256,3625,1,8 +136,116,3875,1,0 +272,32,4125,2,2,B|376:0|408:56|412:125|320:144|304:176|328:216|368:272|496:208,1,400,6|0 +504,216,4875,2,2,B|376:232|288:280|248:384,1,320 +384,344,5625,1,8 +272,216,5875,1,0 +272,216,6000,1,0 +272,216,6125,1,4 +92,280,6375,5,0 +124,108,6625,1,8 +256,8,6875,1,0 +388,108,7125,1,2 +420,280,7375,1,8 +256,296,7625,1,8 +256,120,7875,1,0 +443,152,8125,2,2,B|397:202|305:219|256:192|203:163|114:181|68:231,1,400,2|0 +24,256,8875,2,2,B|112:227|141:134|122:36|37:1,1,320 +16,132,9625,1,8 +136,280,9875,1,0 +136,280,10000,1,0 +136,280,10125,1,4 +256,172,10375,5,0 +368,56,10625,1,8 +196,116,10875,1,0 +316,116,11125,1,2 +144,56,11375,1,0 +256,0,11625,1,8 +112,128,11875,1,0 +164,280,12125,6,0,B|256:316,1,80,4|2 +100,348,12500,2,0,B|8:312,1,80,0|2 +144,212,12875,2,0,B|52:176,1,80,0|2 +208,144,13250,2,0,B|300:180,1,80,0|2 +332,324,13625,1,8 +180,324,13875,1,0 +256,240,14125,5,4 +256,240,14250,1,2 +324,112,14500,1,0 +324,112,14625,1,2 +192,56,14875,1,4 +192,56,15000,1,2 +256,164,15250,1,0 +256,164,15375,1,2 +256,20,15625,1,8 +120,56,15875,1,0 +256,92,16125,1,6 +20,152,18375,5,0 +180,136,18625,1,8 +52,228,18875,1,0 +120,84,19125,1,2 +128,244,19375,1,0 +48,84,19625,1,8 +192,212,19875,1,0 +300,72,20125,2,4,B|396:36|444:84|396:144|352:184|372:224|416:260|532:224|528:164,1,320,4|0 +472,40,20875,2,2,B|376:72|304:164|272:260|280:320,1,320 +404,352,21625,1,8 +432,196,21875,1,0 +432,196,22000,1,0 +432,196,22125,1,4 +296,100,22375,5,0 +168,196,22625,2,0,B|32:296,1,160,8|0 +268,212,23125,2,0,B|168:76,1,160,2|8 +252,312,23625,2,0,B|388:212,1,160,8|0 +484,96,24125,2,2,B|412:0|320:36|288:120|240:136|200:132|156:116|132:96|80:44,1,400,2|0 +72,24,24875,2,2,B|158:66|148:177|67:253|-19:210,1,320 +56,108,25625,1,8 +176,200,25875,1,0 +176,200,26000,1,0 +176,200,26125,1,4 +316,92,26375,5,0 +464,164,26625,2,0,B|394:224|412:336,1,160,2|0 +232,316,27125,2,0,B|306:256|284:144,1,160,2|8 +136,88,27625,1,8 +60,224,27875,1,0 +212,132,28125,6,0,B|256:32,1,80,4|2 +340,228,28500,2,0,B|384:128,1,80,0|2 +256,284,28875,2,0,B|212:184,1,80,4|2 +128,380,29250,2,0,B|84:280,1,80,0|2 +238,383,29625,2,0,B|406:379,1,160,8|0 +512,267,30125,5,4 +512,267,30250,1,2 +416,152,30500,1,0 +416,152,30625,1,2 +300,264,30875,1,4 +300,264,31000,1,2 +236,100,31250,1,0 +236,100,31375,1,2 +152,256,31625,1,8 +300,160,31875,1,0 +256,332,32125,1,6 +52,52,34625,5,0 +152,164,34875,1,0 +256,56,35125,1,4 +256,56,35625,1,2 +256,56,36125,2,4,B|331:63|364:136|320:224,1,160,4|0 +320,312,36625,1,8 +204,228,36875,1,0 +104,328,37125,2,2,B|24:287|44:188,1,160 +92,60,37625,1,8 +212,148,37875,1,0 +268,104,38000,1,0 +324,60,38125,2,0,B|452:184,1,160,4|0 +504,300,38625,1,8 +364,340,38875,1,0 +232,280,39125,6,2,B|150:282|69:198|105:87|179:53,2,320,2|2|6 +280,148,40375,1,0 +400,228,40625,2,0,B|520:368,1,160,8|0 +480,192,41125,1,2 +324,220,41375,1,2 +168,256,41625,1,8 +72,148,41875,1,2 +48,84,42000,1,2 +96,36,42125,2,0,B|164:108|256:44,1,160,6|0 +400,72,42625,1,2 +440,236,42875,1,2 +464,300,43000,1,2 +416,348,43125,2,0,B|348:276|256:340,1,160,6|0 +112,312,43625,1,2 +140,188,43875,1,0 +52,64,44125,5,6 +208,48,44375,1,0 +344,132,44625,1,8 +448,256,44875,2,2,B|401:321|285:337|217:242|233:163,2,320,2|2|0 +326,211,46125,2,2,B|279:146|163:130|95:225|111:304,1,320,6|0 +230,287,46875,2,2,B|277:352|393:368|461:273|445:194,1,320,6|8 +376,80,47625,1,8 +376,80,48125,6,0,B|304:128|216:96,1,160,4|0 +84,56,48625,1,8 +152,200,48875,1,0 +44,320,49125,2,0,B|121:364|204:320,1,160,4|0 +336,240,49625,5,8 +256,148,49875,1,0 +176,240,50125,1,0 +340,144,50625,1,0 +420,236,50875,1,0 +500,144,51125,1,2 +172,144,51625,1,2 +92,236,51875,1,0 +12,144,52125,6,0,B|160:48,1,160,4|0 +304,76,52625,1,8 +256,228,52875,1,0 +216,112,53125,2,0,B|364:208,1,160,2|0 +508,180,53625,1,8 +460,28,53875,1,0 +344,96,54125,1,2 +228,8,54375,1,0 +153,116,54625,1,2 +72,220,54875,1,0 +180,295,55125,1,2 +284,376,55375,1,0 +359,268,55625,1,2 +440,164,55875,1,0 +352,160,56125,6,0,B|466:294,1,160,4|0 +312,228,56625,1,8 +200,300,56875,1,0 +160,160,57125,2,0,B|46:294,1,160,4|0 +200,228,57625,1,8 +312,300,57875,1,0 +444,208,58125,2,0,B|362:164|380:56,1,160,2|0 +344,12,58500,1,0 +272,4,58625,2,0,B|232:88|120:68,1,160,2|0 +68,176,59125,2,0,B|148:220|132:328,1,160,2|0 +168,372,59500,1,0 +240,380,59625,2,0,B|280:296|392:316,1,160,2|0 +456,176,60125,5,6 +328,80,60375,1,0 +216,196,60625,1,8 +72,136,60875,2,2,B|54:209|91:305|191:336|269:306,2,320,2|2|0 +200,224,62125,2,2,B|182:150|219:54|319:23|397:53,1,320,2|0 +480,179,62875,2,2,B|499:252|462:348|362:379|284:349,1,320,2|0 +136,296,63625,2,0,B|67:220|140:136,1,160,8|0 +256,56,64125,5,6 +284,212,64375,1,0 +440,180,64625,1,8 +420,24,64875,1,0 +300,132,65125,1,6 +272,288,65375,1,0 +116,256,65625,1,8 +136,100,65875,1,0 +256,8,66125,1,4 +256,56,68125,6,0,B|298:128|244:237|123:241|74:173,1,320 +132,80,68875,2,2,B|344:328,1,320 +456,224,69625,1,8 +340,116,69875,1,0 +340,116,70000,1,0 +340,116,70125,1,4 +228,4,70375,5,0 +256,160,70625,2,0,B|186:224|88:168,1,160,2|0 +148,332,71125,2,0,B|216:396|316:340,1,160,2|8 +424,248,71625,1,8 +336,112,71875,1,0 +336,112,72000,1,0 +336,112,72125,1,4 +228,208,72375,2,0,B|139:179|144:80,1,160,0|8 +268,56,72875,2,2,B|272:164|220:272|120:308|72:308,1,320 +24,192,73625,1,8 +92,64,73875,1,0 +92,64,74000,1,0 +92,64,74125,1,4 +224,140,74375,5,0 +340,224,74625,2,0,B|412:211|428:121|363:77,1,160,2|0 +268,192,75125,2,0,B|196:205|180:295|245:339,1,160,2|0 +268,192,75625,2,0,B|104:168,1,160,8|0 +24,52,76125,6,0,B|132:40,1,80 +176,32,76375,1,2 +348,60,76625,1,2 +248,164,76875,1,2 +264,20,77125,1,2 +324,140,77375,1,2 +180,116,77625,1,2 +240,240,77875,1,0 +256,92,78125,1,4 +100,124,78375,5,0 +8,256,78625,2,0,B|64:332|176:304,1,160,8|0 +304,260,79125,2,0,B|248:184|136:212,1,160,2|0 +304,260,79625,1,8 +460,284,79875,1,2 +420,128,80125,6,0,B|332:128,1,80,4|0 +256,124,80375,1,2 +344,260,80625,1,2 +168,260,80875,1,2 +384,192,81125,1,2 +256,260,81375,1,2 +168,124,81625,1,2 +344,124,81875,1,2 +128,192,82125,1,4 +48,192,82250,6,0,B|48:84|152:52,1,160,2|0 +204,44,82625,2,0,B|204:152|308:184,1,160,2|0 +352,160,83000,2,0,B|244:160|212:264,1,160,2|0 +192,316,83375,2,0,B|84:316|52:212,1,160,2|2 +32,88,83875,1,2 +172,8,84125,1,4 +256,192,84250,12,6,86125 +256,192,86250,12,4,87125 +256,100,88125,6,2,B|308:116|368:104|404:16,1,160,6|0 +256,100,88625,1,8 +136,180,88875,1,0 +8,96,89125,2,0,B|-28:168|16:232|68:256,1,160,2|0 +164,312,89625,1,8 +288,236,89875,1,2 +288,236,90000,1,2 +288,236,90125,2,2,B|452:164,1,160,6|0 +476,32,90625,1,8 +332,104,90875,1,0 +180,104,91125,5,6 +36,32,91375,1,8 +56,164,91625,1,8 +56,164,92125,2,0,B|260:208,1,160,6|0 +84,296,92625,1,8 +220,376,92875,1,0 +320,268,93125,2,0,B|524:224,1,160,6|0 +432,80,93625,1,8 +296,152,93875,1,2 +296,152,94000,1,2 +296,152,94125,2,2,B|232:164|176:132|164:52,1,160,6|0 +216,232,94625,2,2,B|280:220|336:252|348:332,1,160,2|0 +341,304,95000,1,0 +341,304,95125,2,0,B|369:84,1,160,2|0 +171,80,95625,2,0,B|143:300,1,160,2|0 +43,358,96125,5,6 +81,219,96375,1,0 +169,332,96625,1,8 +304,272,96875,2,2,B|388:252|426:161|418:63|344:19,2,320,2|2|0 +240,144,98125,2,2,B|219:244|50:229|65:60|168:58,1,320 +240,144,98875,2,2,B|260:43|429:58|414:227|311:229,1,320,2|0 +180,292,99625,2,0,B|80:304|36:208,1,160,2|0 +48,64,100125,6,0,B|224:112,1,160,4|0 +348,52,100625,2,0,B|524:4,1,160,2|0 +504,172,101125,2,0,B|328:124,1,160,2|0 +204,184,101625,2,0,B|28:232,1,160,2|0 +49,226,102000,1,0 +49,226,102125,1,2 +256,324,102625,5,8 +384,256,102875,1,0 +256,188,103125,1,6 +256,188,103625,1,2 +128,256,103875,1,0 +256,324,104125,6,0,B|324:252|432:316,1,160,6|0 +492,168,104625,1,8 +332,188,104875,1,0 +256,60,105125,2,0,B|188:132|80:68,1,160,6|0 +20,216,105625,1,8 +180,196,105875,1,0 +368,156,106125,2,0,B|418:184|462:234|408:296,1,160,2|0 +220,80,106625,2,0,B|248:30|298:-14|360:40,1,160,2|0 +144,228,107125,2,0,B|94:200|50:150|104:88,1,160,2|0 +292,304,107625,2,0,B|264:354|214:398|152:344,1,160,2|0 +44,216,108125,6,0,B|145:221|172:132,1,160,6|0 +304,224,108625,1,8 +408,104,108875,1,0 +468,216,109125,2,0,B|367:221|340:132,1,160,6|0 +208,224,109625,1,8 +104,104,109875,1,0 +256,56,110125,2,0,B|144:180,1,160,2|0 +256,328,110625,2,0,B|368:204,1,160,2|0 +208,244,111125,2,0,B|96:368,1,160,2|0 +304,140,111625,2,0,B|416:16,1,160,2|0 +252,20,112125,5,6 +112,60,112375,1,0 +72,200,112625,1,8 +158,316,112875,2,2,B|236:321|324:259|326:152|278:89,2,320,2|2|0 +176,168,114125,2,2,B|214:236|313:276|405:220|431:145,1,320,2|0 +328,64,114875,2,2,B|259:102|219:201|275:293|350:319,1,320,2|0 +488,340,115625,2,0,B|456:172,1,160,2|0 +416,72,116125,5,6 +288,140,116375,1,0 +164,68,116625,1,8 +36,136,116875,1,0 +104,264,117125,1,6 +232,332,117375,1,0 +356,260,117625,1,8 +484,328,117875,1,0 +356,384,118125,1,6 +256,12,128125,5,4 +256,12,128250,1,2 +336,128,128500,1,0 +336,128,128625,1,2 +400,0,128875,1,0 +400,0,129000,1,2 +492,112,129250,1,0 +492,112,129375,1,2 +440,248,129625,2,2,B|272:284,1,160 +256,108,130125,5,4 +256,108,130250,1,2 +176,224,130500,1,0 +176,224,130625,1,2 +112,96,130875,1,0 +112,96,131000,1,2 +20,208,131250,1,0 +20,208,131375,1,2 +72,344,131625,2,2,B|240:380,1,160 +408,376,132125,6,0,B|512:352|584:248|592:-32|416:-48|256:-80|96:-16|56:88|8:224|88:304|144:336|184:368|256:368|256:368|328:368|368:336|424:304|504:224|456:88|416:-16|256:-80|96:-48|-80:-32|-72:248|0:352|104:376,1,2240,6|0 +256,192,135875,5,2 +256,192,136000,1,0 +256,192,136125,1,4 +136,104,136375,1,0 +132,240,136625,1,8 +133,240,136750,1,0 +256,280,137000,1,0 +255,280,137125,1,8 +256,280,137250,1,0 +256,280,137375,1,0 +380,240,137625,1,8 +376,104,137875,1,0 +256,124,138125,5,4 +256,124,138375,1,0 +144,192,138625,1,8 +144,192,138750,1,0 +256,260,139000,1,0 +256,260,139125,1,8 +256,260,139250,1,0 +256,260,139375,1,0 +368,192,139625,1,8 +256,124,139875,1,0 +256,124,140000,1,0 +256,124,140125,2,2,B|188:112|212:76|188:36|256:20,1,160,6|2 +332,128,140625,5,8 +332,128,140750,1,0 +332,256,141000,1,0 +332,256,141125,1,8 +332,256,141250,1,0 +332,256,141375,1,0 +180,256,141625,1,8 +180,128,141875,1,0 +256,56,142125,5,4 +256,56,142375,1,0 +256,160,142625,1,8 +256,160,142750,1,0 +256,264,143000,1,0 +256,264,143125,1,8 +256,264,143250,1,0 +256,264,143375,1,0 +188,352,143625,1,8 +324,352,143875,1,0 +324,352,144000,1,0 +324,352,144125,2,0,B|492:352,1,160,6|2 +392,280,144625,5,8 +392,280,144750,1,0 +324,192,145000,1,0 +324,192,145125,1,8 +324,192,145250,1,0 +324,192,145375,1,0 +188,192,145625,1,8 +120,280,145875,1,0 +256,288,146125,5,4 +256,288,146375,1,0 +256,176,146625,1,8 +256,176,146750,1,0 +176,96,147000,1,0 +176,96,147125,1,8 +176,96,147250,1,0 +176,96,147375,1,0 +256,16,147625,1,8 +336,96,147875,1,0 +336,96,148000,1,0 +336,96,148125,2,6,B|400:156|388:224|364:248,1,160,6|2 +256,272,148625,5,8 +240,264,148750,1,0 +240,180,149000,1,0 +256,172,149125,1,8 +272,164,149250,1,0 +288,156,149375,1,0 +256,64,149625,1,8 +256,64,149875,1,0 +116,180,150125,5,0 +120,200,150250,1,0 +132,224,150375,1,0 +152,236,150500,1,0 +176,240,150625,1,8 +208,240,150750,1,0 +232,236,150875,1,0 +248,216,151000,1,0 +256,192,151125,1,8 +260,168,151250,1,0 +272,144,151375,1,8 +292,132,151500,1,0 +316,128,151625,1,8 +348,128,151750,1,8 +372,132,151875,1,8 +388,152,152000,1,0 +404,184,152125,6,0,B|436:250|377:334|292:300,1,160,6|0 +108,200,152625,2,0,B|76:134|135:50|220:84,1,160,6|0 +256,192,153125,2,0,B|256:100,1,80,2|0 +256,192,153375,2,0,B|256:368,2,160,2|8|0 +360,60,154125,5,0 +360,60,154250,1,0 +360,60,154375,1,2 +256,12,154625,1,0 +256,12,154750,1,0 +256,12,154875,1,2 +154,64,155125,1,0 +154,64,155250,1,2 +155,63,155375,2,0,B|87:119|115:191|179:211|227:179,2,160,0|8|0 +163,74,156000,5,0 +163,74,156125,1,0 +163,74,156250,2,2,B|174:151|299:265|445:180|473:106,1,400,2|0 +320,80,157125,2,2,B|224:88|184:188|224:288|320:295,1,320 +348,292,157750,1,0 +380,280,157875,1,0 +404,260,158000,1,0 +412,236,158125,1,0 +412,208,158250,1,0 +404,180,158375,1,0 +264,68,158625,2,0,B|184:104,2,80,2|0|2 +164,216,159125,2,0,B|244:180,2,80,2|0|2 +56,144,159625,5,8 +64,276,159875,1,8 +64,276,160000,1,8 +64,276,160125,2,0,B|24:352,2,80,2|0|0 +128,288,160500,2,0,B|136:188,2,80,2|0|0 +192,300,160875,2,0,B|200:400,2,80,2|0|0 +240,256,161250,2,0,B|304:176,2,80,2|0|0 +284,304,161625,2,0,B|356:380,2,80,2|0|0 +328,256,162000,6,0,B|456:236,2,80,0|2|0 +308,192,162375,2,0,B|180:172,2,80,0|2|0 +340,136,162750,2,0,B|468:116,2,80,0|2|0 +284,100,163125,2,0,B|264:-28,2,80,0|2|0 +224,128,163500,2,0,B|204:256,2,80,0|2|0 +180,76,163875,6,0,B|92:52,2,80,2|0|0 +144,132,164250,2,0,B|72:184,2,80,2|0|0 +168,196,164625,2,0,B|240:248,2,80,2|0|0 +136,256,165000,2,0,B|96:340,2,80,2|0|0 +188,296,165375,2,0,B|228:380,2,80,2|0|0 +236,252,165750,1,0 +236,252,165875,1,2 +364,276,166125,6,2,B|408:176|360:156|320:168|296:176|268:132|264:112|272:76|304:52|328:40,1,240,2|0 +264,24,166625,2,2,B|308:124|260:144|220:132|196:124|168:168|164:188|172:224|204:248|228:260,1,240,2|0 +192,280,167125,1,0 +320,376,167375,1,0 +192,376,167625,1,0 +256,328,167750,1,0 +320,280,167875,1,0 +256,124,168125,1,6 +256,192,168250,12,0,170125 +256,192,171125,12,6,172125 +48,56,172375,5,0 +20,184,172625,2,0,B|16:264|92:316|152:304,1,160,8|0 +240,300,173125,1,2 +200,176,173375,1,0 +324,220,173625,2,0,B|360:220|416:258|412:338,1,160,8|0 +412,334,174000,1,0 +412,334,174125,2,0,B|456:156,1,160,6|0 +398,35,174625,2,0,B|220:-8,1,160,2|0 +245,0,175000,1,0 +245,0,175125,2,0,B|201:178,1,160,6|0 +259,299,175625,2,0,B|437:342,1,160,2|0 +424,176,176125,5,6 +272,128,176375,1,0 +116,152,176625,1,8 +173,253,176875,2,2,B|257:233|295:142|287:44|213:0,2,320,2|2|0 +28,204,178125,2,2,B|356:316,1,320 +172,360,178875,2,2,B|500:248,1,320,2|0 +384,148,179625,2,0,B|292:168|224:96|232:44,1,160,2|0 +244,93,180000,1,0 +244,93,180125,6,0,B|64:120,1,160,6|0 +100,268,180625,2,0,B|256:296,1,160,8|0 +257,296,181000,1,0 +256,296,181125,2,0,B|413:267,1,160,6|0 +426,116,181625,2,0,B|267:93,1,160,8|2 +267,93,182000,5,2 +267,93,182125,2,2,B|180:112|168:212,1,160,2|0 +140,380,182625,2,0,B|227:361|239:261,1,160,8|0 +62,169,183125,2,2,B|80:256|180:268,1,160,2|0 +348,296,183625,2,0,B|329:208|229:196,1,160,8|0 +64,172,184125,1,6 +256,192,184250,12,2,185625 +48,188,186125,6,2,B|96:108|256:108|256:192|256:276|416:276|464:196,1,480,2|0 +328,144,187125,2,0,B|296:316,1,160,2|0 +184,240,187625,2,0,B|216:68,1,160,2|0 +256,192,188125,1,6 +256,192,188250,12,2,189625 +464,188,190125,6,2,B|416:108|256:108|256:192|256:276|96:276|48:196,1,480,2|0 +184,144,191125,2,0,B|216:316,1,160,2|0 +328,240,191625,2,0,B|296:68,1,160,2|0 +164,32,192125,5,6 +28,84,192375,1,0 +28,228,192625,1,8 +128,332,192875,2,2,B|160:224|300:172|408:244,2,320,2|2|0 +276,356,194125,2,2,B|384:324|436:184|364:76,1,320 +236,28,194875,2,2,B|128:60|76:200|148:308,1,320,2|0 +280,268,195625,2,0,B|232:116,1,160,2|0 +104,52,196125,5,6 +136,192,196375,1,0 +116,344,196625,1,8 +256,312,196875,1,0 +332,312,197000,1,0 +408,332,197125,1,6 +392,264,197250,1,0 +376,192,197375,1,0 +396,40,197625,1,8 +256,72,197875,5,0 +256,72,198000,1,0 +256,72,198125,1,6 +136,192,198625,1,6 +256,312,199125,1,6 +376,192,199625,1,6 +256,192,200125,1,6 diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index 02d4cdbb94..d5d4d3b694 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -44,6 +44,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps base.PostProcess(); ApplyPositionOffsets(Beatmap); + ApplyPositionClamping(Beatmap); int index = 0; @@ -114,6 +115,17 @@ namespace osu.Game.Rulesets.Catch.Beatmaps initialiseHyperDash(beatmap); } + public void ApplyPositionClamping(IBeatmap beatmap) + { + foreach (var obj in beatmap.HitObjects.OfType()) + { + if (obj.EffectiveX < 0) + obj.XOffset += Math.Abs(obj.EffectiveX); + else if (obj.EffectiveX > CatchPlayfield.WIDTH) + obj.XOffset += CatchPlayfield.WIDTH - obj.EffectiveX; + } + } + private static void applyHardRockOffset(CatchHitObject hitObject, ref float? lastPosition, ref double lastStartTime, LegacyRandom rng) { float offsetPosition = hitObject.OriginalX; diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index d691ceceb1..671291ef0e 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -10,7 +10,6 @@ using osu.Framework.Bindables; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -103,8 +102,7 @@ namespace osu.Game.Rulesets.Catch.Objects AddNested(new TinyDroplet { StartTime = t + lastEvent.Value.Time, - X = ClampToPlayfield(EffectiveX + Path.PositionAt( - lastEvent.Value.PathProgress + (t / sinceLastTick) * (e.PathProgress - lastEvent.Value.PathProgress)).X), + X = EffectiveX + Path.PositionAt(lastEvent.Value.PathProgress + (t / sinceLastTick) * (e.PathProgress - lastEvent.Value.PathProgress)).X, }); } } @@ -121,7 +119,7 @@ namespace osu.Game.Rulesets.Catch.Objects { Samples = dropletSamples, StartTime = e.Time, - X = ClampToPlayfield(EffectiveX + Path.PositionAt(e.PathProgress).X), + X = EffectiveX + Path.PositionAt(e.PathProgress).X, }); break; @@ -132,16 +130,14 @@ namespace osu.Game.Rulesets.Catch.Objects { Samples = this.GetNodeSamples(nodeIndex++), StartTime = e.Time, - X = ClampToPlayfield(EffectiveX + Path.PositionAt(e.PathProgress).X), + X = EffectiveX + Path.PositionAt(e.PathProgress).X, }); break; } } } - public float EndX => ClampToPlayfield(EffectiveX + this.CurvePositionAt(1).X); - - public float ClampToPlayfield(float value) => Math.Clamp(value, 0, CatchPlayfield.WIDTH); + public float EndX => EffectiveX + this.CurvePositionAt(1).X; [JsonIgnore] public double Duration From b20b2203ac92c3c261df43967fe6d6e140e58496 Mon Sep 17 00:00:00 2001 From: PercyDan54 <50285552+PercyDan54@users.noreply.github.com> Date: Mon, 11 Dec 2023 21:06:46 +0800 Subject: [PATCH 114/567] Fix mania Autoplay mod missing 0ms hold notes --- .../Mods/TestSceneManiaModAutoplay.cs | 42 +++++++++++++++++++ .../Replays/ManiaAutoGenerator.cs | 17 +++++--- 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModAutoplay.cs diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModAutoplay.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModAutoplay.cs new file mode 100644 index 0000000000..f653f209c1 --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModAutoplay.cs @@ -0,0 +1,42 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Mania.Tests.Mods +{ + public partial class TestSceneManiaModAutoplay : ModTestScene + { + protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset(); + + [Test] + public void TestPerfectScoreOnShortHoldNote() + { + CreateModTest(new ModTestData + { + Autoplay = true, + Beatmap = new ManiaBeatmap(new StageDefinition(1)) + { + HitObjects = new List + { + new HoldNote + { + StartTime = 100, + EndTime = 100, + }, + new HoldNote + { + StartTime = 100.1, + EndTime = 150, + }, + } + }, + PassCondition = () => Player.ScoreProcessor.Combo.Value == 4 + }); + } + } +} diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 7c8afdff12..dd3208bd89 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -87,15 +87,22 @@ namespace osu.Game.Rulesets.Mania.Replays private double calculateReleaseTime(HitObject currentObject, HitObject? nextObject) { double endTime = currentObject.GetEndTime(); + double releaseDelay = RELEASE_DELAY; - if (currentObject is HoldNote) - // hold note releases must be timed exactly. - return endTime; + if (currentObject is HoldNote hold) + { + if (hold.Duration > 0) + // hold note releases must be timed exactly. + return endTime; + + // Special case for super short hold notes + releaseDelay = 1; + } bool canDelayKeyUpFully = nextObject == null || - nextObject.StartTime > endTime + RELEASE_DELAY; + nextObject.StartTime > endTime + releaseDelay; - return endTime + (canDelayKeyUpFully ? RELEASE_DELAY : (nextObject.AsNonNull().StartTime - endTime) * 0.9); + return endTime + (canDelayKeyUpFully ? releaseDelay : (nextObject.AsNonNull().StartTime - endTime) * 0.9); } protected override HitObject? GetNextObject(int currentIndex) From f0ddcb22c6e33a20ae07cafeae5360fc1e2173f8 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 12 Dec 2023 21:21:04 +0300 Subject: [PATCH 115/567] Remove arbitrary margin --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 96604275ea..ea0da30911 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -413,11 +413,6 @@ namespace osu.Game.Graphics.UserInterface private partial class DropdownSearchTextBox : SearchTextBox { - public DropdownSearchTextBox() - { - TextContainer.Margin = new MarginPadding { Top = 4f }; - } - public override bool OnPressed(KeyBindingPressEvent e) { if (e.Action == GlobalAction.Back) From 67a9eab741ab3a715ad0882fa8597529e380f844 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Tue, 12 Dec 2023 21:21:11 +0300 Subject: [PATCH 116/567] Update caret layout --- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 4742da6d0b..08d38837f6 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -314,18 +314,16 @@ namespace osu.Game.Graphics.UserInterface public OsuCaret() { - RelativeSizeAxes = Axes.Y; - Size = new Vector2(1, 0.9f); - Colour = Color4.Transparent; - Anchor = Anchor.CentreLeft; - Origin = Anchor.CentreLeft; - Masking = true; - CornerRadius = 1; InternalChild = beatSync = new CaretBeatSyncedContainer { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Masking = true, + CornerRadius = 1f, RelativeSizeAxes = Axes.Both, + Height = 0.9f, }; } From daaadf3fc38efb9631eb01a618d0a0033439ca03 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 11:51:45 +0900 Subject: [PATCH 117/567] Fix IgnoreMiss judgements not updating accuracy --- .../Rulesets/Scoring/ScoreProcessorTest.cs | 21 ++++++++++++++++++ osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 22 +++++++++---------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs index fd041d3dd0..d883b91abc 100644 --- a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs +++ b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs @@ -356,6 +356,27 @@ namespace osu.Game.Tests.Rulesets.Scoring Assert.That(actual, Is.EqualTo(expected).Within(Precision.FLOAT_EPSILON)); } + [TestCase(HitResult.Great)] + [TestCase(HitResult.LargeTickHit)] + public void TestAccuracyUpdateFromIgnoreMiss(HitResult maxResult) + { + scoreProcessor.ApplyBeatmap(new Beatmap + { + HitObjects = + { + new TestHitObject(maxResult, HitResult.IgnoreMiss) + } + }); + + var judgementResult = new JudgementResult(beatmap.HitObjects.Single(), new TestJudgement(maxResult, HitResult.IgnoreMiss)) + { + Type = HitResult.IgnoreMiss + }; + scoreProcessor.ApplyResult(judgementResult); + + Assert.That(scoreProcessor.Accuracy.Value, Is.Not.EqualTo(1)); + } + private class TestJudgement : Judgement { public override HitResult MaxResult { get; } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index baeddbd0e8..f110172988 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -218,9 +218,6 @@ namespace osu.Game.Rulesets.Scoring scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1; - if (!result.Type.IsScorable()) - return; - if (result.Type.IncreasesCombo()) Combo.Value++; else if (result.Type.BreaksCombo()) @@ -228,16 +225,18 @@ namespace osu.Game.Rulesets.Scoring result.ComboAfterJudgement = Combo.Value; - if (result.Type.AffectsAccuracy()) + if (result.Judgement.MaxResult.AffectsAccuracy()) { currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult); - currentBaseScore += Judgement.ToNumericResult(result.Type); currentAccuracyJudgementCount++; } + if (result.Type.AffectsAccuracy()) + currentBaseScore += Judgement.ToNumericResult(result.Type); + if (result.Type.IsBonus()) currentBonusPortion += GetBonusScoreChange(result); - else + else if (result.Type.IsScorable()) currentComboPortion += GetComboScoreChange(result); ApplyScoreChange(result); @@ -275,19 +274,18 @@ namespace osu.Game.Rulesets.Scoring scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) - 1; - if (!result.Type.IsScorable()) - return; - - if (result.Type.AffectsAccuracy()) + if (result.Judgement.MaxResult.AffectsAccuracy()) { currentMaximumBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult); - currentBaseScore -= Judgement.ToNumericResult(result.Type); currentAccuracyJudgementCount--; } + if (result.Type.AffectsAccuracy()) + currentBaseScore -= Judgement.ToNumericResult(result.Type); + if (result.Type.IsBonus()) currentBonusPortion -= GetBonusScoreChange(result); - else + else if (result.Type.IsScorable()) currentComboPortion -= GetComboScoreChange(result); RemoveScoreChange(result); From 8977e74171793d6321b2b8b23a7599ee6d6e490a Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 13:15:49 +0900 Subject: [PATCH 118/567] Fix editor test not waiting for editor to load --- .../Visual/Editing/TestSceneOpenEditorTimestamp.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneOpenEditorTimestamp.cs b/osu.Game.Tests/Visual/Editing/TestSceneOpenEditorTimestamp.cs index 1a754d5145..1f46a08831 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneOpenEditorTimestamp.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneOpenEditorTimestamp.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual.Editing { public partial class TestSceneOpenEditorTimestamp : OsuGameTestScene { - private Editor editor => (Editor)Game.ScreenStack.CurrentScreen; + private Editor? editor => Game.ScreenStack.CurrentScreen as Editor; private EditorBeatmap editorBeatmap => editor.ChildrenOfType().Single(); private EditorClock editorClock => editor.ChildrenOfType().Single(); @@ -111,18 +111,18 @@ namespace osu.Game.Tests.Visual.Editing } private void addStepScreenModeTo(EditorScreenMode screenMode) => - AddStep("change screen to " + screenMode, () => editor.Mode.Value = screenMode); + AddStep("change screen to " + screenMode, () => editor!.Mode.Value = screenMode); private void assertOnScreenAt(EditorScreenMode screen, double time) { AddAssert($"stayed on {screen} at {time}", () => - editor.Mode.Value == screen + editor!.Mode.Value == screen && editorClock.CurrentTime == time ); } private void assertMovedScreenTo(EditorScreenMode screen, string text = "moved to") => - AddAssert($"{text} {screen}", () => editor.Mode.Value == screen); + AddAssert($"{text} {screen}", () => editor!.Mode.Value == screen); private void setUpEditor(RulesetInfo ruleset) { @@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.Editing ((PlaySongSelect)Game.ScreenStack.CurrentScreen) .Edit(beatmapSet.Beatmaps.Last(beatmap => beatmap.Ruleset.Name == ruleset.Name)) ); - AddUntilStep("Wait for editor open", () => editor.ReadyForUse); + AddUntilStep("Wait for editor open", () => editor?.ReadyForUse == true); } } } From c31ff84417b76fd6e6e47ec4a92f93e029bbbeb8 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 13:32:27 +0900 Subject: [PATCH 119/567] Fix possible nullref --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 87185c351e..1d6b383dea 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -126,12 +126,14 @@ namespace osu.Game.Screens.Select.Details mod.ApplyToDifficulty(adjustedDifficulty); } - switch (gameRuleset.Value.OnlineID) + IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; + + switch (ruleset.OnlineID) { case 3: // Account for mania differences locally for now. // Eventually this should be handled in a more modular way, allowing rulesets to return arbitrary difficulty attributes. - ILegacyRuleset legacyRuleset = (ILegacyRuleset)gameRuleset.Value.CreateInstance(); + ILegacyRuleset legacyRuleset = (ILegacyRuleset)ruleset.CreateInstance(); // For the time being, the key count is static no matter what, because: // a) The method doesn't have knowledge of the active keymods. Doing so may require considerations for filtering. From 8c760e511041ba5635f5c5987e89262905b74f32 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 13:41:01 +0900 Subject: [PATCH 120/567] Fix hitobject count when creating from an IBeatmap --- .../Legacy/LegacyBeatmapConversionDifficultyInfo.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs index 6f379e4ef1..baf771adef 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs @@ -1,8 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Linq; using osu.Game.Beatmaps; using osu.Game.Online.API.Requests.Responses; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Scoring.Legacy { @@ -44,7 +46,14 @@ namespace osu.Game.Rulesets.Scoring.Legacy public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => FromBeatmapInfo(apiBeatmap); - public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => FromBeatmapInfo(beatmap.BeatmapInfo); + public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => new LegacyBeatmapConversionDifficultyInfo + { + SourceRuleset = beatmap.BeatmapInfo.Ruleset, + CircleSize = beatmap.Difficulty.CircleSize, + OverallDifficulty = beatmap.Difficulty.OverallDifficulty, + CircleCount = beatmap.HitObjects.Count - beatmap.HitObjects.Count(h => h is IHasDuration), + TotalObjectCount = beatmap.HitObjects.Count + }; public static LegacyBeatmapConversionDifficultyInfo FromBeatmapInfo(IBeatmapInfo beatmapInfo) => new LegacyBeatmapConversionDifficultyInfo { From 2930b53edd9aa4e007bd6db05e0072ae5ae906ce Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 13:43:14 +0900 Subject: [PATCH 121/567] Simplify implementation --- .../Beatmaps/ManiaBeatmapConverter.cs | 2 +- .../Legacy/LegacyBeatmapConversionDifficultyInfo.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index c4a8db92ed..c3cd623c5d 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty); - int countSliderOrSpinner = difficulty.TotalObjectCount - difficulty.CircleCount; + int countSliderOrSpinner = difficulty.EndTimeObjectCount; float percentSpecialObjects = (float)countSliderOrSpinner / difficulty.TotalObjectCount; if (percentSpecialObjects < 0.2) diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs index baf771adef..2021aa127d 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs @@ -29,9 +29,12 @@ namespace osu.Game.Rulesets.Scoring.Legacy public float OverallDifficulty { get; set; } /// - /// The count of hitcircles in the beatmap. + /// The number of hitobjects in the beatmap with a distinct end time. /// - public int CircleCount { get; set; } + /// + /// Canonically, these are hitobjects are either sliders or spinners. + /// + public int EndTimeObjectCount { get; set; } /// /// The total count of hitobjects in the beatmap. @@ -42,7 +45,6 @@ namespace osu.Game.Rulesets.Scoring.Legacy float IBeatmapDifficultyInfo.ApproachRate => 0; double IBeatmapDifficultyInfo.SliderMultiplier => 0; double IBeatmapDifficultyInfo.SliderTickRate => 0; - int IBeatmapDifficultyInfo.EndTimeObjectCount => TotalObjectCount - CircleCount; public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => FromBeatmapInfo(apiBeatmap); @@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy SourceRuleset = beatmap.BeatmapInfo.Ruleset, CircleSize = beatmap.Difficulty.CircleSize, OverallDifficulty = beatmap.Difficulty.OverallDifficulty, - CircleCount = beatmap.HitObjects.Count - beatmap.HitObjects.Count(h => h is IHasDuration), + EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration), TotalObjectCount = beatmap.HitObjects.Count }; @@ -60,7 +62,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy SourceRuleset = beatmapInfo.Ruleset, CircleSize = beatmapInfo.Difficulty.CircleSize, OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty, - CircleCount = beatmapInfo.Difficulty.TotalObjectCount - beatmapInfo.Difficulty.EndTimeObjectCount, + EndTimeObjectCount = beatmapInfo.Difficulty.EndTimeObjectCount, TotalObjectCount = beatmapInfo.Difficulty.TotalObjectCount }; } From 2579b42ac5dc5d7e7f41f86628bc8503dec26b64 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 14:01:03 +0900 Subject: [PATCH 122/567] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 6609db3027..bd35bb8d54 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index a6b3527466..84a4e61267 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From 0be6743e87b241b36b396c840e1d5acc1bb6b578 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 14:07:38 +0900 Subject: [PATCH 123/567] Apply `Bindable.Parse` refactorings --- osu.Game/Graphics/UserInterfaceV2/SliderWithTextBoxInput.cs | 2 +- osu.Game/Rulesets/Configuration/RulesetConfigManager.cs | 2 +- osu.Game/Rulesets/Mods/Mod.cs | 3 ++- .../Screens/Edit/Timing/IndeterminateSliderWithTextBoxInput.cs | 2 +- osu.Game/Skinning/ISerialisableDrawable.cs | 3 ++- osu.Game/Skinning/LegacySkin.cs | 3 ++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/UserInterfaceV2/SliderWithTextBoxInput.cs b/osu.Game/Graphics/UserInterfaceV2/SliderWithTextBoxInput.cs index 37ea2a3f96..e5ba7f61bf 100644 --- a/osu.Game/Graphics/UserInterfaceV2/SliderWithTextBoxInput.cs +++ b/osu.Game/Graphics/UserInterfaceV2/SliderWithTextBoxInput.cs @@ -121,7 +121,7 @@ namespace osu.Game.Graphics.UserInterfaceV2 break; default: - slider.Current.Parse(textBox.Current.Value); + slider.Current.Parse(textBox.Current.Value, CultureInfo.CurrentCulture); break; } } diff --git a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs index 0eea1ff215..418dc3576f 100644 --- a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs @@ -84,7 +84,7 @@ namespace osu.Game.Rulesets.Configuration if (setting != null) { - bindable.Parse(setting.Value); + bindable.Parse(setting.Value, CultureInfo.InvariantCulture); } else { diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 775f6a0ed4..d635dccab1 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Reflection; using Newtonsoft.Json; @@ -284,7 +285,7 @@ namespace osu.Game.Rulesets.Mods if (!(target is IParseable parseable)) throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}."); - parseable.Parse(source); + parseable.Parse(source, CultureInfo.InvariantCulture); } } diff --git a/osu.Game/Screens/Edit/Timing/IndeterminateSliderWithTextBoxInput.cs b/osu.Game/Screens/Edit/Timing/IndeterminateSliderWithTextBoxInput.cs index eabe9b9f64..151d469415 100644 --- a/osu.Game/Screens/Edit/Timing/IndeterminateSliderWithTextBoxInput.cs +++ b/osu.Game/Screens/Edit/Timing/IndeterminateSliderWithTextBoxInput.cs @@ -103,7 +103,7 @@ namespace osu.Game.Screens.Edit.Timing break; default: - slider.Current.Parse(t.Text); + slider.Current.Parse(t.Text, CultureInfo.CurrentCulture); break; } } diff --git a/osu.Game/Skinning/ISerialisableDrawable.cs b/osu.Game/Skinning/ISerialisableDrawable.cs index 503b44c2dd..c9dcaca6d1 100644 --- a/osu.Game/Skinning/ISerialisableDrawable.cs +++ b/osu.Game/Skinning/ISerialisableDrawable.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Globalization; using osu.Framework.Bindables; using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Graphics; @@ -46,7 +47,7 @@ namespace osu.Game.Skinning if (!(target is IParseable parseable)) throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}."); - parseable.Parse(source); + parseable.Parse(source, CultureInfo.InvariantCulture); } } } diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 2e91770919..9102231913 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.IO; using System.Linq; using JetBrains.Annotations; @@ -330,7 +331,7 @@ namespace osu.Game.Skinning var bindable = new Bindable(); if (val != null) - bindable.Parse(val); + bindable.Parse(val, CultureInfo.InvariantCulture); return bindable; } } From 996bc659e4ed9806edf9d1f433afc6c03ad7b621 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 14:29:51 +0900 Subject: [PATCH 124/567] Adjust some mod multipliers for initial leaderboard sanity --- osu.Game/Rulesets/Mods/ModClassic.cs | 2 +- osu.Game/Rulesets/Mods/ModSynesthesia.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModClassic.cs b/osu.Game/Rulesets/Mods/ModClassic.cs index 55b16297e2..42fdee0402 100644 --- a/osu.Game/Rulesets/Mods/ModClassic.cs +++ b/osu.Game/Rulesets/Mods/ModClassic.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods public override string Acronym => "CL"; - public override double ScoreMultiplier => 1; + public override double ScoreMultiplier => 0.5; public override IconUsage? Icon => FontAwesome.Solid.History; diff --git a/osu.Game/Rulesets/Mods/ModSynesthesia.cs b/osu.Game/Rulesets/Mods/ModSynesthesia.cs index 23cb135c50..9084127f33 100644 --- a/osu.Game/Rulesets/Mods/ModSynesthesia.cs +++ b/osu.Game/Rulesets/Mods/ModSynesthesia.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Mods public override string Name => "Synesthesia"; public override string Acronym => "SY"; public override LocalisableString Description => "Colours hit objects based on the rhythm."; - public override double ScoreMultiplier => 1; + public override double ScoreMultiplier => 0.8; public override ModType Type => ModType.Fun; } } From eb30a603d97e878565c58504831fc149a81ccf3d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2023 17:54:15 +0900 Subject: [PATCH 125/567] Fix typo in argument name --- osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs index 9da032e489..28d664a48b 100644 --- a/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs @@ -23,11 +23,11 @@ namespace osu.Game.Screens.Play.HUD { base.LoadComplete(); - AccuracyDisplay.BindValueChanged(mod => + AccuracyDisplay.BindValueChanged(mode => { Current.UnbindBindings(); - switch (mod.NewValue) + switch (mode.NewValue) { case AccuracyDisplayMode.Standard: Current.BindTo(scoreProcessor.Accuracy); From 0e4e916388443d9429dee33fd0e3795706252a89 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 15:04:52 +0900 Subject: [PATCH 126/567] Sneaky comment fix --- osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs index ee274fc45e..07045b76ca 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyBodyPiece.cs @@ -234,7 +234,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy break; default: - // this is where things get fucked up. + // this is where things get a bit messed up. // honestly there's three modes to handle here but they seem really pointless? // let's wait to see if anyone actually uses them in skins. if (bodySprite != null) From 5e10f9f899de50d4fe589798a486ad36fa881885 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 14:42:32 +0900 Subject: [PATCH 127/567] Fix failing tests due to more textboxes being present with searchable dropdowns --- .../Navigation/TestSceneScreenNavigation.cs | 10 +++++---- .../Visual/Online/TestSceneChatOverlay.cs | 2 +- .../Visual/Online/TestSceneCommentActions.cs | 2 +- .../Visual/Settings/TestSceneSettingsPanel.cs | 22 +++++++++---------- .../SongSelect/TestScenePlaySongSelect.cs | 4 ++-- osu.Game/Screens/Select/FilterControl.cs | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index c6a668a714..d8dc512787 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -143,13 +143,13 @@ namespace osu.Game.Tests.Visual.Navigation PushAndConfirm(() => songSelect = new TestPlaySongSelect()); - AddStep("set filter", () => songSelect.ChildrenOfType().Single().Current.Value = "test"); + AddStep("set filter", () => filterControlTextBox().Current.Value = "test"); AddStep("press back", () => InputManager.Click(MouseButton.Button1)); AddAssert("still at song select", () => Game.ScreenStack.CurrentScreen == songSelect); - AddAssert("filter cleared", () => string.IsNullOrEmpty(songSelect.ChildrenOfType().Single().Current.Value)); + AddAssert("filter cleared", () => string.IsNullOrEmpty(filterControlTextBox().Current.Value)); - AddStep("set filter again", () => songSelect.ChildrenOfType().Single().Current.Value = "test"); + AddStep("set filter again", () => filterControlTextBox().Current.Value = "test"); AddStep("open collections dropdown", () => { InputManager.MoveMouseTo(songSelect.ChildrenOfType().Single()); @@ -163,10 +163,12 @@ namespace osu.Game.Tests.Visual.Navigation .ChildrenOfType.DropdownMenu>().Single().State == MenuState.Closed); AddStep("press back a second time", () => InputManager.Click(MouseButton.Button1)); - AddAssert("filter cleared", () => string.IsNullOrEmpty(songSelect.ChildrenOfType().Single().Current.Value)); + AddAssert("filter cleared", () => string.IsNullOrEmpty(filterControlTextBox().Current.Value)); AddStep("press back a third time", () => InputManager.Click(MouseButton.Button1)); ConfirmAtMainMenu(); + + TextBox filterControlTextBox() => songSelect.ChildrenOfType().Single(); } [Test] diff --git a/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs index 8a2a66f60f..58feab4ebb 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs @@ -631,7 +631,7 @@ namespace osu.Game.Tests.Visual.Online AddAssert("Nothing happened", () => this.ChildrenOfType().Any()); AddStep("Set report data", () => { - var field = this.ChildrenOfType().Single().ChildrenOfType().Single(); + var field = this.ChildrenOfType().Single().ChildrenOfType().First(); field.Current.Value = "test other"; }); diff --git a/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs b/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs index dbf3b52572..10fdffb8e1 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs @@ -262,7 +262,7 @@ namespace osu.Game.Tests.Visual.Online AddAssert("Nothing happened", () => this.ChildrenOfType().Any()); AddStep("Set report data", () => { - var field = this.ChildrenOfType().Single().ChildrenOfType().Single(); + var field = this.ChildrenOfType().Single().ChildrenOfType().First(); field.Current.Value = report_text; var reason = this.ChildrenOfType>().Single(); reason.Current.Value = CommentReportReason.Other; diff --git a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs index 69e489b247..5d9c2f890c 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs @@ -49,12 +49,12 @@ namespace osu.Game.Tests.Visual.Settings AddStep("reset mouse", () => InputManager.MoveMouseTo(settings)); if (beforeLoad) - AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); + AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType().Any()); if (!beforeLoad) - AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); + AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); AddAssert("ensure all items match filter", () => settings.SectionsContainer .ChildrenOfType().Where(f => f.IsPresent) @@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.Settings AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType().Any()); - AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); + AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType().First().Current.Value = "scaling"); } [Test] @@ -94,7 +94,7 @@ namespace osu.Game.Tests.Visual.Settings AddStep("reset mouse", () => InputManager.MoveMouseTo(settings)); AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0); - AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); + AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); AddStep("open key binding subpanel", () => { @@ -106,13 +106,13 @@ namespace osu.Game.Tests.Visual.Settings AddUntilStep("binding panel textbox focused", () => settings .ChildrenOfType().FirstOrDefault()? - .ChildrenOfType().FirstOrDefault()?.HasFocus == true); + .ChildrenOfType().FirstOrDefault()?.HasFocus == true); AddStep("Press back", () => settings .ChildrenOfType().FirstOrDefault()? .ChildrenOfType().FirstOrDefault()?.TriggerClick()); - AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); + AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); } [Test] @@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.Settings AddStep("reset mouse", () => InputManager.MoveMouseTo(settings)); AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0); - AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); + AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); AddStep("open key binding subpanel", () => { @@ -133,19 +133,19 @@ namespace osu.Game.Tests.Visual.Settings AddUntilStep("binding panel textbox focused", () => settings .ChildrenOfType().FirstOrDefault()? - .ChildrenOfType().FirstOrDefault()?.HasFocus == true); + .ChildrenOfType().FirstOrDefault()?.HasFocus == true); AddStep("Escape", () => InputManager.Key(Key.Escape)); - AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); + AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); } [Test] public void TestSearchTextBoxSelectedOnShow() { - SearchTextBox searchTextBox = null!; + SettingsSearchTextBox searchTextBox = null!; - AddStep("set text", () => (searchTextBox = settings.SectionsContainer.ChildrenOfType().First()).Current.Value = "some text"); + AddStep("set text", () => (searchTextBox = settings.SectionsContainer.ChildrenOfType().First()).Current.Value = "some text"); AddAssert("no text selected", () => searchTextBox.SelectedText == string.Empty); AddRepeatStep("toggle visibility", () => settings.ToggleVisibility(), 2); AddAssert("search text selected", () => searchTextBox.SelectedText == searchTextBox.Current.Value); diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 84750d4c16..64f10cb427 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -1135,7 +1135,7 @@ namespace osu.Game.Tests.Visual.SongSelect { createSongSelect(); - AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); + AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); AddStep("select all", () => InputManager.Keys(PlatformAction.SelectAll)); AddStep("press ctrl-x", () => { @@ -1144,7 +1144,7 @@ namespace osu.Game.Tests.Visual.SongSelect InputManager.ReleaseKey(Key.ControlLeft); }); - AddAssert("filter text cleared", () => songSelect!.FilterControl.ChildrenOfType().First().Text, () => Is.Empty); + AddAssert("filter text cleared", () => songSelect!.FilterControl.ChildrenOfType().First().Text, () => Is.Empty); } private void waitForInitialSelection() diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index c15bd76ef8..1827eb58ca 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -250,7 +250,7 @@ namespace osu.Game.Screens.Select protected override bool OnHover(HoverEvent e) => true; - private partial class FilterControlTextBox : SeekLimitedSearchTextBox + internal partial class FilterControlTextBox : SeekLimitedSearchTextBox { private const float filter_text_size = 12; From c2d3dcdd9c1c7bfc1a8df9756db557549a5f4e47 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 15:15:22 +0900 Subject: [PATCH 128/567] Fix slider tests and incorrect nullability handling around `freehandToolboxGroup` --- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 7 +++++-- .../Visual/SongSelect/TestScenePlaySongSelect.cs | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index e5dada19bb..28e972bacd 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -42,12 +42,15 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders private int currentSegmentLength; [Resolved(CanBeNull = true)] + [CanBeNull] private IPositionSnapProvider positionSnapProvider { get; set; } [Resolved(CanBeNull = true)] + [CanBeNull] private IDistanceSnapProvider distanceSnapProvider { get; set; } [Resolved(CanBeNull = true)] + [CanBeNull] private FreehandSliderToolboxGroup freehandToolboxGroup { get; set; } private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder { Degree = 4 }; @@ -363,7 +366,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders private Vector2[] tryCircleArc(List segment) { - if (segment.Count < 3 || freehandToolboxGroup.CircleThreshold.Value == 0) return null; + if (segment.Count < 3 || freehandToolboxGroup?.CircleThreshold.Value == 0) return null; // Assume the segment creates a reasonable circular arc and then check if it reasonable var points = PathApproximator.BSplineToPiecewiseLinear(segment.ToArray(), bSplineBuilder.Degree); @@ -436,7 +439,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders loss /= points.Count; - return loss > freehandToolboxGroup.CircleThreshold.Value || totalWinding > MathHelper.TwoPi ? null : circleArcControlPoints; + return loss > freehandToolboxGroup?.CircleThreshold.Value || totalWinding > MathHelper.TwoPi ? null : circleArcControlPoints; } private enum SliderPlacementState diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 64f10cb427..6b53277964 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -22,7 +22,6 @@ using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Database; using osu.Game.Extensions; -using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.Chat; using osu.Game.Overlays; @@ -614,7 +613,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo != null); - AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); + AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap); @@ -648,7 +647,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddUntilStep("carousel has correct", () => songSelect!.Carousel.SelectedBeatmapInfo?.MatchesOnlineID(target) == true); AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(target)); - AddStep("reset filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = string.Empty); + AddStep("reset filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = string.Empty); AddAssert("game still correct", () => Beatmap.Value?.BeatmapInfo.MatchesOnlineID(target) == true); AddAssert("carousel still correct", () => songSelect!.Carousel.SelectedBeatmapInfo.MatchesOnlineID(target)); @@ -666,7 +665,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo != null); - AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); + AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nonono"); AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap); @@ -689,7 +688,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddUntilStep("carousel has correct", () => songSelect!.Carousel.SelectedBeatmapInfo?.MatchesOnlineID(target) == true); AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.MatchesOnlineID(target)); - AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nononoo"); + AddStep("set filter text", () => songSelect!.FilterControl.ChildrenOfType().First().Text = "nononoo"); AddUntilStep("game lost selection", () => Beatmap.Value is DummyWorkingBeatmap); AddAssert("carousel lost selection", () => songSelect!.Carousel.SelectedBeatmapInfo == null); From 0611a1ddc98462af34e6f1820b58dcd231769af5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 15:28:54 +0900 Subject: [PATCH 129/567] Avoid background processing falling over is `BeatmapSet` is `null` See https://github.com/ppy/osu/issues/10458. --- osu.Game/BackgroundDataStoreProcessor.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 8195856991..c8a108a5f6 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -136,19 +135,13 @@ namespace osu.Game // of other possible ways), but for now avoid queueing if the user isn't logged in at startup. if (api.IsLoggedIn) { - foreach (var b in r.All().Where(b => b.StarRating < 0 || (b.OnlineID > 0 && b.LastOnlineUpdate == null))) - { - Debug.Assert(b.BeatmapSet != null); - beatmapSetIds.Add(b.BeatmapSet.ID); - } + foreach (var b in r.All().Where(b => (b.StarRating < 0 || (b.OnlineID > 0 && b.LastOnlineUpdate == null)) && b.BeatmapSet != null)) + beatmapSetIds.Add(b.BeatmapSet!.ID); } else { - foreach (var b in r.All().Where(b => b.StarRating < 0)) - { - Debug.Assert(b.BeatmapSet != null); - beatmapSetIds.Add(b.BeatmapSet.ID); - } + foreach (var b in r.All().Where(b => b.StarRating < 0 && b.BeatmapSet != null)) + beatmapSetIds.Add(b.BeatmapSet!.ID); } }); From 4983845041794eb5acff6037be4e163b50ae8418 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 15:51:26 +0900 Subject: [PATCH 130/567] Update HT mod multiplier to match stable better --- osu.Game/Rulesets/Mods/RateAdjustModHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Mods/RateAdjustModHelper.cs b/osu.Game/Rulesets/Mods/RateAdjustModHelper.cs index ffd4de0e90..8bc481921f 100644 --- a/osu.Game/Rulesets/Mods/RateAdjustModHelper.cs +++ b/osu.Game/Rulesets/Mods/RateAdjustModHelper.cs @@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Mods value -= 1; if (SpeedChange.Value >= 1) - value /= 5; - - return 1 + value; + return 1 + value / 5; + else + return 0.6 + value; } } From eff81be6fdbfd16fdc9040c3eeb0cd0087d5d7d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 15:38:06 +0900 Subject: [PATCH 131/567] Fix failing test and add coverage of conversion case --- .../SongSelect/TestSceneAdvancedStats.cs | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs index 8650119dd4..4bb2b557ff 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs @@ -14,7 +14,9 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; +using osu.Game.Rulesets.Mania; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Select.Details; using osuTK.Graphics; @@ -38,6 +40,12 @@ namespace osu.Game.Tests.Visual.SongSelect Width = 500 }); + [SetUpSteps] + public void SetUpSteps() + { + AddStep("reset game ruleset", () => Ruleset.Value = new OsuRuleset().RulesetInfo); + } + private BeatmapInfo exampleBeatmapInfo => new BeatmapInfo { Ruleset = rulesets.AvailableRulesets.First(), @@ -66,8 +74,10 @@ namespace osu.Game.Tests.Visual.SongSelect } [Test] - public void TestManiaFirstBarText() + public void TestManiaFirstBarTextManiaBeatmap() { + AddStep("set game ruleset to mania", () => Ruleset.Value = new ManiaRuleset().RulesetInfo); + AddStep("set beatmap", () => advancedStats.BeatmapInfo = new BeatmapInfo { Ruleset = rulesets.GetRuleset(3) ?? throw new InvalidOperationException("osu!mania ruleset not found"), @@ -84,6 +94,27 @@ namespace osu.Game.Tests.Visual.SongSelect AddAssert("first bar text is correct", () => advancedStats.ChildrenOfType().First().Text == BeatmapsetsStrings.ShowStatsCsMania); } + [Test] + public void TestManiaFirstBarTextConvert() + { + AddStep("set game ruleset to mania", () => Ruleset.Value = new ManiaRuleset().RulesetInfo); + + AddStep("set beatmap", () => advancedStats.BeatmapInfo = new BeatmapInfo + { + Ruleset = new OsuRuleset().RulesetInfo, + Difficulty = new BeatmapDifficulty + { + CircleSize = 5, + DrainRate = 4.3f, + OverallDifficulty = 4.5f, + ApproachRate = 3.1f + }, + StarRating = 8 + }); + + AddAssert("first bar text is correct", () => advancedStats.ChildrenOfType().First().Text == BeatmapsetsStrings.ShowStatsCsMania); + } + [Test] public void TestEasyMod() { From 2abf3a55ae0bc214c484867ed9a4b67dd267a1f8 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 16:08:34 +0900 Subject: [PATCH 132/567] Add IsLegacyScore to SoloScoreInfo --- osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs b/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs index ac2d8152b1..732da3d5da 100644 --- a/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs +++ b/osu.Game/Online/API/Requests/Responses/SoloScoreInfo.cs @@ -150,6 +150,12 @@ namespace osu.Game.Online.API.Requests.Responses #endregion + /// + /// Whether this represents a legacy (osu!stable) score. + /// + [JsonIgnore] + public bool IsLegacyScore => LegacyScoreId != null; + public override string ToString() => $"score_id: {ID} user_id: {UserID}"; /// @@ -191,6 +197,7 @@ namespace osu.Game.Online.API.Requests.Responses { OnlineID = OnlineID, LegacyOnlineID = (long?)LegacyScoreId ?? -1, + IsLegacyScore = IsLegacyScore, User = User ?? new APIUser { Id = UserID }, BeatmapInfo = new BeatmapInfo { OnlineID = BeatmapID }, Ruleset = new RulesetInfo { OnlineID = RulesetID }, From 110749205d7366f05ca5d56dd2f037bc7770bff2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 16:13:08 +0900 Subject: [PATCH 133/567] Cache `GameplayClockContainer` to allow usage of `OnSeek` --- osu.Game/Screens/Play/GameplayClockContainer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/GameplayClockContainer.cs b/osu.Game/Screens/Play/GameplayClockContainer.cs index 5a713fdae7..4def1d36bb 100644 --- a/osu.Game/Screens/Play/GameplayClockContainer.cs +++ b/osu.Game/Screens/Play/GameplayClockContainer.cs @@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play /// Encapsulates gameplay timing logic and provides a via DI for gameplay components to use. /// [Cached(typeof(IGameplayClock))] + [Cached(typeof(GameplayClockContainer))] public partial class GameplayClockContainer : Container, IAdjustableClock, IGameplayClock { public IBindable IsPaused => isPaused; From f2c6c348be850bb07347bfb46a9c836c6304895f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 16:13:23 +0900 Subject: [PATCH 134/567] Fix `HitError` `Clear` methods not correctly returning pooled drawables --- .../Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 6 +++++- .../Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index eb5221aa45..a9141110c5 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -485,7 +485,11 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters } } - public override void Clear() => judgementsContainer.Clear(); + public override void Clear() + { + foreach (var j in judgementsContainer) + j.FadeOut().Expire(); + } public enum CentreMarkerStyles { diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index 5793713fca..d95959bf9e 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -63,7 +63,11 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters judgementsFlow.Push(GetColourForHitResult(judgement.Type)); } - public override void Clear() => judgementsFlow.Clear(); + public override void Clear() + { + foreach (var j in judgementsFlow) + j.FadeOut().Expire(); + } private partial class JudgementFlow : FillFlowContainer { From fb44fb18e021a153d3d44d12190d53f15c288838 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 16:42:20 +0900 Subject: [PATCH 135/567] Update in line with upstream changes --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 019c38679e..9433588b03 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -128,6 +128,8 @@ namespace osu.Game.Screens.Select.Details IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; BeatmapDifficulty adjustedDifficulty = null; + IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; + if (baseDifficulty != null && (mods.Value.Any(m => m is IApplicableToDifficulty) || mods.Value.Any(m => m is IApplicableToRate))) { @@ -140,21 +142,17 @@ namespace osu.Game.Screens.Select.Details if (gameRuleset != null) { - Ruleset ruleset = gameRuleset.Value.CreateInstance(); - double rate = 1; foreach (var mod in mods.Value.OfType()) rate = mod.ApplyToRate(0, rate); - adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); + adjustedDifficulty = ruleset.CreateInstance().GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); rateAdjustTooltip.UpdateAttribute("AR", originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); rateAdjustTooltip.UpdateAttribute("OD", originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); } } - IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; - switch (ruleset.OnlineID) { case 3: From 9433180ffeacf239b4f688ad954387a12fcbbfb7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 16:57:31 +0900 Subject: [PATCH 136/567] Fix various code quality and visual issues with `AdjustedAttributesTooltip` --- .../Mods/AdjustedAttributesTooltip.cs | 135 +++++++++--------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index e9b7ee5c54..a56c09931a 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -15,84 +16,72 @@ using osuTK; namespace osu.Game.Overlays.Mods { - public partial class AdjustedAttributesTooltip : CompositeDrawable, ITooltip + public partial class AdjustedAttributesTooltip : VisibilityContainer, ITooltip { private readonly Dictionary> attributes = new Dictionary>(); - private readonly Container content; + private FillFlowContainer? attributesFillFlow; - private readonly FillFlowContainer attributesFillFlow; + private Container content = null!; [Resolved] private OsuColour colours { get; set; } = null!; - public AdjustedAttributesTooltip() - { - // Need to be initialized in constructor to ensure accessability in AddAttribute function - InternalChild = content = new Container - { - AutoSizeAxes = Axes.Both - }; - attributesFillFlow = new FillFlowContainer - { - Direction = FillDirection.Vertical, - AutoSizeAxes = Axes.Both - }; - } - [BackgroundDependencyLoader] private void load() { AutoSizeAxes = Axes.Both; Masking = true; - CornerRadius = 15; + CornerRadius = 5; - content.AddRange(new Drawable[] + InternalChildren = new Drawable[] { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colours.Gray1, - Alpha = 0.8f - }, - new FillFlowContainer + content = new Container { AutoSizeAxes = Axes.Both, - Padding = new MarginPadding { Vertical = 10, Horizontal = 15 }, - Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuSpriteText + new Box { - Text = "One or more values are being adjusted by mods that change speed.", + RelativeSizeAxes = Axes.Both, + Colour = colours.Gray3, }, - attributesFillFlow + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Padding = new MarginPadding { Vertical = 10, Horizontal = 15 }, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "One or more values are being adjusted by mods that change speed.", + }, + attributesFillFlow = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both + } + } + } } - } - }); - } + }, + }; - private void checkAttributes() - { foreach (var attribute in attributes) - { - if (!Precision.AlmostEquals(attribute.Value.Value.Old, attribute.Value.Value.New)) - { - content.Show(); - return; - } - } + attributesFillFlow?.Add(new AttributeDisplay(attribute.Key, attribute.Value.GetBoundCopy())); - content.Hide(); + updateVisibility(); } public void AddAttribute(string name) { Bindable newBindable = new Bindable(); - newBindable.BindValueChanged(_ => checkAttributes()); + newBindable.BindValueChanged(_ => updateVisibility()); attributes.Add(name, newBindable); - attributesFillFlow.Add(new AttributeDisplay(name, newBindable.GetBoundCopy())); + + attributesFillFlow?.Add(new AttributeDisplay(name, newBindable.GetBoundCopy())); } public void UpdateAttribute(string name, double oldValue, double newValue) @@ -102,8 +91,8 @@ namespace osu.Game.Overlays.Mods Bindable attribute = attributes[name]; OldNewPair attributeValue = attribute.Value; - attributeValue.Old = oldValue; - attributeValue.New = newValue; + attributeValue.OldValue = oldValue; + attributeValue.NewValue = newValue; attribute.Value = attributeValue; } @@ -116,14 +105,20 @@ namespace osu.Game.Overlays.Mods { } - public void Move(Vector2 pos) - { - Position = pos; - } + protected override void PopIn() => this.FadeIn(200, Easing.OutQuint); + protected override void PopOut() => this.FadeOut(200, Easing.OutQuint); - private struct OldNewPair + public void Move(Vector2 pos) => Position = pos; + + private void updateVisibility() { - public double Old, New; + if (!IsLoaded) + return; + + if (attributes.Any(attribute => !Precision.AlmostEquals(attribute.Value.Value.OldValue, attribute.Value.Value.NewValue))) + content.Show(); + else + content.Hide(); } private partial class AttributeDisplay : CompositeDrawable @@ -131,33 +126,39 @@ namespace osu.Game.Overlays.Mods public readonly Bindable AttributeValues; public readonly string AttributeName; - private readonly OsuSpriteText text = new OsuSpriteText - { - Font = OsuFont.Default.With(weight: FontWeight.Bold) - }; + private readonly OsuSpriteText text; - public AttributeDisplay(string name, Bindable boundCopy) + public AttributeDisplay(string name, Bindable values) { AutoSizeAxes = Axes.Both; AttributeName = name; - AttributeValues = boundCopy; - InternalChild = text; + AttributeValues = values; + + InternalChild = text = new OsuSpriteText + { + Font = OsuFont.Default.With(weight: FontWeight.Bold) + }; + AttributeValues.BindValueChanged(_ => update(), true); } private void update() { - if (Precision.AlmostEquals(AttributeValues.Value.Old, AttributeValues.Value.New)) + if (Precision.AlmostEquals(AttributeValues.Value.OldValue, AttributeValues.Value.NewValue)) { Hide(); + return; } - else - { - Show(); - text.Text = $"{AttributeName}: {(AttributeValues.Value.Old):0.0#} → {(AttributeValues.Value.New):0.0#}"; - } + + Show(); + text.Text = $"{AttributeName}: {(AttributeValues.Value.OldValue):0.0#} → {(AttributeValues.Value.NewValue):0.0#}"; } } + + private struct OldNewPair + { + public double OldValue, NewValue; + } } } From c131f91736dc2d947fce9c0decea049358d93536 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 16:59:09 +0900 Subject: [PATCH 137/567] Add tests --- .../TestSceneSliderEarlyHitJudgement.cs | 187 ++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs new file mode 100644 index 0000000000..46278dfb12 --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs @@ -0,0 +1,187 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Framework.Screens; +using osu.Game.Beatmaps; +using osu.Game.Replays; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Replays; +using osu.Game.Rulesets.Scoring; +using osu.Game.Scoring; +using osu.Game.Screens.Play; +using osu.Game.Tests.Visual; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests +{ + public partial class TestSceneSliderEarlyHitJudgement : RateAdjustedBeatmapTestScene + { + private const double time_slider_start = 1000; + private const double time_slider_tick = 2000; + private const double time_slider_end = 3000; + + private static readonly Vector2 slider_start_position = new Vector2(256 - slider_path_length / 2, 192); + private static readonly Vector2 slider_end_position = new Vector2(256 + slider_path_length / 2, 192); + + private ScoreAccessibleReplayPlayer currentPlayer = null!; + + private const float slider_path_length = 200; + + private readonly List judgementResults = new List(); + + [Test] + public void TestHitEarlyMoveIntoFollowRegion() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(32, 0), OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(32, 0), OsuAction.LeftButton), + }); + + assertHeadJudgement(HitResult.Miss); + assertTickJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + [Test] + public void TestHitEarlyMoveOutsideFollowRegion() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(96, 0), OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(96, 0), OsuAction.LeftButton), + }); + + assertHeadJudgement(HitResult.Miss); + assertTickJudgement(HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreMiss); + } + + private void assertHeadJudgement(HitResult result) + { + AddAssert( + "check head result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderHeadCircle)?.Type, + () => Is.EqualTo(result)); + } + + private void assertTickJudgement(HitResult result) + { + AddAssert( + "check tick result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderTick)?.Type, + () => Is.EqualTo(result)); + } + + private void assertRepeatJudgement(HitResult result) + { + AddAssert( + "check tick result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderRepeat)?.Type, + () => Is.EqualTo(result)); + } + + private void assertTailJudgement(HitResult result) + { + AddAssert( + "check tail result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderTailCircle)?.Type, + () => Is.EqualTo(result)); + } + + private void assertSliderJudgement(HitResult result) + { + AddAssert( + "check slider result", + () => judgementResults.SingleOrDefault(r => r.HitObject is Slider)?.Type, + () => Is.EqualTo(result)); + } + + private Vector2 computePositionFromTime(double time) + { + Vector2 dist = slider_end_position - slider_start_position; + double t = (time - time_slider_start) / (time_slider_end - time_slider_start); + return slider_start_position + dist * (float)t; + } + + private void performTest(List frames, Action? adjustSliderFunc = null, bool classic = false) + { + Slider slider = new Slider + { + StartTime = time_slider_start, + Position = new Vector2(256 - slider_path_length / 2, 192), + TickDistanceMultiplier = 3, + ClassicSliderBehaviour = classic, + Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(slider_path_length, 0), + }, slider_path_length), + }; + + adjustSliderFunc?.Invoke(slider); + + AddStep("load player", () => + { + Beatmap.Value = CreateWorkingBeatmap(new Beatmap + { + HitObjects = { slider }, + BeatmapInfo = + { + Difficulty = new BeatmapDifficulty + { + SliderMultiplier = 1, + SliderTickRate = 3 + }, + Ruleset = new OsuRuleset().RulesetInfo, + } + }); + + var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }); + + p.OnLoadComplete += _ => + { + p.ScoreProcessor.NewJudgement += result => + { + if (currentPlayer == p) judgementResults.Add(result); + }; + }; + + LoadScreen(currentPlayer = p); + judgementResults.Clear(); + }); + + AddUntilStep("Beatmap at 0", () => Beatmap.Value.Track.CurrentTime == 0); + AddUntilStep("Wait until player is loaded", () => currentPlayer.IsCurrentScreen()); + AddUntilStep("Wait for completion", () => currentPlayer.ScoreProcessor.HasCompleted.Value); + } + + private partial class ScoreAccessibleReplayPlayer : ReplayPlayer + { + public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; + + protected override bool PauseOnFocusLost => false; + + public ScoreAccessibleReplayPlayer(Score score) + : base(score, new PlayerConfiguration + { + AllowPause = false, + ShowResults = false, + }) + { + } + } + } +} From 3f67538d6103f411bbbaf6f54dcd750f650f2387 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 16:59:41 +0900 Subject: [PATCH 138/567] Allow slider to be tracked before its start time --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs index 292f2ffd7d..a1724d6fdc 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs @@ -153,11 +153,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } Tracking = - // in valid time range - Time.Current >= drawableSlider.HitObject.StartTime // even in an edge case where current time has exceeded the slider's time, we may not have finished judging. // we don't want to potentially update from Tracking=true to Tracking=false at this point. - && (!drawableSlider.AllJudged || Time.Current <= drawableSlider.HitObject.GetEndTime()) + (!drawableSlider.AllJudged || Time.Current <= drawableSlider.HitObject.GetEndTime()) // in valid position range && lastScreenSpaceMousePosition.HasValue && followCircleReceptor.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) && // valid action From 3131d376218af0673a1b79190f52f7aaf576105e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 17:00:21 +0900 Subject: [PATCH 139/567] Clear transformations with more fire --- osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs | 5 ++++- .../Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs index a9141110c5..443863fb2f 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs @@ -488,7 +488,10 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public override void Clear() { foreach (var j in judgementsContainer) - j.FadeOut().Expire(); + { + j.ClearTransforms(); + j.Expire(); + } } public enum CentreMarkerStyles diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs index d95959bf9e..65f4b50dde 100644 --- a/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs +++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs @@ -66,7 +66,10 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters public override void Clear() { foreach (var j in judgementsFlow) - j.FadeOut().Expire(); + { + j.ClearTransforms(); + j.Expire(); + } } private partial class JudgementFlow : FillFlowContainer From 9a982a9564e11252ba3a7e0dda77ffc6c0d86e0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 17:13:15 +0900 Subject: [PATCH 140/567] Tidy up `GetRateAdjustedDisplayDifficulty` implemetations --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 7 +++++-- osu.Game.Rulesets.Osu/OsuRuleset.cs | 10 ++++++++-- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 8 +++++--- osu.Game/Rulesets/Ruleset.cs | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 12d197109b..bcb28328f0 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -240,10 +240,13 @@ namespace osu.Game.Rulesets.Catch { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = adjustedDifficulty.ApproachRate < 6 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + double preempt = adjustedDifficulty.ApproachRate < 6 + ? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5 + : 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5; preempt /= rate; - adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); + + adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); return adjustedDifficulty; } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 88489f2dc3..5355743a50 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -336,12 +336,18 @@ namespace osu.Game.Rulesets.Osu { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = adjustedDifficulty.ApproachRate < 5 ? (1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5) : (1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5); + double preempt = adjustedDifficulty.ApproachRate < 5 + ? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5 + : 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5; + preempt /= rate; - adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? ((1800 - preempt) / 120) : ((1200 - preempt) / 150 + 5)); + + adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty; + hitwindow /= rate; + adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6; return adjustedDifficulty; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 6e5cdbf2d1..94136a11d3 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -269,9 +269,11 @@ namespace osu.Game.Rulesets.Taiko { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double hitwindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5; - hitwindow /= rate; - adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitwindow) / 15 + 5); + double hitWindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5; + + hitWindow /= rate; + + adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitWindow) / 15 + 5); return adjustedDifficulty; } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index c7c81ecb55..37a35fd3ae 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -380,6 +380,7 @@ namespace osu.Game.Rulesets /// /// Applies changes to difficulty attributes for presenting to a user a rough estimate of how rate adjust mods affect difficulty. /// Importantly, this should NOT BE USED FOR ANY CALCULATIONS. + /// /// It is also not always correct, and arguably is never correct depending on your frame of mind. /// /// >The that will be adjusted. From e865de7a6b8cdbef85211b1d74571d1c8ac9b8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 13 Dec 2023 09:25:56 +0100 Subject: [PATCH 141/567] Update test assertions in line with half time mod multiplier changes --- .../Visual/UserInterface/TestSceneModSelectOverlay.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index f0822ce2a8..fed5f68449 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -787,7 +787,8 @@ namespace osu.Game.Tests.Visual.UserInterface InputManager.MoveMouseTo(this.ChildrenOfType().Single(preset => preset.Preset.Value.Name == "Half Time 0.5x")); InputManager.Click(MouseButton.Left); }); - AddAssert("difficulty multiplier display shows correct value", () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.5)); + AddAssert("difficulty multiplier display shows correct value", + () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.1).Within(Precision.DOUBLE_EPSILON)); // this is highly unorthodox in a test, but because the `ModSettingChangeTracker` machinery heavily leans on events and object disposal and re-creation, // it is instrumental in the reproduction of the failure scenario that this test is supposed to cover. @@ -796,7 +797,8 @@ namespace osu.Game.Tests.Visual.UserInterface AddStep("open customisation area", () => modSelectOverlay.CustomisationButton!.TriggerClick()); AddStep("reset half time speed to default", () => modSelectOverlay.ChildrenOfType().Single() .ChildrenOfType>().Single().TriggerClick()); - AddUntilStep("difficulty multiplier display shows correct value", () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.7)); + AddUntilStep("difficulty multiplier display shows correct value", + () => modSelectOverlay.ChildrenOfType().Single().Current.Value, () => Is.EqualTo(0.3).Within(Precision.DOUBLE_EPSILON)); } private void waitForColumnLoad() => AddUntilStep("all column content loaded", () => From 01710780525bca3126764bb77805964968ed19d6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 17:33:24 +0900 Subject: [PATCH 142/567] Move object counts to BeatmapInfo --- osu.Game.Tournament/Models/TournamentBeatmap.cs | 6 ++++++ osu.Game/BackgroundDataStoreProcessor.cs | 11 +++++++---- osu.Game/Beatmaps/BeatmapDifficulty.cs | 9 --------- osu.Game/Beatmaps/BeatmapImporter.cs | 6 +++--- osu.Game/Beatmaps/BeatmapInfo.cs | 4 ++++ osu.Game/Beatmaps/BeatmapUpdater.cs | 4 ++-- osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs | 13 ------------- osu.Game/Beatmaps/IBeatmapInfo.cs | 13 +++++++++++++ .../Online/API/Requests/Responses/APIBeatmap.cs | 8 +++++--- .../Legacy/LegacyBeatmapConversionDifficultyInfo.cs | 4 ++-- 10 files changed, 42 insertions(+), 36 deletions(-) diff --git a/osu.Game.Tournament/Models/TournamentBeatmap.cs b/osu.Game.Tournament/Models/TournamentBeatmap.cs index 7f57b6a151..a7ba5b7db1 100644 --- a/osu.Game.Tournament/Models/TournamentBeatmap.cs +++ b/osu.Game.Tournament/Models/TournamentBeatmap.cs @@ -21,6 +21,10 @@ namespace osu.Game.Tournament.Models public double StarRating { get; set; } + public int EndTimeObjectCount { get; set; } + + public int TotalObjectCount { get; set; } + public IBeatmapMetadataInfo Metadata { get; set; } = new BeatmapMetadata(); public IBeatmapDifficultyInfo Difficulty { get; set; } = new BeatmapDifficulty(); @@ -41,6 +45,8 @@ namespace osu.Game.Tournament.Models Metadata = beatmap.Metadata; Difficulty = beatmap.Difficulty; Covers = beatmap.BeatmapSet?.Covers ?? new BeatmapSetOnlineCovers(); + EndTimeObjectCount = beatmap.EndTimeObjectCount; + TotalObjectCount = beatmap.TotalObjectCount; } public bool Equals(IBeatmapInfo? other) => other is TournamentBeatmap b && this.MatchesOnlineID(b); diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index c8a108a5f6..10cc13dc29 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -20,7 +20,6 @@ using osu.Game.Rulesets; using osu.Game.Scoring; using osu.Game.Scoring.Legacy; using osu.Game.Screens.Play; -using Realms; namespace osu.Game { @@ -177,9 +176,13 @@ namespace osu.Game { Logger.Log("Querying for beatmaps with missing hitobject counts to reprocess..."); - HashSet beatmapIds = realmAccess.Run(r => new HashSet(r.All() - .Filter($"{nameof(BeatmapInfo.Difficulty)}.{nameof(BeatmapDifficulty.TotalObjectCount)} == 0") - .AsEnumerable().Select(b => b.ID))); + HashSet beatmapIds = new HashSet(); + + realmAccess.Run(r => + { + foreach (var b in r.All().Where(b => b.TotalObjectCount == 0)) + beatmapIds.Add(b.ID); + }); Logger.Log($"Found {beatmapIds.Count} beatmaps which require reprocessing."); diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index 785728141e..ac2267380d 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -21,9 +21,6 @@ namespace osu.Game.Beatmaps public double SliderMultiplier { get; set; } = 1.4; public double SliderTickRate { get; set; } = 1; - public int EndTimeObjectCount { get; set; } - public int TotalObjectCount { get; set; } - public BeatmapDifficulty() { } @@ -47,9 +44,6 @@ namespace osu.Game.Beatmaps difficulty.SliderMultiplier = SliderMultiplier; difficulty.SliderTickRate = SliderTickRate; - - difficulty.EndTimeObjectCount = EndTimeObjectCount; - difficulty.TotalObjectCount = TotalObjectCount; } public virtual void CopyFrom(IBeatmapDifficultyInfo other) @@ -61,9 +55,6 @@ namespace osu.Game.Beatmaps SliderMultiplier = other.SliderMultiplier; SliderTickRate = other.SliderTickRate; - - EndTimeObjectCount = other.EndTimeObjectCount; - TotalObjectCount = other.TotalObjectCount; } } } diff --git a/osu.Game/Beatmaps/BeatmapImporter.cs b/osu.Game/Beatmaps/BeatmapImporter.cs index 31d6b0108e..7bb52eef52 100644 --- a/osu.Game/Beatmaps/BeatmapImporter.cs +++ b/osu.Game/Beatmaps/BeatmapImporter.cs @@ -388,9 +388,7 @@ namespace osu.Game.Beatmaps OverallDifficulty = decodedDifficulty.OverallDifficulty, ApproachRate = decodedDifficulty.ApproachRate, SliderMultiplier = decodedDifficulty.SliderMultiplier, - SliderTickRate = decodedDifficulty.SliderTickRate, - EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration), - TotalObjectCount = decoded.HitObjects.Count + SliderTickRate = decodedDifficulty.SliderTickRate }; var metadata = new BeatmapMetadata @@ -428,6 +426,8 @@ namespace osu.Game.Beatmaps GridSize = decodedInfo.GridSize, TimelineZoom = decodedInfo.TimelineZoom, MD5Hash = memoryStream.ComputeMD5Hash(), + EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration), + TotalObjectCount = decoded.HitObjects.Count }; beatmaps.Add(beatmap); diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index c1aeec1f71..2d04732f91 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -120,6 +120,10 @@ namespace osu.Game.Beatmaps [JsonIgnore] public bool Hidden { get; set; } + public int EndTimeObjectCount { get; set; } + + public int TotalObjectCount { get; set; } + /// /// Reset any fetched online linking information (and history). /// diff --git a/osu.Game/Beatmaps/BeatmapUpdater.cs b/osu.Game/Beatmaps/BeatmapUpdater.cs index 472ac26ebe..27492b8bac 100644 --- a/osu.Game/Beatmaps/BeatmapUpdater.cs +++ b/osu.Game/Beatmaps/BeatmapUpdater.cs @@ -91,8 +91,8 @@ namespace osu.Game.Beatmaps var working = workingBeatmapCache.GetWorkingBeatmap(beatmapInfo); var beatmap = working.Beatmap; - beatmapInfo.Difficulty.EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration); - beatmapInfo.Difficulty.TotalObjectCount = beatmap.HitObjects.Count; + beatmapInfo.EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration); + beatmapInfo.TotalObjectCount = beatmap.HitObjects.Count; // And invalidate again afterwards as re-fetching the most up-to-date database metadata will be required. workingBeatmapCache.Invalidate(beatmapInfo); diff --git a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs index 47b261d1f6..e7a3d87d0a 100644 --- a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs @@ -44,19 +44,6 @@ namespace osu.Game.Beatmaps /// double SliderTickRate { get; } - /// - /// The number of hitobjects in the beatmap with a distinct end time. - /// - /// - /// Canonically, these are hitobjects are either sliders or spinners. - /// - int EndTimeObjectCount { get; } - - /// - /// The total number of hitobjects in the beatmap. - /// - int TotalObjectCount { get; } - /// /// Maps a difficulty value [0, 10] to a two-piece linear range of values. /// diff --git a/osu.Game/Beatmaps/IBeatmapInfo.cs b/osu.Game/Beatmaps/IBeatmapInfo.cs index b8c69cc525..9dcff5ce5e 100644 --- a/osu.Game/Beatmaps/IBeatmapInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapInfo.cs @@ -61,5 +61,18 @@ namespace osu.Game.Beatmaps /// The basic star rating for this beatmap (with no mods applied). /// double StarRating { get; } + + /// + /// The number of hitobjects in the beatmap with a distinct end time. + /// + /// + /// Canonically, these are hitobjects are either sliders or spinners. + /// + int EndTimeObjectCount { get; } + + /// + /// The total number of hitobjects in the beatmap. + /// + int TotalObjectCount { get; } } } diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index c1ceff7c43..e5ecfe2c99 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -41,6 +41,10 @@ namespace osu.Game.Online.API.Requests.Responses [JsonProperty(@"difficulty_rating")] public double StarRating { get; set; } + public int EndTimeObjectCount => SliderCount + SpinnerCount; + + public int TotalObjectCount => CircleCount + SliderCount + SpinnerCount; + [JsonProperty(@"drain")] public float DrainRate { get; set; } @@ -108,9 +112,7 @@ namespace osu.Game.Online.API.Requests.Responses DrainRate = DrainRate, CircleSize = CircleSize, ApproachRate = ApproachRate, - OverallDifficulty = OverallDifficulty, - EndTimeObjectCount = SliderCount + SpinnerCount, - TotalObjectCount = CircleCount + SliderCount + SpinnerCount + OverallDifficulty = OverallDifficulty }; IBeatmapSetInfo? IBeatmapInfo.BeatmapSet => BeatmapSet; diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs index 2021aa127d..7d69069455 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyBeatmapConversionDifficultyInfo.cs @@ -62,8 +62,8 @@ namespace osu.Game.Rulesets.Scoring.Legacy SourceRuleset = beatmapInfo.Ruleset, CircleSize = beatmapInfo.Difficulty.CircleSize, OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty, - EndTimeObjectCount = beatmapInfo.Difficulty.EndTimeObjectCount, - TotalObjectCount = beatmapInfo.Difficulty.TotalObjectCount + EndTimeObjectCount = beatmapInfo.EndTimeObjectCount, + TotalObjectCount = beatmapInfo.TotalObjectCount }; } } From 5062c53e36c1d4d68cd62bfedd14e1306553c8e7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Dec 2023 17:33:39 +0900 Subject: [PATCH 143/567] Refactor everything for sanity --- .../Mods/AdjustedAttributesTooltip.cs | 105 +++++++----------- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 7 +- .../Screens/Select/Details/AdvancedStats.cs | 6 +- 3 files changed, 41 insertions(+), 77 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index a56c09931a..ed12d917ad 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -1,29 +1,30 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Collections.Generic; +using System; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics; using osu.Framework.Utils; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; using osuTK; namespace osu.Game.Overlays.Mods { public partial class AdjustedAttributesTooltip : VisibilityContainer, ITooltip { - private readonly Dictionary> attributes = new Dictionary>(); - - private FillFlowContainer? attributesFillFlow; + private FillFlowContainer attributesFillFlow = null!; private Container content = null!; + private BeatmapDifficulty? originalDifficulty; + private BeatmapDifficulty? adjustedDifficulty; + [Resolved] private OsuColour colours { get; set; } = null!; @@ -69,36 +70,43 @@ namespace osu.Game.Overlays.Mods }, }; - foreach (var attribute in attributes) - attributesFillFlow?.Add(new AttributeDisplay(attribute.Key, attribute.Value.GetBoundCopy())); - - updateVisibility(); + updateDisplay(); } - public void AddAttribute(string name) + public void UpdateAttributes(BeatmapDifficulty original, BeatmapDifficulty adjusted) { - Bindable newBindable = new Bindable(); - newBindable.BindValueChanged(_ => updateVisibility()); - attributes.Add(name, newBindable); + originalDifficulty = original; + adjustedDifficulty = adjusted; - attributesFillFlow?.Add(new AttributeDisplay(name, newBindable.GetBoundCopy())); + if (IsLoaded) + updateDisplay(); } - public void UpdateAttribute(string name, double oldValue, double newValue) + private void updateDisplay() { - if (!attributes.ContainsKey(name)) return; + attributesFillFlow.Clear(); - Bindable attribute = attributes[name]; + if (originalDifficulty == null || adjustedDifficulty == null) + return; - OldNewPair attributeValue = attribute.Value; - attributeValue.OldValue = oldValue; - attributeValue.NewValue = newValue; + attemptAdd("AR", bd => bd.ApproachRate); + attemptAdd("OD", bd => bd.OverallDifficulty); + attemptAdd("CS", bd => bd.CircleSize); + attemptAdd("HP", bd => bd.DrainRate); - attribute.Value = attributeValue; - } + if (attributesFillFlow.Any()) + content.Show(); + else + content.Hide(); - protected override void Update() - { + void attemptAdd(string name, Func lookup) + { + double a = lookup(originalDifficulty); + double b = lookup(adjustedDifficulty); + + if (!Precision.AlmostEquals(a, b)) + attributesFillFlow.Add(new AttributeDisplay(name, a, b)); + } } public void SetContent(object content) @@ -110,55 +118,18 @@ namespace osu.Game.Overlays.Mods public void Move(Vector2 pos) => Position = pos; - private void updateVisibility() - { - if (!IsLoaded) - return; - - if (attributes.Any(attribute => !Precision.AlmostEquals(attribute.Value.Value.OldValue, attribute.Value.Value.NewValue))) - content.Show(); - else - content.Hide(); - } - private partial class AttributeDisplay : CompositeDrawable { - public readonly Bindable AttributeValues; - public readonly string AttributeName; - - private readonly OsuSpriteText text; - - public AttributeDisplay(string name, Bindable values) + public AttributeDisplay(string name, double original, double adjusted) { AutoSizeAxes = Axes.Both; - AttributeName = name; - AttributeValues = values; - - InternalChild = text = new OsuSpriteText + InternalChild = new OsuSpriteText { - Font = OsuFont.Default.With(weight: FontWeight.Bold) + Font = OsuFont.Default.With(weight: FontWeight.Bold), + Text = $"{name}: {original:0.0#} → {adjusted:0.0#}" }; - - AttributeValues.BindValueChanged(_ => update(), true); } - - private void update() - { - if (Precision.AlmostEquals(AttributeValues.Value.OldValue, AttributeValues.Value.NewValue)) - { - Hide(); - return; - } - - Show(); - text.Text = $"{AttributeName}: {(AttributeValues.Value.OldValue):0.0#} → {(AttributeValues.Value.NewValue):0.0#}"; - } - } - - private struct OldNewPair - { - public double OldValue, NewValue; } } } diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 0c35e55df5..dd3daa2b7a 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -60,6 +60,7 @@ namespace osu.Game.Overlays.Mods private AdjustedAttributesTooltip rateAdjustTooltip = null!; public ITooltip GetCustomTooltip() => rateAdjustTooltip; + public object TooltipContent => this; private const float transition_duration = 250; @@ -103,9 +104,6 @@ namespace osu.Game.Overlays.Mods { base.LoadComplete(); - rateAdjustTooltip.AddAttribute("AR"); - rateAdjustTooltip.AddAttribute("OD"); - mods.BindValueChanged(_ => { modSettingChangeTracker?.Dispose(); @@ -184,8 +182,7 @@ namespace osu.Game.Overlays.Mods Ruleset ruleset = gameRuleset.Value.CreateInstance(); BeatmapDifficulty adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - rateAdjustTooltip.UpdateAttribute("AR", originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); - rateAdjustTooltip.UpdateAttribute("OD", originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); + rateAdjustTooltip.UpdateAttributes(originalDifficulty, adjustedDifficulty); approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 9433588b03..2a9e69f141 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -101,9 +101,6 @@ namespace osu.Game.Screens.Select.Details gameRuleset.BindValueChanged(_ => updateStatistics()); mods.BindValueChanged(modsChanged, true); - - rateAdjustTooltip.AddAttribute("AR"); - rateAdjustTooltip.AddAttribute("OD"); } private ModSettingChangeTracker modSettingChangeTracker; @@ -148,8 +145,7 @@ namespace osu.Game.Screens.Select.Details adjustedDifficulty = ruleset.CreateInstance().GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - rateAdjustTooltip.UpdateAttribute("AR", originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); - rateAdjustTooltip.UpdateAttribute("OD", originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); + rateAdjustTooltip.UpdateAttributes(originalDifficulty, adjustedDifficulty); } } From 812f52e793b4729548e1b452a063591fb28c546d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 17:38:16 +0900 Subject: [PATCH 144/567] Bump version number --- osu.Game/Database/RealmAccess.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index 9c7fe464dd..191bb49b0c 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -88,9 +88,9 @@ namespace osu.Game.Database /// 34 2023-08-21 Add BackgroundReprocessingFailed flag to ScoreInfo to track upgrade failures. /// 35 2023-10-16 Clear key combinations of keybindings that are assigned to more than one action in a given settings section. /// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs. - /// 37 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapDifficulty. + /// 38 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapInfo. /// - private const int schema_version = 37; + private const int schema_version = 38; /// /// Lock object which is held during sections, blocking realm retrieval during blocking periods. From 7a4ea90bda6374b89a978e735c88731429e14fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 13 Dec 2023 11:01:06 +0100 Subject: [PATCH 145/567] Fix test failures due to dependency becoming required --- .../Overlays/Settings/Sections/General/UpdateSettings.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index a8f5b655d0..3ff5556f4d 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Settings.Sections.General private Storage storage { get; set; } = null!; [BackgroundDependencyLoader] - private void load(OsuConfigManager config, OsuGame game) + private void load(OsuConfigManager config, OsuGame? game) { Add(new SettingsEnumDropdown { @@ -57,7 +57,7 @@ namespace osu.Game.Overlays.Settings.Sections.General { notifications?.Post(new SimpleNotification { - Text = GeneralSettingsStrings.RunningLatestRelease(game.Version), + Text = GeneralSettingsStrings.RunningLatestRelease(game!.Version), Icon = FontAwesome.Solid.CheckCircle, }); } @@ -87,7 +87,7 @@ namespace osu.Game.Overlays.Settings.Sections.General Add(new SettingsButton { Text = GeneralSettingsStrings.ChangeFolderLocation, - Action = () => game.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) + Action = () => game?.PerformFromScreen(menu => menu.Push(new MigrationSelectScreen())) }); } } From 683ac6f63a169351bf2bf16c9ddd24ec1493f551 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 19:25:41 +0900 Subject: [PATCH 146/567] Add some more tests --- .../TestSceneSliderEarlyHitJudgement.cs | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs index 46278dfb12..fb7d00b28c 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs @@ -25,11 +25,12 @@ namespace osu.Game.Rulesets.Osu.Tests public partial class TestSceneSliderEarlyHitJudgement : RateAdjustedBeatmapTestScene { private const double time_slider_start = 1000; - private const double time_slider_tick = 2000; private const double time_slider_end = 3000; private static readonly Vector2 slider_start_position = new Vector2(256 - slider_path_length / 2, 192); private static readonly Vector2 slider_end_position = new Vector2(256 + slider_path_length / 2, 192); + private static readonly Vector2 offset_inside_follow = new Vector2(35, 0); + private static readonly Vector2 offset_outside_follow = offset_inside_follow * 2; private ScoreAccessibleReplayPlayer currentPlayer = null!; @@ -43,8 +44,8 @@ namespace osu.Game.Rulesets.Osu.Tests performTest(new List { new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(32, 0), OsuAction.LeftButton), - new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(32, 0), OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_inside_follow, OsuAction.LeftButton), }); assertHeadJudgement(HitResult.Miss); @@ -53,14 +54,49 @@ namespace osu.Game.Rulesets.Osu.Tests assertSliderJudgement(HitResult.IgnoreHit); } + [Test] + public void TestHitEarlyAndReleaseInFollowRegion() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow), + new OsuReplayFrame(time_slider_end - 100, slider_end_position + offset_inside_follow, OsuAction.LeftButton), + }); + + assertHeadJudgement(HitResult.Miss); + assertTickJudgement(HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreMiss); + } + + [Test] + public void TestHitEarlyAndRepressInFollowRegion() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow), + new OsuReplayFrame(time_slider_start - 50, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 50, slider_end_position + offset_inside_follow, OsuAction.LeftButton), + }); + + assertHeadJudgement(HitResult.Miss); + assertTickJudgement(HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreMiss); + } + [Test] public void TestHitEarlyMoveOutsideFollowRegion() { performTest(new List { new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + new Vector2(96, 0), OsuAction.LeftButton), - new OsuReplayFrame(time_slider_end - 200, slider_end_position + new Vector2(96, 0), OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_outside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_outside_follow, OsuAction.LeftButton), }); assertHeadJudgement(HitResult.Miss); From 27e55def641cbf0eb233b4b094c2843b5648344b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 13 Dec 2023 20:27:14 +0900 Subject: [PATCH 147/567] Make animation start at the slider's start time --- osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs b/osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs index 355d3f9a2f..4fadb09948 100644 --- a/osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs +++ b/osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -26,13 +27,17 @@ namespace osu.Game.Rulesets.Osu.Skinning ((DrawableSlider?)ParentObject)?.Tracking.BindValueChanged(tracking => { Debug.Assert(ParentObject != null); + if (ParentObject.Judged) return; - if (tracking.NewValue) - OnSliderPress(); - else - OnSliderRelease(); + using (BeginAbsoluteSequence(Math.Max(Time.Current, ParentObject.HitObject?.StartTime ?? 0))) + { + if (tracking.NewValue) + OnSliderPress(); + else + OnSliderRelease(); + } }, true); } From a6bf4cdb986b0d598cb74a863d2bab4de5998354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 13 Dec 2023 13:22:12 +0100 Subject: [PATCH 148/567] Remove dead clamping code `EffectiveX` is already defined as clamped to `[0, CatchPlayfield.WIDTH]`. --- .../Beatmaps/CatchBeatmapProcessor.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index d5d4d3b694..02d4cdbb94 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -44,7 +44,6 @@ namespace osu.Game.Rulesets.Catch.Beatmaps base.PostProcess(); ApplyPositionOffsets(Beatmap); - ApplyPositionClamping(Beatmap); int index = 0; @@ -115,17 +114,6 @@ namespace osu.Game.Rulesets.Catch.Beatmaps initialiseHyperDash(beatmap); } - public void ApplyPositionClamping(IBeatmap beatmap) - { - foreach (var obj in beatmap.HitObjects.OfType()) - { - if (obj.EffectiveX < 0) - obj.XOffset += Math.Abs(obj.EffectiveX); - else if (obj.EffectiveX > CatchPlayfield.WIDTH) - obj.XOffset += CatchPlayfield.WIDTH - obj.EffectiveX; - } - } - private static void applyHardRockOffset(CatchHitObject hitObject, ref float? lastPosition, ref double lastStartTime, LegacyRandom rng) { float offsetPosition = hitObject.OriginalX; From 31c9489cb92e6d365813f7faef4139cb9ae2ddcc Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 13 Dec 2023 23:37:34 +0300 Subject: [PATCH 149/567] Fix failing tests --- .../Visual/SongSelect/TestSceneFilterControl.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneFilterControl.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneFilterControl.cs index 00a0d4a849..94c6130f15 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneFilterControl.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneFilterControl.cs @@ -192,7 +192,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddStep("select collection", () => { - InputManager.MoveMouseTo(getCollectionDropdownItems().ElementAt(1)); + InputManager.MoveMouseTo(getCollectionDropdownItemAt(1)); InputManager.Click(MouseButton.Left); }); @@ -206,7 +206,8 @@ namespace osu.Game.Tests.Visual.SongSelect AddStep("click manage collections filter", () => { - InputManager.MoveMouseTo(getCollectionDropdownItems().Last()); + int lastItemIndex = control.ChildrenOfType().Single().Items.Count() - 1; + InputManager.MoveMouseTo(getCollectionDropdownItemAt(lastItemIndex)); InputManager.Click(MouseButton.Left); }); @@ -232,10 +233,10 @@ namespace osu.Game.Tests.Visual.SongSelect private void assertCollectionDropdownContains(string collectionName, bool shouldContain = true) => AddUntilStep($"collection dropdown {(shouldContain ? "contains" : "does not contain")} '{collectionName}'", // A bit of a roundabout way of going about this, see: https://github.com/ppy/osu-framework/issues/3871 + https://github.com/ppy/osu-framework/issues/3872 - () => shouldContain == (getCollectionDropdownItems().Any(i => i.ChildrenOfType().OfType().First().Text == collectionName))); + () => shouldContain == control.ChildrenOfType().Any(i => i.ChildrenOfType().OfType().First().Text == collectionName)); private IconButton getAddOrRemoveButton(int index) - => getCollectionDropdownItems().ElementAt(index).ChildrenOfType().Single(); + => getCollectionDropdownItemAt(index).ChildrenOfType().Single(); private void addExpandHeaderStep() => AddStep("expand header", () => { @@ -249,7 +250,11 @@ namespace osu.Game.Tests.Visual.SongSelect InputManager.Click(MouseButton.Left); }); - private IEnumerable.DropdownMenu.DrawableDropdownMenuItem> getCollectionDropdownItems() - => control.ChildrenOfType().Single().ChildrenOfType.DropdownMenu.DrawableDropdownMenuItem>(); + private Menu.DrawableMenuItem getCollectionDropdownItemAt(int index) + { + // todo: we should be able to use Items, but apparently that's not guaranteed to be ordered... see: https://github.com/ppy/osu-framework/pull/6079 + CollectionFilterMenuItem item = control.ChildrenOfType().Single().ItemSource.ElementAt(index); + return control.ChildrenOfType().Single(i => i.Item.Text.Value == item.CollectionName); + } } } From 38e7c035008ba1e61ee364d53e6eb3bd0b1bc588 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 14 Dec 2023 12:00:01 +0900 Subject: [PATCH 150/567] Update tests to not miss the head --- .../TestSceneSliderEarlyHitJudgement.cs | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs index fb7d00b28c..9caee86a32 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs @@ -43,12 +43,12 @@ namespace osu.Game.Rulesets.Osu.Tests { performTest(new List { - new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 100, slider_end_position + offset_inside_follow, OsuAction.LeftButton), }); - assertHeadJudgement(HitResult.Miss); + assertHeadJudgement(HitResult.Meh); assertTickJudgement(HitResult.LargeTickHit); assertTailJudgement(HitResult.LargeTickHit); assertSliderJudgement(HitResult.IgnoreHit); @@ -59,16 +59,16 @@ namespace osu.Game.Rulesets.Osu.Tests { performTest(new List { - new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow), - new OsuReplayFrame(time_slider_end - 100, slider_end_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 50, slider_start_position + offset_inside_follow), + new OsuReplayFrame(time_slider_end - 50, slider_end_position + offset_inside_follow, OsuAction.LeftButton), }); - assertHeadJudgement(HitResult.Miss); + assertHeadJudgement(HitResult.Meh); assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.IgnoreMiss); - assertSliderJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); } [Test] @@ -76,17 +76,17 @@ namespace osu.Game.Rulesets.Osu.Tests { performTest(new List { - new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_inside_follow, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow), + new OsuReplayFrame(time_slider_start - 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_inside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 75, slider_start_position + offset_inside_follow), new OsuReplayFrame(time_slider_start - 50, slider_start_position + offset_inside_follow, OsuAction.LeftButton), new OsuReplayFrame(time_slider_end - 50, slider_end_position + offset_inside_follow, OsuAction.LeftButton), }); - assertHeadJudgement(HitResult.Miss); + assertHeadJudgement(HitResult.Meh); assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.IgnoreMiss); - assertSliderJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); } [Test] @@ -94,15 +94,15 @@ namespace osu.Game.Rulesets.Osu.Tests { performTest(new List { - new OsuReplayFrame(time_slider_start - 300, slider_start_position, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_start - 200, slider_start_position + offset_outside_follow, OsuAction.LeftButton), - new OsuReplayFrame(time_slider_end - 200, slider_end_position + offset_outside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_start - 100, slider_start_position + offset_outside_follow, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end - 100, slider_end_position + offset_outside_follow, OsuAction.LeftButton), }); - assertHeadJudgement(HitResult.Miss); + assertHeadJudgement(HitResult.Meh); assertTickJudgement(HitResult.LargeTickMiss); assertTailJudgement(HitResult.IgnoreMiss); - assertSliderJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); } private void assertHeadJudgement(HitResult result) @@ -179,7 +179,8 @@ namespace osu.Game.Rulesets.Osu.Tests Difficulty = new BeatmapDifficulty { SliderMultiplier = 1, - SliderTickRate = 3 + SliderTickRate = 3, + OverallDifficulty = 0 }, Ruleset = new OsuRuleset().RulesetInfo, } From 70a546b23cb3bb38f785f33dc3e18a1cbe3c129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 09:23:03 +0100 Subject: [PATCH 151/567] Add setting for adjusting whether text search is active by default --- osu.Game/Configuration/OsuConfigManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 6ef55ab919..ea526c6d54 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -49,6 +49,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation); SetDefault(OsuSetting.ModSelectHotkeyStyle, ModSelectHotkeyStyle.Sequential); + SetDefault(OsuSetting.ModSelectTextSearchStartsActive, true); SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2f, 1f); @@ -416,5 +417,6 @@ namespace osu.Game.Configuration AutomaticallyDownloadMissingBeatmaps, EditorShowSpeedChanges, TouchDisableGameplayTaps, + ModSelectTextSearchStartsActive, } } From 839a0802476deae907f773e781ab6b317434d332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 09:30:04 +0100 Subject: [PATCH 152/567] Add test coverage for desired mod overlay search box behaviour --- .../TestSceneModSelectOverlay.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index fed5f68449..80be4412b3 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; using osu.Framework.Testing; using osu.Framework.Utils; +using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; using osu.Game.Overlays.Mods; @@ -38,6 +39,9 @@ namespace osu.Game.Tests.Visual.UserInterface private TestModSelectOverlay modSelectOverlay = null!; + [Resolved] + private OsuConfigManager configManager { get; set; } = null!; + [BackgroundDependencyLoader] private void load() { @@ -566,17 +570,33 @@ namespace osu.Game.Tests.Visual.UserInterface } [Test] - public void TestSearchFocusChangeViaKey() + public void TestTextSearchActiveByDefault() { + configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true); createScreen(); - const Key focus_switch_key = Key.Tab; + AddUntilStep("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus); - AddStep("press tab", () => InputManager.Key(focus_switch_key)); - AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus); + AddStep("press tab", () => InputManager.Key(Key.Tab)); + AddAssert("search text box unfocused", () => !modSelectOverlay.SearchTextBox.HasFocus); - AddStep("press tab", () => InputManager.Key(focus_switch_key)); - AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus); + AddStep("press tab", () => InputManager.Key(Key.Tab)); + AddAssert("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus); + } + + [Test] + public void TestTextSearchNotActiveByDefault() + { + configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, false); + createScreen(); + + AddUntilStep("search text box not focused", () => !modSelectOverlay.SearchTextBox.HasFocus); + + AddStep("press tab", () => InputManager.Key(Key.Tab)); + AddAssert("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus); + + AddStep("press tab", () => InputManager.Key(Key.Tab)); + AddAssert("search text box unfocused", () => !modSelectOverlay.SearchTextBox.HasFocus); } [Test] From 0ab6e1879276a75702ef7b0f2ffd435a3521ac28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 09:49:48 +0100 Subject: [PATCH 153/567] Automatically focus search text box on open depending on setting --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index f2b3264a84..ce798ae752 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -115,6 +115,7 @@ namespace osu.Game.Overlays.Mods public IEnumerable AllAvailableMods => AvailableMods.Value.SelectMany(pair => pair.Value); private readonly BindableBool customisationVisible = new BindableBool(); + private Bindable textSearchStartsActive = null!; private ModSettingsArea modSettingsArea = null!; private ColumnScrollContainer columnScroll = null!; @@ -154,7 +155,7 @@ namespace osu.Game.Overlays.Mods } [BackgroundDependencyLoader] - private void load(OsuGameBase game, OsuColour colours, AudioManager audio) + private void load(OsuGameBase game, OsuColour colours, AudioManager audio, OsuConfigManager configManager) { Header.Title = ModSelectOverlayStrings.ModSelectTitle; Header.Description = ModSelectOverlayStrings.ModSelectDescription; @@ -282,6 +283,8 @@ namespace osu.Game.Overlays.Mods } globalAvailableMods.BindTo(game.AvailableMods); + + textSearchStartsActive = configManager.GetBindable(OsuSetting.ModSelectTextSearchStartsActive); } public override void Hide() @@ -617,6 +620,9 @@ namespace osu.Game.Overlays.Mods nonFilteredColumnCount += 1; } + + if (textSearchStartsActive.Value) + SearchTextBox.TakeFocus(); } protected override void PopOut() From b3a7c7a7c9bba70c1372a5f39875e8e3402c80fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 10:04:37 +0100 Subject: [PATCH 154/567] Add control to adjust mod select search text box behaviour --- osu.Game/Localisation/UserInterfaceStrings.cs | 5 +++++ .../Settings/Sections/UserInterface/SongSelectSettings.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/osu.Game/Localisation/UserInterfaceStrings.cs b/osu.Game/Localisation/UserInterfaceStrings.cs index 612668171c..68c5c3ccbc 100644 --- a/osu.Game/Localisation/UserInterfaceStrings.cs +++ b/osu.Game/Localisation/UserInterfaceStrings.cs @@ -104,6 +104,11 @@ namespace osu.Game.Localisation /// public static LocalisableString ModSelectHotkeyStyle => new TranslatableString(getKey(@"mod_select_hotkey_style"), @"Mod select hotkey style"); + /// + /// "Automatically focus search text box in mod select" + /// + public static LocalisableString ModSelectTextSearchStartsActive => new TranslatableString(getKey(@"mod_select_text_search_starts_active"), @"Automatically focus search text box in mod select"); + /// /// "no limit" /// diff --git a/osu.Game/Overlays/Settings/Sections/UserInterface/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/UserInterface/SongSelectSettings.cs index addf5ce163..49bd17dfde 100644 --- a/osu.Game/Overlays/Settings/Sections/UserInterface/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/UserInterface/SongSelectSettings.cs @@ -42,6 +42,12 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface ClassicDefault = ModSelectHotkeyStyle.Classic }, new SettingsCheckbox + { + LabelText = UserInterfaceStrings.ModSelectTextSearchStartsActive, + Current = config.GetBindable(OsuSetting.ModSelectTextSearchStartsActive), + ClassicDefault = false + }, + new SettingsCheckbox { LabelText = GameplaySettingsStrings.BackgroundBlur, Current = config.GetBindable(OsuSetting.SongSelectBackgroundBlur), From d77972a39b18f17e43f347fe3bf704e1fde8936b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Dec 2023 18:26:13 +0900 Subject: [PATCH 155/567] Show search bar by default in language and collection dropdowns --- osu.Game/Collections/CollectionDropdown.cs | 2 ++ osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/osu.Game/Collections/CollectionDropdown.cs b/osu.Game/Collections/CollectionDropdown.cs index e435992381..db7b27d30c 100644 --- a/osu.Game/Collections/CollectionDropdown.cs +++ b/osu.Game/Collections/CollectionDropdown.cs @@ -48,6 +48,8 @@ namespace osu.Game.Collections ItemSource = filters; Current.Value = new AllBeatmapsCollectionFilterMenuItem(); + + AlwaysShowSearchBar = true; } protected override void LoadComplete() diff --git a/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs index cf7f63211e..2af6e36b7f 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs @@ -23,6 +23,7 @@ namespace osu.Game.Overlays.Settings.Sections.General { LabelText = GeneralSettingsStrings.LanguageDropdown, Current = game.CurrentLanguage, + AlwaysShowSearchBar = true, }, new SettingsCheckbox { From 8698835db2e1d0163b3cb1af22532d8a7d4b1554 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 14 Dec 2023 14:00:35 +0200 Subject: [PATCH 156/567] fixed bug fixed the bug where it's not updates tooltip when there are no mods --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 2a9e69f141..6309b2b993 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -123,6 +123,8 @@ namespace osu.Game.Screens.Select.Details private void updateStatistics() { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; + + BeatmapDifficulty originalDifficulty = null; BeatmapDifficulty adjustedDifficulty = null; IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; @@ -130,7 +132,7 @@ namespace osu.Game.Screens.Select.Details if (baseDifficulty != null && (mods.Value.Any(m => m is IApplicableToDifficulty) || mods.Value.Any(m => m is IApplicableToRate))) { - BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(baseDifficulty); + originalDifficulty = new BeatmapDifficulty(baseDifficulty); foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(originalDifficulty); @@ -149,6 +151,13 @@ namespace osu.Game.Screens.Select.Details } } + // update tooltip anyway + else if (baseDifficulty != null) + { + originalDifficulty = new BeatmapDifficulty(baseDifficulty); + rateAdjustTooltip.UpdateAttributes(originalDifficulty, originalDifficulty); + } + switch (ruleset.OnlineID) { case 3: From c2373bb37b6574bdae17a39a064098bf83737fe7 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 14 Dec 2023 14:31:19 +0200 Subject: [PATCH 157/567] change the order of attributes + simplifying the bug fix --- osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs | 2 +- osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs | 2 +- osu.Game/Screens/Select/Details/AdvancedStats.cs | 13 ++----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index ed12d917ad..7b991dbbfb 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -89,8 +89,8 @@ namespace osu.Game.Overlays.Mods if (originalDifficulty == null || adjustedDifficulty == null) return; - attemptAdd("AR", bd => bd.ApproachRate); attemptAdd("OD", bd => bd.OverallDifficulty); + attemptAdd("AR", bd => bd.ApproachRate); attemptAdd("CS", bd => bd.CircleSize); attemptAdd("HP", bd => bd.DrainRate); diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index dd3daa2b7a..8b50bfc791 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -95,8 +95,8 @@ namespace osu.Game.Overlays.Mods { circleSizeDisplay = new VerticalAttributeDisplay("CS") { Shear = new Vector2(-shear, 0), }, drainRateDisplay = new VerticalAttributeDisplay("HP") { Shear = new Vector2(-shear, 0), }, - approachRateDisplay = new VerticalAttributeDisplay("AR") { Shear = new Vector2(-shear, 0), }, overallDifficultyDisplay = new VerticalAttributeDisplay("OD") { Shear = new Vector2(-shear, 0), }, + approachRateDisplay = new VerticalAttributeDisplay("AR") { Shear = new Vector2(-shear, 0), }, }); } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 6309b2b993..1c0667b9ee 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -124,15 +124,13 @@ namespace osu.Game.Screens.Select.Details { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; - BeatmapDifficulty originalDifficulty = null; BeatmapDifficulty adjustedDifficulty = null; IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; - if (baseDifficulty != null && - (mods.Value.Any(m => m is IApplicableToDifficulty) || mods.Value.Any(m => m is IApplicableToRate))) + if (baseDifficulty != null) { - originalDifficulty = new BeatmapDifficulty(baseDifficulty); + BeatmapDifficulty originalDifficulty = new BeatmapDifficulty(baseDifficulty); foreach (var mod in mods.Value.OfType()) mod.ApplyToDifficulty(originalDifficulty); @@ -151,13 +149,6 @@ namespace osu.Game.Screens.Select.Details } } - // update tooltip anyway - else if (baseDifficulty != null) - { - originalDifficulty = new BeatmapDifficulty(baseDifficulty); - rateAdjustTooltip.UpdateAttributes(originalDifficulty, originalDifficulty); - } - switch (ruleset.OnlineID) { case 3: From b22a7cf520b7dc0408b4199783ca898b47bb02f4 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 14 Dec 2023 14:31:58 +0200 Subject: [PATCH 158/567] Update AdvancedStats.cs --- osu.Game/Screens/Select/Details/AdvancedStats.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 1c0667b9ee..f56e84abce 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -123,7 +123,6 @@ namespace osu.Game.Screens.Select.Details private void updateStatistics() { IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty; - BeatmapDifficulty adjustedDifficulty = null; IRulesetInfo ruleset = gameRuleset?.Value ?? beatmapInfo.Ruleset; From 23c427cd3ee70781fbf226101af8d0156c1536fb Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Thu, 14 Dec 2023 14:38:01 +0200 Subject: [PATCH 159/567] Update AdjustedAttributesTooltip.cs --- osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index 7b991dbbfb..10b84340ae 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -89,10 +89,10 @@ namespace osu.Game.Overlays.Mods if (originalDifficulty == null || adjustedDifficulty == null) return; - attemptAdd("OD", bd => bd.OverallDifficulty); - attemptAdd("AR", bd => bd.ApproachRate); attemptAdd("CS", bd => bd.CircleSize); attemptAdd("HP", bd => bd.DrainRate); + attemptAdd("OD", bd => bd.OverallDifficulty); + attemptAdd("AR", bd => bd.ApproachRate); if (attributesFillFlow.Any()) content.Show(); From 67a5e01c49fe9a36ab6a70f63129156aa1ed1d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 15:19:29 +0100 Subject: [PATCH 160/567] Update assertions in test --- osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs index 60fb6b8c86..325cb9e0cb 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs @@ -220,7 +220,7 @@ namespace osu.Game.Tests.Visual.Online public void TestSelectedModsDontAffectStatistics() { AddStep("show map", () => overlay.ShowBeatmapSet(getBeatmapSet())); - AddAssert("AR displayed as 0", () => overlay.ChildrenOfType().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value == (0, null)); + AddAssert("AR displayed as 0", () => overlay.ChildrenOfType().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value, () => Is.EqualTo((0, 0))); AddStep("set AR10 diff adjust", () => SelectedMods.Value = new[] { new OsuModDifficultyAdjust @@ -228,7 +228,7 @@ namespace osu.Game.Tests.Visual.Online ApproachRate = { Value = 10 } } }); - AddAssert("AR still displayed as 0", () => overlay.ChildrenOfType().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value == (0, null)); + AddAssert("AR still displayed as 0", () => overlay.ChildrenOfType().Single(s => s.Title == BeatmapsetsStrings.ShowStatsAr).Value, () => Is.EqualTo((0, 0))); } [Test] From 9e5b6b97ff52753140331e16aa1b001df493ce89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 16:11:08 +0100 Subject: [PATCH 161/567] Fix `AdjustedAttributesTooltip` being broken by design Fixes issue described in the following comment: https://github.com/ppy/osu/pull/25759#issuecomment-1855954637 That is just not how the tooltip system is supposed to be used. To name the individual sins: - Caching and returning a tooltip instance like the classes that used tooltips is incorrect. The lifetime of tooltip instances is managed by the tooltip container. `GetCustomTooltip()` is called by it exclusively. It should return a fresh instance every time. - Not putting actual data in `IHasCustomTooltip.TooltipContent` is wrong. - Having `Tooltip.SetContent()` be a no-op is *grossly and flagrantly* wrong. I'm not even sure which particular combination of the above transgressions caused the issue as it presented itself, but at this time I frankly do not care. --- .../Mods/AdjustedAttributesTooltip.cs | 55 +++++++++++-------- .../Overlays/Mods/BeatmapAttributesDisplay.cs | 12 ++-- .../Screens/Select/Details/AdvancedStats.cs | 10 ++-- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs index 10b84340ae..957ee23e3b 100644 --- a/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs +++ b/osu.Game/Overlays/Mods/AdjustedAttributesTooltip.cs @@ -16,14 +16,13 @@ using osuTK; namespace osu.Game.Overlays.Mods { - public partial class AdjustedAttributesTooltip : VisibilityContainer, ITooltip + public partial class AdjustedAttributesTooltip : VisibilityContainer, ITooltip { private FillFlowContainer attributesFillFlow = null!; private Container content = null!; - private BeatmapDifficulty? originalDifficulty; - private BeatmapDifficulty? adjustedDifficulty; + private Data? data; [Resolved] private OsuColour colours { get; set; } = null!; @@ -73,26 +72,17 @@ namespace osu.Game.Overlays.Mods updateDisplay(); } - public void UpdateAttributes(BeatmapDifficulty original, BeatmapDifficulty adjusted) - { - originalDifficulty = original; - adjustedDifficulty = adjusted; - - if (IsLoaded) - updateDisplay(); - } - private void updateDisplay() { attributesFillFlow.Clear(); - if (originalDifficulty == null || adjustedDifficulty == null) - return; - - attemptAdd("CS", bd => bd.CircleSize); - attemptAdd("HP", bd => bd.DrainRate); - attemptAdd("OD", bd => bd.OverallDifficulty); - attemptAdd("AR", bd => bd.ApproachRate); + if (data != null) + { + attemptAdd("CS", bd => bd.CircleSize); + attemptAdd("HP", bd => bd.DrainRate); + attemptAdd("OD", bd => bd.OverallDifficulty); + attemptAdd("AR", bd => bd.ApproachRate); + } if (attributesFillFlow.Any()) content.Show(); @@ -101,16 +91,21 @@ namespace osu.Game.Overlays.Mods void attemptAdd(string name, Func lookup) { - double a = lookup(originalDifficulty); - double b = lookup(adjustedDifficulty); + double originalValue = lookup(data.OriginalDifficulty); + double adjustedValue = lookup(data.AdjustedDifficulty); - if (!Precision.AlmostEquals(a, b)) - attributesFillFlow.Add(new AttributeDisplay(name, a, b)); + if (!Precision.AlmostEquals(originalValue, adjustedValue)) + attributesFillFlow.Add(new AttributeDisplay(name, originalValue, adjustedValue)); } } - public void SetContent(object content) + public void SetContent(Data? data) { + if (this.data == data) + return; + + this.data = data; + updateDisplay(); } protected override void PopIn() => this.FadeIn(200, Easing.OutQuint); @@ -118,6 +113,18 @@ namespace osu.Game.Overlays.Mods public void Move(Vector2 pos) => Position = pos; + public class Data + { + public BeatmapDifficulty OriginalDifficulty { get; } + public BeatmapDifficulty AdjustedDifficulty { get; } + + public Data(BeatmapDifficulty originalDifficulty, BeatmapDifficulty adjustedDifficulty) + { + OriginalDifficulty = originalDifficulty; + AdjustedDifficulty = adjustedDifficulty; + } + } + private partial class AttributeDisplay : CompositeDrawable { public AttributeDisplay(string name, double original, double adjusted) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index 8b50bfc791..d50b2c33d7 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Mods /// On the mod select overlay, this provides a local updating view of BPM, star rating and other /// difficulty attributes so the user can have a better insight into what mods are changing. /// - public partial class BeatmapAttributesDisplay : ModFooterInformationDisplay, IHasCustomTooltip + public partial class BeatmapAttributesDisplay : ModFooterInformationDisplay, IHasCustomTooltip { private StarRatingDisplay starRatingDisplay = null!; private BPMDisplay bpmDisplay = null!; @@ -57,11 +57,9 @@ namespace osu.Game.Overlays.Mods private CancellationTokenSource? cancellationSource; private IBindable starDifficulty = null!; - private AdjustedAttributesTooltip rateAdjustTooltip = null!; + public ITooltip GetCustomTooltip() => new AdjustedAttributesTooltip(); - public ITooltip GetCustomTooltip() => rateAdjustTooltip; - - public object TooltipContent => this; + public AdjustedAttributesTooltip.Data? TooltipContent { get; private set; } private const float transition_duration = 250; @@ -70,8 +68,6 @@ namespace osu.Game.Overlays.Mods { const float shear = ShearedOverlayContainer.SHEAR; - rateAdjustTooltip = new AdjustedAttributesTooltip(); - LeftContent.AddRange(new Drawable[] { starRatingDisplay = new StarRatingDisplay(default, animated: true) @@ -182,7 +178,7 @@ namespace osu.Game.Overlays.Mods Ruleset ruleset = gameRuleset.Value.CreateInstance(); BeatmapDifficulty adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - rateAdjustTooltip.UpdateAttributes(originalDifficulty, adjustedDifficulty); + TooltipContent = new AdjustedAttributesTooltip.Data(originalDifficulty, adjustedDifficulty); approachRateDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.ApproachRate, adjustedDifficulty.ApproachRate); overallDifficultyDisplay.AdjustType.Value = VerticalAttributeDisplay.CalculateEffect(originalDifficulty.OverallDifficulty, adjustedDifficulty.OverallDifficulty); diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index f56e84abce..ee805c2d12 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -30,7 +30,7 @@ using osu.Game.Overlays.Mods; namespace osu.Game.Screens.Select.Details { - public partial class AdvancedStats : Container, IHasCustomTooltip + public partial class AdvancedStats : Container, IHasCustomTooltip { [Resolved] private BeatmapDifficultyCache difficultyCache { get; set; } @@ -46,9 +46,8 @@ namespace osu.Game.Screens.Select.Details protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; private readonly StatisticRow starDifficulty; - private AdjustedAttributesTooltip rateAdjustTooltip; - public ITooltip GetCustomTooltip() => rateAdjustTooltip; - public object TooltipContent => this; + public ITooltip GetCustomTooltip() => new AdjustedAttributesTooltip(); + public AdjustedAttributesTooltip.Data TooltipContent { get; private set; } private IBeatmapInfo beatmapInfo; @@ -86,7 +85,6 @@ namespace osu.Game.Screens.Select.Details private void load(OsuColour colours) { starDifficulty.AccentColour = colours.Yellow; - rateAdjustTooltip = new AdjustedAttributesTooltip(); } protected override void LoadComplete() @@ -144,7 +142,7 @@ namespace osu.Game.Screens.Select.Details adjustedDifficulty = ruleset.CreateInstance().GetRateAdjustedDisplayDifficulty(originalDifficulty, rate); - rateAdjustTooltip.UpdateAttributes(originalDifficulty, adjustedDifficulty); + TooltipContent = new AdjustedAttributesTooltip.Data(originalDifficulty, adjustedDifficulty); } } From 555559c5c12010122798086b6419b51442b86ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 20:41:07 +0100 Subject: [PATCH 162/567] Add testing for `GetRateAdjustedDisplayDifficulty()` implementations --- .../CatchRateAdjustedDisplayDifficultyTest.cs | 52 +++++++++++++++ .../OsuRateAdjustedDisplayDifficultyTest.cs | 65 +++++++++++++++++++ .../TaikoRateAdjustedDisplayDifficultyTest.cs | 52 +++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 osu.Game.Rulesets.Catch.Tests/CatchRateAdjustedDisplayDifficultyTest.cs create mode 100644 osu.Game.Rulesets.Osu.Tests/OsuRateAdjustedDisplayDifficultyTest.cs create mode 100644 osu.Game.Rulesets.Taiko.Tests/TaikoRateAdjustedDisplayDifficultyTest.cs diff --git a/osu.Game.Rulesets.Catch.Tests/CatchRateAdjustedDisplayDifficultyTest.cs b/osu.Game.Rulesets.Catch.Tests/CatchRateAdjustedDisplayDifficultyTest.cs new file mode 100644 index 0000000000..f77ec64df3 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/CatchRateAdjustedDisplayDifficultyTest.cs @@ -0,0 +1,52 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; + +namespace osu.Game.Rulesets.Catch.Tests +{ + [TestFixture] + public class CatchRateAdjustedDisplayDifficultyTest + { + private static IEnumerable difficultyValuesToTest() + { + for (float i = 0; i <= 10; i += 0.5f) + yield return i; + } + + [TestCaseSource(nameof(difficultyValuesToTest))] + public void TestApproachRateIsUnchangedWithRateEqualToOne(float originalApproachRate) + { + var ruleset = new CatchRuleset(); + var difficulty = new BeatmapDifficulty { ApproachRate = originalApproachRate }; + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(originalApproachRate)); + } + + [Test] + public void TestRateBelowOne() + { + var ruleset = new CatchRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 0.75); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(1.67).Within(0.01)); + } + + [Test] + public void TestRateAboveOne() + { + var ruleset = new CatchRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1.5); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(7.67).Within(0.01)); + } + } +} diff --git a/osu.Game.Rulesets.Osu.Tests/OsuRateAdjustedDisplayDifficultyTest.cs b/osu.Game.Rulesets.Osu.Tests/OsuRateAdjustedDisplayDifficultyTest.cs new file mode 100644 index 0000000000..aa903205c8 --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/OsuRateAdjustedDisplayDifficultyTest.cs @@ -0,0 +1,65 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; + +namespace osu.Game.Rulesets.Osu.Tests +{ + [TestFixture] + public class OsuRateAdjustedDisplayDifficultyTest + { + private static IEnumerable difficultyValuesToTest() + { + for (float i = 0; i <= 10; i += 0.5f) + yield return i; + } + + [TestCaseSource(nameof(difficultyValuesToTest))] + public void TestApproachRateIsUnchangedWithRateEqualToOne(float originalApproachRate) + { + var ruleset = new OsuRuleset(); + var difficulty = new BeatmapDifficulty { ApproachRate = originalApproachRate }; + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(originalApproachRate)); + } + + [TestCaseSource(nameof(difficultyValuesToTest))] + public void TestOverallDifficultyIsUnchangedWithRateEqualToOne(float originalOverallDifficulty) + { + var ruleset = new OsuRuleset(); + var difficulty = new BeatmapDifficulty { OverallDifficulty = originalOverallDifficulty }; + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1); + + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(originalOverallDifficulty)); + } + + [Test] + public void TestRateBelowOne() + { + var ruleset = new OsuRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 0.75); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(1.67).Within(0.01)); + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(2.22).Within(0.01)); + } + + [Test] + public void TestRateAboveOne() + { + var ruleset = new OsuRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1.5); + + Assert.That(adjustedDifficulty.ApproachRate, Is.EqualTo(7.67).Within(0.01)); + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(7.77).Within(0.01)); + } + } +} diff --git a/osu.Game.Rulesets.Taiko.Tests/TaikoRateAdjustedDisplayDifficultyTest.cs b/osu.Game.Rulesets.Taiko.Tests/TaikoRateAdjustedDisplayDifficultyTest.cs new file mode 100644 index 0000000000..4ab3f502ad --- /dev/null +++ b/osu.Game.Rulesets.Taiko.Tests/TaikoRateAdjustedDisplayDifficultyTest.cs @@ -0,0 +1,52 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; + +namespace osu.Game.Rulesets.Taiko.Tests +{ + [TestFixture] + public class TaikoRateAdjustedDisplayDifficultyTest + { + private static IEnumerable difficultyValuesToTest() + { + for (float i = 0; i <= 10; i += 0.5f) + yield return i; + } + + [TestCaseSource(nameof(difficultyValuesToTest))] + public void TestOverallDifficultyIsUnchangedWithRateEqualToOne(float originalOverallDifficulty) + { + var ruleset = new TaikoRuleset(); + var difficulty = new BeatmapDifficulty { OverallDifficulty = originalOverallDifficulty }; + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1); + + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(originalOverallDifficulty)); + } + + [Test] + public void TestRateBelowOne() + { + var ruleset = new TaikoRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 0.75); + + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(1.11).Within(0.01)); + } + + [Test] + public void TestRateAboveOne() + { + var ruleset = new TaikoRuleset(); + var difficulty = new BeatmapDifficulty(); + + var adjustedDifficulty = ruleset.GetRateAdjustedDisplayDifficulty(difficulty, 1.5); + + Assert.That(adjustedDifficulty.OverallDifficulty, Is.EqualTo(8.89).Within(0.01)); + } + } +} From 24e31f7d9199ea89c422447c228579d7779d346a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 19:00:00 +0100 Subject: [PATCH 163/567] Implement inverse of `IBeatmapDifficultyInfo.DifficultyRange()` --- osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs index e7a3d87d0a..07b966ca44 100644 --- a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs @@ -92,5 +92,21 @@ namespace osu.Game.Beatmaps /// Value to which the difficulty value maps in the specified range. static double DifficultyRange(double difficulty, (double od0, double od5, double od10) range) => DifficultyRange(difficulty, range.od0, range.od5, range.od10); + + /// + /// Inverse function to . + /// Maps a value returned by the function above back to the difficulty that produced it. + /// + /// The difficulty-dependent value to be unmapped. + /// Minimum of the resulting range which will be achieved by a difficulty value of 0. + /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. + /// Maximum of the resulting range which will be achieved by a difficulty value of 10. + /// Value to which the difficulty value maps in the specified range. + static double InverseDifficultyRange(double difficultyValue, double min, double mid, double max) + { + return difficultyValue >= mid + ? (difficultyValue - mid) / (max - mid) * 5 + 5 + : (difficultyValue - mid) / (mid - min) * 5 + 5; + } } } From fd1c72bf747cefdc9152008610550d28b24631d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 19:16:08 +0100 Subject: [PATCH 164/567] Use `IBeatmapDifficultyInfo.(Inverse)DifficultyRange()` instead of local reimplementations Also adds explicit references to places from where the magic constants were lifted. --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 10 ++++------ osu.Game.Rulesets.Osu/OsuRuleset.cs | 18 +++++++----------- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 9 ++++----- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index bcb28328f0..9b9840f71b 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -15,6 +15,7 @@ using osu.Game.Rulesets.Catch.Beatmaps; using osu.Game.Rulesets.Catch.Difficulty; using osu.Game.Rulesets.Catch.Edit; using osu.Game.Rulesets.Catch.Mods; +using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Catch.Scoring; using osu.Game.Rulesets.Catch.Skinning.Argon; @@ -236,17 +237,14 @@ namespace osu.Game.Rulesets.Catch }; } + /// public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = adjustedDifficulty.ApproachRate < 6 - ? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5 - : 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5; - + double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450); preempt /= rate; - - adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); + adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450); return adjustedDifficulty; } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 5355743a50..744f57eae9 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -332,23 +332,19 @@ namespace osu.Game.Rulesets.Osu public override RulesetSetupSection CreateEditorSetupSection() => new OsuSetupSection(); + /// + /// public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = adjustedDifficulty.ApproachRate < 5 - ? 1200.0 + 600.0 * (5 - adjustedDifficulty.ApproachRate) / 5 - : 1200.0 - 750.0 * (adjustedDifficulty.ApproachRate - 5) / 5; - + double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450); preempt /= rate; + adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450); - adjustedDifficulty.ApproachRate = (float)(preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5); - - double hitwindow = 80.0 - 6 * adjustedDifficulty.OverallDifficulty; - - hitwindow /= rate; - - adjustedDifficulty.OverallDifficulty = (float)(80.0 - hitwindow) / 6; + double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 80, 50, 20); + greatHitWindow /= rate; + adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 80, 50, 20); return adjustedDifficulty; } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 94136a11d3..e97f132e7a 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -265,15 +265,14 @@ namespace osu.Game.Rulesets.Taiko }; } + /// public override BeatmapDifficulty GetRateAdjustedDisplayDifficulty(IBeatmapDifficultyInfo difficulty, double rate) { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double hitWindow = 35.0 - 15.0 * (adjustedDifficulty.OverallDifficulty - 5) / 5; - - hitWindow /= rate; - - adjustedDifficulty.OverallDifficulty = (float)(5 * (35 - hitWindow) / 15 + 5); + double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 50, 35, 20); + greatHitWindow /= rate; + adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 50, 35, 20); return adjustedDifficulty; } From c0e68df20fb7d90bcd398e69a0a2f42dbfa72b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 19:30:56 +0100 Subject: [PATCH 165/567] Fix `InverseDifficultyRange()` not working correctly in both directions --- osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs index 07b966ca44..48f6564084 100644 --- a/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapDifficultyInfo.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; + namespace osu.Game.Beatmaps { /// @@ -98,15 +100,15 @@ namespace osu.Game.Beatmaps /// Maps a value returned by the function above back to the difficulty that produced it. /// /// The difficulty-dependent value to be unmapped. - /// Minimum of the resulting range which will be achieved by a difficulty value of 0. - /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. - /// Maximum of the resulting range which will be achieved by a difficulty value of 10. + /// Minimum of the resulting range which will be achieved by a difficulty value of 0. + /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. + /// Maximum of the resulting range which will be achieved by a difficulty value of 10. /// Value to which the difficulty value maps in the specified range. - static double InverseDifficultyRange(double difficultyValue, double min, double mid, double max) + static double InverseDifficultyRange(double difficultyValue, double diff0, double diff5, double diff10) { - return difficultyValue >= mid - ? (difficultyValue - mid) / (max - mid) * 5 + 5 - : (difficultyValue - mid) / (mid - min) * 5 + 5; + return Math.Sign(difficultyValue - diff5) == Math.Sign(diff10 - diff5) + ? (difficultyValue - diff5) / (diff10 - diff5) * 5 + 5 + : (difficultyValue - diff5) / (diff5 - diff0) * 5 + 5; } } } From 605269f65feea2657e5d6fae48d0ae99b5469b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 19:54:23 +0100 Subject: [PATCH 166/567] Extract preempt durations to shared constants --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 4 ++-- .../Objects/CatchHitObject.cs | 17 ++++++++++++++++- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 12 +++++++++++- osu.Game.Rulesets.Osu/OsuRuleset.cs | 4 ++-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 9b9840f71b..72d1a161dd 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -242,9 +242,9 @@ namespace osu.Game.Rulesets.Catch { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450); + double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, CatchHitObject.PREEMPT_MAX, CatchHitObject.PREEMPT_MID, CatchHitObject.PREEMPT_MIN); preempt /= rate; - adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450); + adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, CatchHitObject.PREEMPT_MAX, CatchHitObject.PREEMPT_MID, CatchHitObject.PREEMPT_MIN); return adjustedDifficulty; } diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index 17ff8afb87..52c42dfddb 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.Catch.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - TimePreempt = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); + TimePreempt = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.ApproachRate, PREEMPT_MAX, PREEMPT_MID, PREEMPT_MIN); Scale = LegacyRulesetExtensions.CalculateScaleFromCircleSize(difficulty.CircleSize); } @@ -189,6 +189,21 @@ namespace osu.Game.Rulesets.Catch.Objects // The half of the height of the osu! playfield. public const float DEFAULT_LEGACY_CONVERT_Y = 192; + /// + /// Minimum preempt time at AR=10. + /// + public const double PREEMPT_MIN = 450; + + /// + /// Median preempt time at AR=5. + /// + public const double PREEMPT_MID = 1200; + + /// + /// Maximum preempt time at AR=0. + /// + public const double PREEMPT_MAX = 1800; + /// /// The Y position of the hit object is not used in the normal osu!catch gameplay. /// It is preserved to maximize the backward compatibility with the legacy editor, in which the mappers use the Y position to organize the patterns. diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 21f7b4b22d..74631400ca 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -37,6 +37,16 @@ namespace osu.Game.Rulesets.Osu.Objects /// public const double PREEMPT_MIN = 450; + /// + /// Median preempt time at AR=5. + /// + public const double PREEMPT_MID = 1200; + + /// + /// Maximum preempt time at AR=0. + /// + public const double PREEMPT_MAX = 1800; + public double TimePreempt = 600; public double TimeFadeIn = 400; @@ -148,7 +158,7 @@ namespace osu.Game.Rulesets.Osu.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - TimePreempt = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.ApproachRate, 1800, 1200, PREEMPT_MIN); + TimePreempt = (float)IBeatmapDifficultyInfo.DifficultyRange(difficulty.ApproachRate, PREEMPT_MAX, PREEMPT_MID, PREEMPT_MIN); // Preempt time can go below 450ms. Normally, this is achieved via the DT mod which uniformly speeds up all animations game wide regardless of AR. // This uniform speedup is hard to match 1:1, however we can at least make AR>10 (via mods) feel good by extending the upper linear function above. diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 744f57eae9..5fe6e76e39 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -338,9 +338,9 @@ namespace osu.Game.Rulesets.Osu { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, 1800, 1200, 450); + double preempt = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.ApproachRate, OsuHitObject.PREEMPT_MAX, OsuHitObject.PREEMPT_MID, OsuHitObject.PREEMPT_MIN); preempt /= rate; - adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, 1800, 1200, 450); + adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, OsuHitObject.PREEMPT_MAX, OsuHitObject.PREEMPT_MID, OsuHitObject.PREEMPT_MIN); double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 80, 50, 20); greatHitWindow /= rate; From 0f4d054bfef007601f13d5695749c37e1898ea53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 14 Dec 2023 20:02:02 +0100 Subject: [PATCH 167/567] Use `HitWindows` data directly for computing effective OD --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 5 +++-- osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs | 4 ++-- osu.Game.Rulesets.Taiko/Scoring/TaikoHitWindows.cs | 4 ++-- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 5fe6e76e39..35cbfa3790 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -342,9 +342,10 @@ namespace osu.Game.Rulesets.Osu preempt /= rate; adjustedDifficulty.ApproachRate = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(preempt, OsuHitObject.PREEMPT_MAX, OsuHitObject.PREEMPT_MID, OsuHitObject.PREEMPT_MIN); - double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 80, 50, 20); + var greatHitWindowRange = OsuHitWindows.OSU_RANGES.Single(range => range.Result == HitResult.Great); + double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, greatHitWindowRange.Min, greatHitWindowRange.Average, greatHitWindowRange.Max); greatHitWindow /= rate; - adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 80, 50, 20); + adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, greatHitWindowRange.Min, greatHitWindowRange.Average, greatHitWindowRange.Max); return adjustedDifficulty; } diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs index 6f55e1790f..fd86e0eeda 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Scoring /// public const double MISS_WINDOW = 400; - private static readonly DifficultyRange[] osu_ranges = + internal static readonly DifficultyRange[] OSU_RANGES = { new DifficultyRange(HitResult.Great, 80, 50, 20), new DifficultyRange(HitResult.Ok, 140, 100, 60), @@ -34,6 +34,6 @@ namespace osu.Game.Rulesets.Osu.Scoring return false; } - protected override DifficultyRange[] GetRanges() => osu_ranges; + protected override DifficultyRange[] GetRanges() => OSU_RANGES; } } diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoHitWindows.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoHitWindows.cs index cf806c0c97..b44ef8ee93 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoHitWindows.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoHitWindows.cs @@ -7,7 +7,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring { public class TaikoHitWindows : HitWindows { - private static readonly DifficultyRange[] taiko_ranges = + internal static readonly DifficultyRange[] TAIKO_RANGES = { new DifficultyRange(HitResult.Great, 50, 35, 20), new DifficultyRange(HitResult.Ok, 120, 80, 50), @@ -27,6 +27,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring return false; } - protected override DifficultyRange[] GetRanges() => taiko_ranges; + protected override DifficultyRange[] GetRanges() => TAIKO_RANGES; } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index e97f132e7a..9d34a34fce 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -270,9 +270,10 @@ namespace osu.Game.Rulesets.Taiko { BeatmapDifficulty adjustedDifficulty = new BeatmapDifficulty(difficulty); - double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, 50, 35, 20); + var greatHitWindowRange = TaikoHitWindows.TAIKO_RANGES.Single(range => range.Result == HitResult.Great); + double greatHitWindow = IBeatmapDifficultyInfo.DifficultyRange(adjustedDifficulty.OverallDifficulty, greatHitWindowRange.Min, greatHitWindowRange.Average, greatHitWindowRange.Max); greatHitWindow /= rate; - adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, 50, 35, 20); + adjustedDifficulty.OverallDifficulty = (float)IBeatmapDifficultyInfo.InverseDifficultyRange(greatHitWindow, greatHitWindowRange.Min, greatHitWindowRange.Average, greatHitWindowRange.Max); return adjustedDifficulty; } From fbef40bb1f083dad5146e8d32f8ca879b06f3f29 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 11:01:13 +0900 Subject: [PATCH 168/567] Reduce some allocations in SongSelect in the mania ruleset --- osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index cda95a9d29..3c64df656d 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -245,6 +245,9 @@ namespace osu.Game.Screens.Select.Carousel private void updateKeyCount() { + if (Item?.State.Value == CarouselItemState.Collapsed) + return; + if (ruleset.Value.OnlineID == 3) { // Account for mania differences locally for now. From 27296c59defef2897879ccfe2cee52c9e203e747 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 11:26:10 +0900 Subject: [PATCH 169/567] Show back button when spectating Avoids getting stuck at some screens. It's a bit ugly having the back button visible like this, but is the best approach we have for now. --- osu.Game/Screens/Play/SpectatorPlayer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/SpectatorPlayer.cs b/osu.Game/Screens/Play/SpectatorPlayer.cs index d1404ac184..2faead0ee1 100644 --- a/osu.Game/Screens/Play/SpectatorPlayer.cs +++ b/osu.Game/Screens/Play/SpectatorPlayer.cs @@ -25,6 +25,8 @@ namespace osu.Game.Screens.Play private readonly Score score; + public override bool AllowBackButton => true; + protected override bool CheckModsAllowFailure() { if (!allowFail) From 599fdb0128d88cbc44b8147cd5058b83528f2287 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 14 Dec 2023 11:51:50 +0900 Subject: [PATCH 170/567] Add lenience for late-hit of slider heads --- .../TestSceneSliderLateHitJudgement.cs | 419 ++++++++++++++++++ .../Objects/Drawables/DrawableSlider.cs | 2 + .../Objects/Drawables/DrawableSliderBall.cs | 57 +-- .../Objects/Drawables/DrawableSliderHead.cs | 48 ++ .../Objects/Drawables/DrawableSliderRepeat.cs | 26 +- .../Objects/Drawables/DrawableSliderTail.cs | 26 +- .../Objects/Drawables/DrawableSliderTick.cs | 28 +- 7 files changed, 565 insertions(+), 41 deletions(-) create mode 100644 osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs new file mode 100644 index 0000000000..4f32a6fe9f --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -0,0 +1,419 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Framework.Screens; +using osu.Game.Beatmaps; +using osu.Game.Replays; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Replays; +using osu.Game.Rulesets.Scoring; +using osu.Game.Scoring; +using osu.Game.Screens.Play; +using osu.Game.Tests.Visual; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests +{ + public partial class TestSceneSliderLateHitJudgement : RateAdjustedBeatmapTestScene + { + // Note: In the following tests, the terminology "in range of the follow circle" is used as meaning + // the equivalent of "in range of the follow circle as if it were in its expanded state". + + private const double time_slider_start = 1000; + private const double time_slider_end = 1500; + + private static readonly Vector2 slider_start_position = new Vector2(256 - slider_path_length / 2, 192); + private static readonly Vector2 slider_end_position = new Vector2(256 + slider_path_length / 2, 192); + + private ScoreAccessibleReplayPlayer currentPlayer = null!; + + private const float slider_path_length = 200; + + private readonly List judgementResults = new List(); + + /// + /// If the head circle is hit and the mouse is in range of the follow circle, + /// then tracking should be enabled. + /// + [Test] + public void TestHitLateInRangeTracks() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 100, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 100, slider_end_position, OsuAction.LeftButton), + }); + + assertHeadJudgement(HitResult.Ok); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit and the mouse is NOT in range of the follow circle, + /// then tracking should NOT be enabled. + /// + [Test] + public void TestHitLateOutOfRangeDoesNotTrack() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 100, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 100, slider_end_position, OsuAction.LeftButton), + }, s => + { + s.SliderVelocityMultiplier = 2; + }); + + assertHeadJudgement(HitResult.Ok); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit late and the mouse is in range of the follow circle, + /// then all ticks that the follow circle has passed through should be hit. + /// + [Test] + public void TestHitLateInRangeHitsTicks() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_end_position, OsuAction.LeftButton), + }, s => + { + s.TickDistanceMultiplier = 0.2f; + }); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickHit); + assertTickJudgement(1, HitResult.LargeTickHit); + assertTickJudgement(2, HitResult.LargeTickHit); + assertTickJudgement(3, HitResult.LargeTickHit); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit late and the mouse is NOT in range of the follow circle, + /// then all ticks that the follow circle has passed through should NOT be hit. + /// + [Test] + public void TestHitLateOutOfRangeDoesNotHitTicks() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_end_position, OsuAction.LeftButton), + }, s => + { + s.SliderVelocityMultiplier = 2; + s.TickDistanceMultiplier = 0.2f; + }); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTickJudgement(1, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is pressed after it's missed and the mouse is in range of the follow circle, + /// then tracking should NOT be enabled. + /// + [Test] + public void TestMissHeadInRangeDoesNotTrack() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 151, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 151, slider_end_position, OsuAction.LeftButton), + }, s => + { + s.TickDistanceMultiplier = 0.2f; + }); + + assertHeadJudgement(HitResult.Miss); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTickJudgement(1, HitResult.LargeTickMiss); + assertTickJudgement(2, HitResult.LargeTickMiss); + assertTickJudgement(3, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreMiss); + } + + /// + /// If the head circle is hit late but after the completion of the slider and the mouse is in range of the follow circle, + /// then all nested objects (ticks/repeats/tail) should be hit. + /// + [Test] + public void TestHitLateShortSliderHitsAll() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position, OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(20, 0), + }, 20); + + s.TickDistanceMultiplier = 0.01f; + s.RepeatCount = 1; + }); + + assertHeadJudgement(HitResult.Meh); + assertAllTickJudgements(HitResult.LargeTickHit); + assertRepeatJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit late and the mouse is in range of the follow circle, + /// then all the repeats that the mouse has passed through should be hit. + /// + [Test] + public void TestHitLateInRangeHitsRepeat() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position, OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(50, 0), + }, 50); + + s.RepeatCount = 1; + }); + + assertHeadJudgement(HitResult.Meh); + assertRepeatJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit and the mouse is in range of the follow circle, + /// then only the ticks that were in range of the follow circle at the head should be hit. + /// If any hitobject was outside the follow range, ALL hitobjects after that point should be missed. + /// + [Test] + public void TestHitLateInRangeDoesNotHitAfterAnyOutOfRange() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position, OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.PERFECT_CURVE, new[] + { + Vector2.Zero, + new Vector2(70, 70), + new Vector2(20, 0), + }); + + s.TickDistanceMultiplier = 0.03f; + s.SliderVelocityMultiplier = 6f; + }); + + assertHeadJudgement(HitResult.Meh); + + // The first few ticks that are in the follow range of the head should be hit. + assertTickJudgement(0, HitResult.LargeTickHit); // This tick is hidden under the slider head :( + assertTickJudgement(1, HitResult.LargeTickHit); + assertTickJudgement(2, HitResult.LargeTickHit); + + // Every other tick should be missed + assertTickJudgement(3, HitResult.LargeTickMiss); + assertTickJudgement(4, HitResult.LargeTickMiss); + assertTickJudgement(5, HitResult.LargeTickMiss); + assertTickJudgement(6, HitResult.LargeTickMiss); + assertTickJudgement(7, HitResult.LargeTickMiss); + assertTickJudgement(8, HitResult.LargeTickMiss); + assertTickJudgement(9, HitResult.LargeTickMiss); + assertTickJudgement(10, HitResult.LargeTickMiss); + + // In particular, these three are in the follow range of the head, but should not be hit + // because the slider was at some point outside the follow range of the head. + assertTickJudgement(11, HitResult.LargeTickMiss); + assertTickJudgement(12, HitResult.LargeTickMiss); + + // And the tail should be hit because of its leniency. + assertTailJudgement(HitResult.LargeTickHit); + + assertSliderJudgement(HitResult.IgnoreHit); + } + + /// + /// If the head circle is hit and the mouse is in range of the follow circle, + /// then a tick outside the range of the follow circle from the head should not be hit. + /// + [Test] + public void TestHitLateInRangeDoesNotHitOutOfRange() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position, OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.PERFECT_CURVE, new[] + { + Vector2.Zero, + new Vector2(50, 50), + new Vector2(20, 0), + }); + + s.TickDistanceMultiplier = 0.3f; + s.SliderVelocityMultiplier = 3; + }); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + + private void assertHeadJudgement(HitResult result) + { + AddAssert( + "check head result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderHeadCircle)?.Type, + () => Is.EqualTo(result)); + } + + private void assertTickJudgement(int index, HitResult result) + { + AddAssert( + $"check tick({index}) result", + () => judgementResults.Where(r => r.HitObject is SliderTick).ElementAtOrDefault(index)?.Type, + () => Is.EqualTo(result)); + } + + private void assertAllTickJudgements(HitResult result) + { + AddAssert( + "check all tick results", + () => judgementResults.Where(r => r.HitObject is SliderTick).Select(t => t.Type), + () => Has.All.EqualTo(result)); + } + + private void assertRepeatJudgement(HitResult result) + { + AddAssert( + "check repeat result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderRepeat)?.Type, + () => Is.EqualTo(result)); + } + + private void assertTailJudgement(HitResult result) + { + AddAssert( + "check tail result", + () => judgementResults.SingleOrDefault(r => r.HitObject is SliderTailCircle)?.Type, + () => Is.EqualTo(result)); + } + + private void assertSliderJudgement(HitResult result) + { + AddAssert( + "check slider result", + () => judgementResults.SingleOrDefault(r => r.HitObject is Slider)?.Type, + () => Is.EqualTo(result)); + } + + private Vector2 computePositionFromTime(double time) + { + Vector2 dist = slider_end_position - slider_start_position; + double t = (time - time_slider_start) / (time_slider_end - time_slider_start); + return slider_start_position + dist * (float)t; + } + + private void performTest(List frames, Action? adjustSliderFunc = null, bool classic = false) + { + Slider slider = new Slider + { + StartTime = time_slider_start, + Position = new Vector2(256 - slider_path_length / 2, 192), + TickDistanceMultiplier = 3, + ClassicSliderBehaviour = classic, + Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(slider_path_length, 0), + }, slider_path_length), + }; + + adjustSliderFunc?.Invoke(slider); + + AddStep("load player", () => + { + Beatmap.Value = CreateWorkingBeatmap(new Beatmap + { + HitObjects = { slider }, + BeatmapInfo = + { + Difficulty = new BeatmapDifficulty + { + SliderMultiplier = 4, + SliderTickRate = 3 + }, + Ruleset = new OsuRuleset().RulesetInfo, + } + }); + + var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }); + + p.OnLoadComplete += _ => + { + p.ScoreProcessor.NewJudgement += result => + { + if (currentPlayer == p) judgementResults.Add(result); + }; + }; + + LoadScreen(currentPlayer = p); + judgementResults.Clear(); + }); + + AddUntilStep("Beatmap at 0", () => Beatmap.Value.Track.CurrentTime == 0); + AddUntilStep("Wait until player is loaded", () => currentPlayer.IsCurrentScreen()); + AddUntilStep("Wait for completion", () => currentPlayer.ScoreProcessor.HasCompleted.Value); + } + + private partial class ScoreAccessibleReplayPlayer : ReplayPlayer + { + public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; + + protected override bool PauseOnFocusLost => false; + + public ScoreAccessibleReplayPlayer(Score score) + : base(score, new PlayerConfiguration + { + AllowPause = false, + ShowResults = false, + }) + { + } + } + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index a053c99a53..1dd6f108f5 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -28,6 +28,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public DrawableSliderHead HeadCircle => headContainer.Child; public DrawableSliderTail TailCircle => tailContainer.Child; + public IEnumerable Ticks => tickContainer.Children; + public IEnumerable Repeats => repeatContainer.Children; [Cached] public DrawableSliderBall Ball { get; private set; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs index a1724d6fdc..764dd43c30 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs @@ -27,7 +27,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public Func GetInitialHitAction; - private Drawable followCircleReceptor; private DrawableSlider drawableSlider; private Drawable ball; @@ -48,13 +47,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, }, - followCircleReceptor = new CircularContainer - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Masking = true - }, ball = new SkinnableDrawable(new OsuSkinComponentLookup(OsuSkinComponents.SliderBall), _ => new DefaultSliderBall()) { Anchor = Anchor.Centre, @@ -86,21 +78,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables base.ApplyTransformsAt(time, false); } - private bool tracking; - - public bool Tracking - { - get => tracking; - private set - { - if (value == tracking) - return; - - tracking = value; - - followCircleReceptor.Scale = new Vector2(tracking ? FOLLOW_AREA : 1f); - } - } + public bool Tracking { get; private set; } /// /// If the cursor moves out of the ball's radius we still need to be able to receive positional updates to stop tracking. @@ -129,6 +107,30 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// private readonly List lastPressedActions = new List(); + public bool IsMouseInFollowCircleWithState(bool expanded) + { + if (lastScreenSpaceMousePosition is not Vector2 mousePos) + return false; + + float radius = GetFollowCircleRadius(expanded); + + double followProgress = Math.Clamp((Time.Current - drawableSlider.HitObject.StartTime) / drawableSlider.HitObject.Duration, 0, 1); + Vector2 followCirclePosition = drawableSlider.HitObject.CurvePositionAt(followProgress); + Vector2 mousePositionInSlider = drawableSlider.ToLocalSpace(mousePos) - drawableSlider.OriginPosition; + + return (mousePositionInSlider - followCirclePosition).LengthSquared <= radius * radius; + } + + public float GetFollowCircleRadius(bool expanded) + { + float radius = (float)drawableSlider.HitObject.Radius; + + if (expanded) + radius *= FOLLOW_AREA; + + return radius; + } + protected override void Update() { base.Update(); @@ -152,14 +154,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables timeToAcceptAnyKeyAfter = Time.Current; } + bool validInFollowArea = IsMouseInFollowCircleWithState(Tracking); + bool validInHeadCircle = drawableSlider.HeadCircle.IsHit + && IsMouseInFollowCircleWithState(true) + && drawableSlider.HeadCircle.Result.TimeAbsolute == Time.Current; + Tracking = // even in an edge case where current time has exceeded the slider's time, we may not have finished judging. // we don't want to potentially update from Tracking=true to Tracking=false at this point. (!drawableSlider.AllJudged || Time.Current <= drawableSlider.HitObject.GetEndTime()) // in valid position range - && lastScreenSpaceMousePosition.HasValue && followCircleReceptor.ReceivePositionalInputAt(lastScreenSpaceMousePosition.Value) && + && (validInFollowArea || validInHeadCircle) // valid action - (actions?.Any(isValidTrackingAction) ?? false); + && (actions?.Any(isValidTrackingAction) ?? false); lastPressedActions.Clear(); if (actions != null) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs index ff690417a8..0a104c123b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs @@ -3,10 +3,14 @@ #nullable disable +using System; using System.Diagnostics; +using System.Linq; using osu.Framework.Bindables; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Scoring; +using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -61,6 +65,50 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables CheckHittable = (d, t, r) => DrawableSlider.CheckHittable?.Invoke(d, t, r) ?? ClickAction.Hit; } + protected override void CheckForResult(bool userTriggered, double timeOffset) + { + base.CheckForResult(userTriggered, timeOffset); + + if (!Judged || !Result.IsHit) + return; + + // If the head is hit and in radius of the would-be-expanded follow circle, + // then hit every object that the follow circle has passed through up until the current time. + if (DrawableSlider.Ball.IsMouseInFollowCircleWithState(true)) + { + foreach (var nested in DrawableSlider.NestedHitObjects.OfType()) + { + if (nested.Judged) + continue; + + if (!check(nested.HitObject)) + break; + + if (nested is DrawableSliderTick tick) + tick.HitForcefully(); + + if (nested is DrawableSliderRepeat repeat) + repeat.HitForcefully(); + + if (nested is DrawableSliderTail tail) + tail.HitForcefully(); + } + } + + bool check(OsuHitObject h) + { + if (h.StartTime > Time.Current) + return false; + + float radius = DrawableSlider.Ball.GetFollowCircleRadius(true); + + double objectProgress = Math.Clamp((h.StartTime - DrawableSlider.HitObject.StartTime) / DrawableSlider.HitObject.Duration, 0, 1); + Vector2 objectPosition = DrawableSlider.HitObject.CurvePositionAt(objectProgress); + + return objectPosition.LengthSquared <= radius * radius; + } + } + protected override HitResult ResultFor(double timeOffset) { Debug.Assert(HitObject != null); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs index cdfd96514e..a7979bde27 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs @@ -85,17 +85,33 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Position = HitObject.Position - DrawableSlider.Position; } + public void HitForcefully() + { + if (Judged) + return; + + ApplyResult(r => r.Type = r.Judgement.MaxResult); + } + protected override void CheckForResult(bool userTriggered, double timeOffset) { // shared implementation with DrawableSliderTick. if (timeOffset >= 0) { - // Attempt to preserve correct ordering of judgements as best we can by forcing - // an un-judged head to be missed when the user has clearly skipped it. - // // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (Tracking && !DrawableSlider.HeadCircle.Judged) - DrawableSlider.HeadCircle.MissForcefully(); + if (!DrawableSlider.HeadCircle.Judged) + { + if (Tracking) + { + // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. + DrawableSlider.HeadCircle.MissForcefully(); + } + else + { + // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. + return; + } + } ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult); } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs index e3ed12a648..1ffbaf11c5 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs @@ -125,6 +125,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } + public void HitForcefully() + { + if (Judged) + return; + + ApplyResult(r => r.Type = r.Judgement.MaxResult); + } + protected override void CheckForResult(bool userTriggered, double timeOffset) { if (userTriggered) @@ -141,12 +149,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (timeOffset < SliderEventGenerator.TAIL_LENIENCY) return; - // Attempt to preserve correct ordering of judgements as best we can by forcing - // an un-judged head to be missed when the user has clearly skipped it. - // // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (Tracking && !DrawableSlider.HeadCircle.Judged) - DrawableSlider.HeadCircle.MissForcefully(); + if (!DrawableSlider.HeadCircle.Judged) + { + if (Tracking) + { + // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. + DrawableSlider.HeadCircle.MissForcefully(); + } + else + { + // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. + return; + } + } // The player needs to have engaged in tracking at any point after the tail leniency cutoff. // An actual tick miss should only occur if reaching the tick itself. diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 172dca356e..b2ac8ecbda 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -73,17 +73,33 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Position = HitObject.Position - DrawableSlider.HitObject.Position; } + public void HitForcefully() + { + if (Judged) + return; + + ApplyResult(r => r.Type = r.Judgement.MaxResult); + } + protected override void CheckForResult(bool userTriggered, double timeOffset) { // shared implementation with DrawableSliderRepeat. if (timeOffset >= 0) { - // Attempt to preserve correct ordering of judgements as best we can by forcing - // an un-judged head to be missed when the user has clearly skipped it. - // // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (Tracking && !DrawableSlider.HeadCircle.Judged) - DrawableSlider.HeadCircle.MissForcefully(); + if (!DrawableSlider.HeadCircle.Judged) + { + if (Tracking) + { + // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. + DrawableSlider.HeadCircle.MissForcefully(); + } + else + { + // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. + return; + } + } ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult); } @@ -107,7 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables case ArmedState.Miss: this.FadeOut(ANIM_DURATION); - this.FadeColour(Color4.Red, ANIM_DURATION / 2); + this.TransformBindableTo(AccentColour, Color4.Red, 0); break; case ArmedState.Hit: From b86f387fd30acab999ad27d38dfb31bd9a993e8a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 15:04:20 +0900 Subject: [PATCH 171/567] Fix the width of vertical attribute display numbers Not necessarily required to fix the issue at hand, but probably good practice here. --- osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs index 62c08f8132..33b7eaae1c 100644 --- a/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs +++ b/osu.Game/Overlays/Mods/VerticalAttributeDisplay.cs @@ -82,7 +82,8 @@ namespace osu.Game.Overlays.Mods { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - AutoSizeAxes = Axes.Both, + AutoSizeAxes = Axes.Y, + Width = 50, Direction = FillDirection.Vertical, Children = new Drawable[] { From dc5c9837ed969d736645b9bf287099069774caa1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 16:00:03 +0900 Subject: [PATCH 172/567] Fix `StarRatingDisplay`'s display width to avoid text making slight autosize changes --- .../Beatmaps/Drawables/StarRatingDisplay.cs | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/StarRatingDisplay.cs b/osu.Game/Beatmaps/Drawables/StarRatingDisplay.cs index df8953d57c..55ef6f705e 100644 --- a/osu.Game/Beatmaps/Drawables/StarRatingDisplay.cs +++ b/osu.Game/Beatmaps/Drawables/StarRatingDisplay.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; @@ -38,6 +39,8 @@ namespace osu.Game.Beatmaps.Drawables private readonly Bindable displayedStars = new BindableDouble(); + private readonly Container textContainer; + /// /// The currently displayed stars of this display wrapped in a bindable. /// This bindable gets transformed on change rather than instantaneous, if animation is enabled. @@ -116,15 +119,19 @@ namespace osu.Game.Beatmaps.Drawables Size = new Vector2(8f), }, Empty(), - starsText = new OsuSpriteText + textContainer = new Container { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Margin = new MarginPadding { Bottom = 1.5f }, - // todo: this should be size: 12f, but to match up with the design, it needs to be 14.4f - // see https://github.com/ppy/osu-framework/issues/3271. - Font = OsuFont.Torus.With(size: 14.4f, weight: FontWeight.Bold), - Shadow = false, + AutoSizeAxes = Axes.Y, + Child = starsText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Margin = new MarginPadding { Bottom = 1.5f }, + // todo: this should be size: 12f, but to match up with the design, it needs to be 14.4f + // see https://github.com/ppy/osu-framework/issues/3271. + Font = OsuFont.Torus.With(size: 14.4f, weight: FontWeight.Bold), + Shadow = false, + }, }, } } @@ -155,6 +162,11 @@ namespace osu.Game.Beatmaps.Drawables starIcon.Colour = s.NewValue >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4Extensions.FromHex("303d47"); starsText.Colour = s.NewValue >= 6.5 ? colours.Orange1 : colourProvider?.Background5 ?? Color4.Black.Opacity(0.75f); + + // In order to avoid autosize throwing the width of these displays all over the place, + // let's lock in some sane defaults for the text width based on how many digits we're + // displaying. + textContainer.Width = 24 + Math.Max(starsText.Text.ToString().Length - 4, 0) * 6; }, true); } } From 4357bb1040b6f7e64f7bc24eb98434e682d352cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 16:01:07 +0900 Subject: [PATCH 173/567] Change `LeftContent` autosize duration to match main content to reduce visual awkwards --- osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs index d50b2c33d7..94dd96ec1c 100644 --- a/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs +++ b/osu.Game/Overlays/Mods/BeatmapAttributesDisplay.cs @@ -144,8 +144,8 @@ namespace osu.Game.Overlays.Mods private void startAnimating() { - Content.AutoSizeEasing = Easing.OutQuint; - Content.AutoSizeDuration = transition_duration; + LeftContent.AutoSizeEasing = Content.AutoSizeEasing = Easing.OutQuint; + LeftContent.AutoSizeDuration = Content.AutoSizeDuration = transition_duration; } private void updateValues() => Scheduler.AddOnce(() => From 6e7e243e70492bc55dac69ce28ab7b8480c8702b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 16:05:29 +0900 Subject: [PATCH 174/567] Allow new common cases when a user is locating a stable osu! install directory for import --- .../Maintenance/StableDirectorySelectScreen.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs index 1b935b0cec..73ac6efcd8 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs @@ -15,7 +15,16 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled; - protected override bool IsValidDirectory(DirectoryInfo? info) => info?.GetFiles("osu!.*.cfg").Any() ?? false; + protected override bool IsValidDirectory(DirectoryInfo? info) => + // A full stable installation will have a configuration file present. + // This is the best case scenario, as it may contain a custom beatmap directory we need to traverse to. + info?.GetFiles("osu!.*.cfg").Any() == true || + // The user may only have their songs or skins folders left. + // We still want to allow them to import based on this. + info?.GetDirectories("Songs").Any() == true || + info?.GetDirectories("Skins").Any() == true || + // The user may have traverse *inside* their songs or skins folders. + shouldUseParentDirectory(info); public override LocalisableString HeaderText => "Please select your osu!stable install location"; @@ -26,7 +35,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance protected override void OnSelection(DirectoryInfo directory) { - taskCompletionSource.TrySetResult(directory.FullName); + taskCompletionSource.TrySetResult(shouldUseParentDirectory(directory) ? directory.Parent!.FullName : directory.FullName); this.Exit(); } @@ -35,5 +44,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance taskCompletionSource.TrySetCanceled(); return base.OnExiting(e); } + + private bool shouldUseParentDirectory(DirectoryInfo? info) + => info?.Parent != null && (info?.Name == "Songs" || info?.Name == "Skins"); } } From 6bd190c55d809ee6b69db19d5ce944bd6c887bfd Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 16:13:32 +0900 Subject: [PATCH 175/567] Refactor all slider input into SliderInputManager --- .../Objects/Drawables/DrawableHitCircle.cs | 2 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 5 + .../Objects/Drawables/DrawableSlider.cs | 14 +- .../Objects/Drawables/DrawableSliderBall.cs | 126 +-------- .../Objects/Drawables/DrawableSliderHead.cs | 44 +--- .../Objects/Drawables/DrawableSliderRepeat.cs | 36 +-- .../Objects/Drawables/DrawableSliderTail.cs | 53 +--- .../Objects/Drawables/DrawableSliderTick.cs | 36 +-- .../Objects/Drawables/IRequireTracking.cs | 13 - .../Objects/Drawables/SliderInputManager.cs | 248 ++++++++++++++++++ 10 files changed, 270 insertions(+), 307 deletions(-) delete mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs create mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index e87a075a11..0d665cad0c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public partial class DrawableHitCircle : DrawableOsuHitObject, IHasApproachCircle { - public OsuAction? HitAction => HitArea.HitAction; + public OsuAction? HitAction => HitArea?.HitAction; protected virtual OsuSkinComponents CirclePieceComponent => OsuSkinComponents.HitCircle; public SkinnableDrawable ApproachCircle { get; private set; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index bdd818cf18..5b379a0d90 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -97,6 +97,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// public virtual void Shake() { } + /// + /// Causes this to get hit, disregarding all conditions in implementations of . + /// + public void HitForcefully() => ApplyResult(r => r.Type = r.Judgement.MaxResult); + /// /// Causes this to get missed, disregarding all conditions in implementations of . /// diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 1dd6f108f5..1f9a028045 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -28,8 +28,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public DrawableSliderHead HeadCircle => headContainer.Child; public DrawableSliderTail TailCircle => tailContainer.Child; - public IEnumerable Ticks => tickContainer.Children; - public IEnumerable Repeats => repeatContainer.Children; [Cached] public DrawableSliderBall Ball { get; private set; } @@ -60,6 +58,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public IBindable PathVersion => pathVersion; private readonly Bindable pathVersion = new Bindable(); + public readonly SliderInputManager SliderInputManager; + private Container headContainer; private Container tailContainer; private Container tickContainer; @@ -74,9 +74,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public DrawableSlider([CanBeNull] Slider s = null) : base(s) { + SliderInputManager = new SliderInputManager(this); + Ball = new DrawableSliderBall { - GetInitialHitAction = () => HeadCircle.HitAction, BypassAutoSizeAxes = Axes.Both, AlwaysPresent = true, Alpha = 0 @@ -90,6 +91,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddRangeInternal(new Drawable[] { + SliderInputManager, shakeContainer = new ShakeContainer { ShakeDuration = 30, @@ -234,7 +236,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.Update(); - Tracking.Value = Ball.Tracking; + Tracking.Value = SliderInputManager.Tracking; if (Tracking.Value && slidingSample != null) // keep the sliding sample playing at the current tracking position @@ -247,8 +249,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (DrawableHitObject hitObject in NestedHitObjects) { - if (hitObject is ITrackSnaking s) s.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0)); - if (hitObject is IRequireTracking t) t.Tracking = Ball.Tracking; + if (hitObject is ITrackSnaking s) + s.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0)); } Size = SliderBody?.Size ?? Vector2.Zero; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs index 764dd43c30..46f0231981 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs @@ -4,14 +4,9 @@ #nullable disable using System; -using System.Collections.Generic; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; -using osu.Framework.Input.Events; -using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Skinning.Default; @@ -21,12 +16,10 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public partial class DrawableSliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition + public partial class DrawableSliderBall : CircularContainer, ISliderProgress { public const float FOLLOW_AREA = 2.4f; - public Func GetInitialHitAction; - private DrawableSlider drawableSlider; private Drawable ball; @@ -55,14 +48,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }; } - private Vector2? lastScreenSpaceMousePosition; - - protected override bool OnMouseMove(MouseMoveEvent e) - { - lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition; - return base.OnMouseMove(e); - } - public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { // Consider the case of rewinding - children's transforms are handled internally, so propagating down @@ -78,115 +63,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables base.ApplyTransformsAt(time, false); } - public bool Tracking { get; private set; } - - /// - /// If the cursor moves out of the ball's radius we still need to be able to receive positional updates to stop tracking. - /// - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; - - /// - /// The point in time after which we can accept any key for tracking. Before this time, we may need to restrict tracking to the key used to hit the head circle. - /// - /// This is a requirement to stop the case where a player holds down one key (from before the slider) and taps the second key while maintaining full scoring (tracking) of sliders. - /// Visually, this special case can be seen below (time increasing from left to right): - /// - /// Z Z+X Z - /// o========o - /// - /// Without this logic, tracking would continue through the entire slider even though no key hold action is directly attributing to it. - /// - /// In all other cases, no special handling is required (either key being pressed is allowable as valid tracking). - /// - /// The reason for storing this as a time value (rather than a bool) is to correctly handle rewind scenarios. - /// - private double? timeToAcceptAnyKeyAfter; - - /// - /// The actions that were pressed in the previous frame. - /// - private readonly List lastPressedActions = new List(); - - public bool IsMouseInFollowCircleWithState(bool expanded) - { - if (lastScreenSpaceMousePosition is not Vector2 mousePos) - return false; - - float radius = GetFollowCircleRadius(expanded); - - double followProgress = Math.Clamp((Time.Current - drawableSlider.HitObject.StartTime) / drawableSlider.HitObject.Duration, 0, 1); - Vector2 followCirclePosition = drawableSlider.HitObject.CurvePositionAt(followProgress); - Vector2 mousePositionInSlider = drawableSlider.ToLocalSpace(mousePos) - drawableSlider.OriginPosition; - - return (mousePositionInSlider - followCirclePosition).LengthSquared <= radius * radius; - } - - public float GetFollowCircleRadius(bool expanded) - { - float radius = (float)drawableSlider.HitObject.Radius; - - if (expanded) - radius *= FOLLOW_AREA; - - return radius; - } - - protected override void Update() - { - base.Update(); - - // from the point at which the head circle is hit, this will be non-null. - // it may be null if the head circle was missed. - var headCircleHitAction = GetInitialHitAction(); - - if (headCircleHitAction == null) - timeToAcceptAnyKeyAfter = null; - - var actions = drawableSlider.OsuActionInputManager?.PressedActions; - - // if the head circle was hit with a specific key, tracking should only occur while that key is pressed. - if (headCircleHitAction != null && timeToAcceptAnyKeyAfter == null) - { - var otherKey = headCircleHitAction == OsuAction.RightButton ? OsuAction.LeftButton : OsuAction.RightButton; - - // we can start accepting any key once all other keys have been released in the previous frame. - if (!lastPressedActions.Contains(otherKey)) - timeToAcceptAnyKeyAfter = Time.Current; - } - - bool validInFollowArea = IsMouseInFollowCircleWithState(Tracking); - bool validInHeadCircle = drawableSlider.HeadCircle.IsHit - && IsMouseInFollowCircleWithState(true) - && drawableSlider.HeadCircle.Result.TimeAbsolute == Time.Current; - - Tracking = - // even in an edge case where current time has exceeded the slider's time, we may not have finished judging. - // we don't want to potentially update from Tracking=true to Tracking=false at this point. - (!drawableSlider.AllJudged || Time.Current <= drawableSlider.HitObject.GetEndTime()) - // in valid position range - && (validInFollowArea || validInHeadCircle) - // valid action - && (actions?.Any(isValidTrackingAction) ?? false); - - lastPressedActions.Clear(); - if (actions != null) - lastPressedActions.AddRange(actions); - } - - /// - /// Check whether a given user input is a valid tracking action. - /// - private bool isValidTrackingAction(OsuAction action) - { - bool headCircleHit = GetInitialHitAction().HasValue; - - // if the head circle was hit, we may not yet be allowed to accept any key, so we must use the initial hit action. - if (headCircleHit && (!timeToAcceptAnyKeyAfter.HasValue || Time.Current <= timeToAcceptAnyKeyAfter.Value)) - return action == GetInitialHitAction(); - - return action == OsuAction.LeftButton || action == OsuAction.RightButton; - } - private Vector2? lastPosition; public void UpdateProgress(double completionProgress) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs index 0a104c123b..76b9fdc3ce 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs @@ -3,14 +3,10 @@ #nullable disable -using System; using System.Diagnostics; -using System.Linq; using osu.Framework.Bindables; -using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Scoring; -using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -68,45 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void CheckForResult(bool userTriggered, double timeOffset) { base.CheckForResult(userTriggered, timeOffset); - - if (!Judged || !Result.IsHit) - return; - - // If the head is hit and in radius of the would-be-expanded follow circle, - // then hit every object that the follow circle has passed through up until the current time. - if (DrawableSlider.Ball.IsMouseInFollowCircleWithState(true)) - { - foreach (var nested in DrawableSlider.NestedHitObjects.OfType()) - { - if (nested.Judged) - continue; - - if (!check(nested.HitObject)) - break; - - if (nested is DrawableSliderTick tick) - tick.HitForcefully(); - - if (nested is DrawableSliderRepeat repeat) - repeat.HitForcefully(); - - if (nested is DrawableSliderTail tail) - tail.HitForcefully(); - } - } - - bool check(OsuHitObject h) - { - if (h.StartTime > Time.Current) - return false; - - float radius = DrawableSlider.Ball.GetFollowCircleRadius(true); - - double objectProgress = Math.Clamp((h.StartTime - DrawableSlider.HitObject.StartTime) / DrawableSlider.HitObject.Duration, 0, 1); - Vector2 objectPosition = DrawableSlider.HitObject.CurvePositionAt(objectProgress); - - return objectPosition.LengthSquared <= radius * radius; - } + DrawableSlider.SliderInputManager.PostProcessHeadJudgement(this); } protected override HitResult ResultFor(double timeOffset) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs index a7979bde27..0c8e5b765f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs @@ -17,7 +17,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public partial class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking, IRequireTracking + public partial class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking { public new SliderRepeat HitObject => (SliderRepeat)base.HitObject; @@ -36,8 +36,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public override bool DisplayResult => false; - public bool Tracking { get; set; } - public DrawableSliderRepeat() : base(null) { @@ -85,37 +83,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Position = HitObject.Position - DrawableSlider.Position; } - public void HitForcefully() - { - if (Judged) - return; - - ApplyResult(r => r.Type = r.Judgement.MaxResult); - } - - protected override void CheckForResult(bool userTriggered, double timeOffset) - { - // shared implementation with DrawableSliderTick. - if (timeOffset >= 0) - { - // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (!DrawableSlider.HeadCircle.Judged) - { - if (Tracking) - { - // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. - DrawableSlider.HeadCircle.MissForcefully(); - } - else - { - // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. - return; - } - } - - ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult); - } - } + protected override void CheckForResult(bool userTriggered, double timeOffset) => DrawableSlider.SliderInputManager.TryJudgeNestedObject(this, timeOffset); protected override void UpdateInitialTransforms() { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs index 1ffbaf11c5..60bad5d4a7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs @@ -4,12 +4,10 @@ #nullable disable using System.Diagnostics; -using System.Linq; using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Skinning; @@ -17,7 +15,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public partial class DrawableSliderTail : DrawableOsuHitObject, IRequireTracking + public partial class DrawableSliderTail : DrawableOsuHitObject { public new SliderTailCircle HitObject => (SliderTailCircle)base.HitObject; @@ -37,8 +35,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// public bool SamplePlaysOnlyOnHit { get; set; } = true; - public bool Tracking { get; set; } - public SkinnableDrawable CirclePiece { get; private set; } private Container scaleContainer; @@ -125,52 +121,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void HitForcefully() - { - if (Judged) - return; - - ApplyResult(r => r.Type = r.Judgement.MaxResult); - } - - protected override void CheckForResult(bool userTriggered, double timeOffset) - { - if (userTriggered) - return; - - // Ensure the tail can only activate after all previous ticks/repeats already have. - // - // This covers the edge case where the lenience may allow the tail to activate before - // the last tick, changing ordering of score/combo awarding. - var lastTick = DrawableSlider.NestedHitObjects.LastOrDefault(o => o.HitObject is SliderTick || o.HitObject is SliderRepeat); - if (lastTick?.Judged == false) - return; - - if (timeOffset < SliderEventGenerator.TAIL_LENIENCY) - return; - - // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (!DrawableSlider.HeadCircle.Judged) - { - if (Tracking) - { - // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. - DrawableSlider.HeadCircle.MissForcefully(); - } - else - { - // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. - return; - } - } - - // The player needs to have engaged in tracking at any point after the tail leniency cutoff. - // An actual tick miss should only occur if reaching the tick itself. - if (Tracking) - ApplyResult(r => r.Type = r.Judgement.MaxResult); - else if (timeOffset > 0) - ApplyResult(r => r.Type = r.Judgement.MinResult); - } + protected override void CheckForResult(bool userTriggered, double timeOffset) => DrawableSlider.SliderInputManager.TryJudgeNestedObject(this, timeOffset); protected override void OnApply() { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index b2ac8ecbda..cb323f4ac7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -14,14 +14,12 @@ using osu.Framework.Graphics.Containers; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public partial class DrawableSliderTick : DrawableOsuHitObject, IRequireTracking + public partial class DrawableSliderTick : DrawableOsuHitObject { public const double ANIM_DURATION = 150; private const float default_tick_size = 16; - public bool Tracking { get; set; } - public override bool DisplayResult => false; protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject; @@ -73,37 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Position = HitObject.Position - DrawableSlider.HitObject.Position; } - public void HitForcefully() - { - if (Judged) - return; - - ApplyResult(r => r.Type = r.Judgement.MaxResult); - } - - protected override void CheckForResult(bool userTriggered, double timeOffset) - { - // shared implementation with DrawableSliderRepeat. - if (timeOffset >= 0) - { - // This check is applied to all nested slider objects apart from the head (ticks, repeats, tail). - if (!DrawableSlider.HeadCircle.Judged) - { - if (Tracking) - { - // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. - DrawableSlider.HeadCircle.MissForcefully(); - } - else - { - // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. - return; - } - } - - ApplyResult(r => r.Type = Tracking ? r.Judgement.MaxResult : r.Judgement.MinResult); - } - } + protected override void CheckForResult(bool userTriggered, double timeOffset) => DrawableSlider.SliderInputManager.TryJudgeNestedObject(this, timeOffset); protected override void UpdateInitialTransforms() { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs deleted file mode 100644 index b1815b23c9..0000000000 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Osu.Objects.Drawables -{ - public interface IRequireTracking - { - /// - /// Whether the is currently being tracked by the user. - /// - bool Tracking { get; set; } - } -} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs new file mode 100644 index 0000000000..a5d7bdc7db --- /dev/null +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -0,0 +1,248 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Input; +using osu.Framework.Input.Events; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Objects.Drawables +{ + public partial class SliderInputManager : Component, IRequireHighFrequencyMousePosition + { + /// + /// Whether the slider is currently being tracked. + /// + public bool Tracking { get; private set; } + + /// + /// The point in time after which we can accept any key for tracking. Before this time, we may need to restrict tracking to the key used to hit the head circle. + /// + /// This is a requirement to stop the case where a player holds down one key (from before the slider) and taps the second key while maintaining full scoring (tracking) of sliders. + /// Visually, this special case can be seen below (time increasing from left to right): + /// + /// Z Z+X Z + /// o========o + /// + /// Without this logic, tracking would continue through the entire slider even though no key hold action is directly attributing to it. + /// + /// In all other cases, no special handling is required (either key being pressed is allowable as valid tracking). + /// + /// The reason for storing this as a time value (rather than a bool) is to correctly handle rewind scenarios. + /// + private double? timeToAcceptAnyKeyAfter; + + /// + /// The actions that were pressed in the previous frame. + /// + private readonly List lastPressedActions = new List(); + + private Vector2? screenSpaceMousePosition; + private readonly DrawableSlider slider; + + public SliderInputManager(DrawableSlider slider) + { + this.slider = slider; + } + + /// + /// This component handles all input of the slider, so it should receive input no matter the position. + /// + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + + protected override bool OnMouseMove(MouseMoveEvent e) + { + screenSpaceMousePosition = e.ScreenSpaceMousePosition; + return base.OnMouseMove(e); + } + + protected override void Update() + { + base.Update(); + updateTracking(isMouseInFollowArea(Tracking)); + } + + public void PostProcessHeadJudgement(DrawableSliderHead head) + { + if (!head.Judged || !head.Result.IsHit) + return; + + if (!isMouseInFollowArea(true)) + return; + + // When the head is hit and the mouse is in the expanded follow area, force a hit on every nested hitobject + // from the start of the slider that is within follow-radius units from the head. + + bool forceMiss = false; + + foreach (var nested in slider.NestedHitObjects.OfType()) + { + // Skip nested objects that are already judged. + if (nested.Judged) + continue; + + // Stop the process when a nested object is reached that can't be hit before the current time. + if (nested.HitObject.StartTime > Time.Current) + break; + + float radius = getFollowRadius(true); + double objectProgress = Math.Clamp((nested.HitObject.StartTime - slider.HitObject.StartTime) / slider.HitObject.Duration, 0, 1); + Vector2 objectPosition = slider.HitObject.CurvePositionAt(objectProgress); + + // When the first nested object that is further than follow-radius units away from the start of the slider is reached, + // forcefully miss all other nested objects that would otherwise be valid to be hit by this process. + if (forceMiss || objectPosition.LengthSquared > radius * radius) + { + nested.MissForcefully(); + forceMiss = true; + } + else + nested.HitForcefully(); + } + + // Enable tracking, since the mouse is within the follow area (if it were expanded). + updateTracking(true); + } + + public void TryJudgeNestedObject(DrawableOsuHitObject nestedObject, double timeOffset) + { + switch (nestedObject) + { + case DrawableSliderRepeat: + case DrawableSliderTick: + if (timeOffset < 0) + return; + + break; + + case DrawableSliderTail: + if (timeOffset < SliderEventGenerator.TAIL_LENIENCY) + return; + + // Ensure the tail can only activate after all previous ticks/repeats already have. + // + // This covers the edge case where the lenience may allow the tail to activate before + // the last tick, changing ordering of score/combo awarding. + var lastTick = slider.NestedHitObjects.LastOrDefault(o => o.HitObject is SliderTick || o.HitObject is SliderRepeat); + if (lastTick?.Judged == false) + return; + + break; + + default: + return; + } + + if (!slider.HeadCircle.Judged) + { + if (slider.Tracking.Value) + { + // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. + slider.HeadCircle.MissForcefully(); + } + else + { + // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. + return; + } + } + + if (slider.Tracking.Value) + nestedObject.HitForcefully(); + else + nestedObject.MissForcefully(); + } + + /// + /// Whether the mouse is currently in the follow area. + /// + /// Whether to test against the maximum area of the follow circle. + private bool isMouseInFollowArea(bool expanded) + { + if (screenSpaceMousePosition is not Vector2 pos) + return false; + + float radius = getFollowRadius(expanded); + + double followProgress = Math.Clamp((Time.Current - slider.HitObject.StartTime) / slider.HitObject.Duration, 0, 1); + Vector2 followCirclePosition = slider.HitObject.CurvePositionAt(followProgress); + Vector2 mousePositionInSlider = slider.ToLocalSpace(pos) - slider.OriginPosition; + + return (mousePositionInSlider - followCirclePosition).LengthSquared <= radius * radius; + } + + /// + /// Retrieves the radius of the follow area. + /// + /// Whether to return the maximum area of the follow circle. + private float getFollowRadius(bool expanded) + { + float radius = (float)slider.HitObject.Radius; + + if (expanded) + radius *= DrawableSliderBall.FOLLOW_AREA; + + return radius; + } + + /// + /// Updates the tracking state. + /// + /// Whether the current mouse position is valid to begin tracking. + private void updateTracking(bool isValidTrackingPosition) + { + // from the point at which the head circle is hit, this will be non-null. + // it may be null if the head circle was missed. + OsuAction? headCircleHitAction = getInitialHitAction(); + + if (headCircleHitAction == null) + timeToAcceptAnyKeyAfter = null; + + var actions = slider.OsuActionInputManager?.PressedActions; + + // if the head circle was hit with a specific key, tracking should only occur while that key is pressed. + if (headCircleHitAction != null && timeToAcceptAnyKeyAfter == null) + { + var otherKey = headCircleHitAction == OsuAction.RightButton ? OsuAction.LeftButton : OsuAction.RightButton; + + // we can start accepting any key once all other keys have been released in the previous frame. + if (!lastPressedActions.Contains(otherKey)) + timeToAcceptAnyKeyAfter = Time.Current; + } + + Tracking = + // even in an edge case where current time has exceeded the slider's time, we may not have finished judging. + // we don't want to potentially update from Tracking=true to Tracking=false at this point. + (!slider.AllJudged || Time.Current <= slider.HitObject.GetEndTime()) + // in valid position range + && isValidTrackingPosition + // valid action + && (actions?.Any(isValidTrackingAction) ?? false); + + lastPressedActions.Clear(); + if (actions != null) + lastPressedActions.AddRange(actions); + } + + private OsuAction? getInitialHitAction() => slider.HeadCircle?.HitAction; + + /// + /// Check whether a given user input is a valid tracking action. + /// + private bool isValidTrackingAction(OsuAction action) + { + OsuAction? hitAction = getInitialHitAction(); + + // if the head circle was hit, we may not yet be allowed to accept any key, so we must use the initial hit action. + if (hitAction.HasValue && (!timeToAcceptAnyKeyAfter.HasValue || Time.Current <= timeToAcceptAnyKeyAfter.Value)) + return action == hitAction; + + return action == OsuAction.LeftButton || action == OsuAction.RightButton; + } + } +} From 3b8a73bf2c5ac25224ae2fc88967b58f98cb07a7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 16:13:34 +0900 Subject: [PATCH 176/567] Refactor test --- .../TestSceneSliderLateHitJudgement.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 4f32a6fe9f..04bdd0094d 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -296,7 +296,7 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertHeadJudgement(HitResult result) { AddAssert( - "check head result", + $"head = {result}", () => judgementResults.SingleOrDefault(r => r.HitObject is SliderHeadCircle)?.Type, () => Is.EqualTo(result)); } @@ -304,7 +304,7 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertTickJudgement(int index, HitResult result) { AddAssert( - $"check tick({index}) result", + $"tick({index}) = {result}", () => judgementResults.Where(r => r.HitObject is SliderTick).ElementAtOrDefault(index)?.Type, () => Is.EqualTo(result)); } @@ -312,7 +312,7 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertAllTickJudgements(HitResult result) { AddAssert( - "check all tick results", + $"all ticks = {result}", () => judgementResults.Where(r => r.HitObject is SliderTick).Select(t => t.Type), () => Has.All.EqualTo(result)); } @@ -320,7 +320,7 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertRepeatJudgement(HitResult result) { AddAssert( - "check repeat result", + $"repeat = {result}", () => judgementResults.SingleOrDefault(r => r.HitObject is SliderRepeat)?.Type, () => Is.EqualTo(result)); } @@ -328,7 +328,7 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertTailJudgement(HitResult result) { AddAssert( - "check tail result", + $"tail = {result}", () => judgementResults.SingleOrDefault(r => r.HitObject is SliderTailCircle)?.Type, () => Is.EqualTo(result)); } @@ -336,18 +336,11 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertSliderJudgement(HitResult result) { AddAssert( - "check slider result", + $"slider = {result}", () => judgementResults.SingleOrDefault(r => r.HitObject is Slider)?.Type, () => Is.EqualTo(result)); } - private Vector2 computePositionFromTime(double time) - { - Vector2 dist = slider_end_position - slider_start_position; - double t = (time - time_slider_start) / (time_slider_end - time_slider_start); - return slider_start_position + dist * (float)t; - } - private void performTest(List frames, Action? adjustSliderFunc = null, bool classic = false) { Slider slider = new Slider From 12210017e44341e5378edc2af86553addeae4eab Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 17:05:14 +0900 Subject: [PATCH 177/567] Use the cursor position to test nested object validity --- .../TestSceneSliderLateHitJudgement.cs | 42 ++++++++++++++++--- .../Objects/Drawables/SliderInputManager.cs | 14 +++++-- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 04bdd0094d..80e4b04178 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -184,7 +184,7 @@ namespace osu.Game.Rulesets.Osu.Tests /// /// If the head circle is hit late and the mouse is in range of the follow circle, - /// then all the repeats that the mouse has passed through should be hit. + /// then all the repeats that the follow circle has passed through should be hit. /// [Test] public void TestHitLateInRangeHitsRepeat() @@ -212,8 +212,8 @@ namespace osu.Game.Rulesets.Osu.Tests /// /// If the head circle is hit and the mouse is in range of the follow circle, - /// then only the ticks that were in range of the follow circle at the head should be hit. - /// If any hitobject was outside the follow range, ALL hitobjects after that point should be missed. + /// then only the ticks that are in range of the cursor position should be hit. + /// If any hitobject does not meet this criteria, ALL hitobjects after that one should be missed. /// [Test] public void TestHitLateInRangeDoesNotHitAfterAnyOutOfRange() @@ -257,7 +257,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertTickJudgement(11, HitResult.LargeTickMiss); assertTickJudgement(12, HitResult.LargeTickMiss); - // And the tail should be hit because of its leniency. + // This particular test actually starts tracking the slider just before the end, so the tail should be hit because of its leniency. assertTailJudgement(HitResult.LargeTickHit); assertSliderJudgement(HitResult.IgnoreHit); @@ -265,10 +265,10 @@ namespace osu.Game.Rulesets.Osu.Tests /// /// If the head circle is hit and the mouse is in range of the follow circle, - /// then a tick outside the range of the follow circle from the head should not be hit. + /// then a tick not within the follow radius from the cursor position should not be hit. /// [Test] - public void TestHitLateInRangeDoesNotHitOutOfRange() + public void TestHitLateInRangeDoesNotHitOutOfRangeTick() { performTest(new List { @@ -293,6 +293,36 @@ namespace osu.Game.Rulesets.Osu.Tests assertSliderJudgement(HitResult.IgnoreHit); } + /// + /// If the head circle is hit and the mouse is in range of the follow circle, + /// then a tick not within the follow radius from the cursor position should not be hit. + /// + [Test] + public void TestHitLateWithEdgeHit() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position - new Vector2(20), OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position - new Vector2(20), OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.PERFECT_CURVE, new[] + { + Vector2.Zero, + new Vector2(50, 50), + new Vector2(20, 0), + }); + + s.TickDistanceMultiplier = 0.35f; + s.SliderVelocityMultiplier = 4; + }); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); + } + private void assertHeadJudgement(HitResult result) { AddAssert( diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index a5d7bdc7db..9feeb6ef14 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input; @@ -75,8 +76,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!isMouseInFollowArea(true)) return; + Debug.Assert(screenSpaceMousePosition != null); + + Vector2 mousePositionInSlider = slider.ToLocalSpace(screenSpaceMousePosition.Value) - slider.OriginPosition; + // When the head is hit and the mouse is in the expanded follow area, force a hit on every nested hitobject - // from the start of the slider that is within follow-radius units from the head. + // from the start of the slider that is within the follow area. bool forceMiss = false; @@ -94,9 +99,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables double objectProgress = Math.Clamp((nested.HitObject.StartTime - slider.HitObject.StartTime) / slider.HitObject.Duration, 0, 1); Vector2 objectPosition = slider.HitObject.CurvePositionAt(objectProgress); - // When the first nested object that is further than follow-radius units away from the start of the slider is reached, - // forcefully miss all other nested objects that would otherwise be valid to be hit by this process. - if (forceMiss || objectPosition.LengthSquared > radius * radius) + // When the first nested object that is further outside the follow area is reached, + // forcefully miss all other nested objects that would otherwise be valid to be hit. + // This covers a case of a slider overlapping itself that requires tracking to a tick on an outer edge. + if (forceMiss || (objectPosition - mousePositionInSlider).LengthSquared > radius * radius) { nested.MissForcefully(); forceMiss = true; From 9ae3be817fa77dd142b5292e3d361953319efe07 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 17:40:36 +0900 Subject: [PATCH 178/567] Add some text to the test scene showing hits/misses --- .../TestSceneSliderLateHitJudgement.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 80e4b04178..2a3655eccd 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -5,12 +5,17 @@ using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Graphics; using osu.Framework.Screens; +using osu.Framework.Testing; using osu.Game.Beatmaps; +using osu.Game.Graphics.Sprites; using osu.Game.Replays; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Replays; using osu.Game.Rulesets.Replays; @@ -410,7 +415,21 @@ namespace osu.Game.Rulesets.Osu.Tests { p.ScoreProcessor.NewJudgement += result => { - if (currentPlayer == p) judgementResults.Add(result); + if (currentPlayer == p) + judgementResults.Add(result); + + DrawableHitObject drawableObj = this.ChildrenOfType().Single(h => h.HitObject == result.HitObject); + + var text = new OsuSpriteText + { + Origin = Anchor.Centre, + Position = Content.ToLocalSpace(drawableObj.ToScreenSpace(drawableObj.OriginPosition)) - new Vector2(0, 20), + Text = result.IsHit ? "hit" : "miss" + }; + + Add(text); + + text.FadeOutFromOne(1000).Expire(); }; }; From 9e3b1dbb5926684b151066fed1df14e25cbb26b2 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 17:41:22 +0900 Subject: [PATCH 179/567] Fix CI inspection --- .../Sections/Maintenance/StableDirectorySelectScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs index 73ac6efcd8..17f09ade4e 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs @@ -46,6 +46,6 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance } private bool shouldUseParentDirectory(DirectoryInfo? info) - => info?.Parent != null && (info?.Name == "Songs" || info?.Name == "Skins"); + => info?.Parent != null && (info.Name == "Songs" || info.Name == "Skins"); } } From 456916f680c608acbd24ed3953e97e630a656551 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 18:02:27 +0900 Subject: [PATCH 180/567] Fix column sizing exceeding screen width on tablets --- .../Argon/ManiaArgonSkinTransformer.cs | 10 +---- osu.Game.Rulesets.Mania/UI/ColumnFlow.cs | 45 +++++++++++++++---- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs index ca7f84cb4d..7f6540e7b5 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using osu.Framework; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps; @@ -100,16 +99,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon return SkinUtils.As(new Bindable(30)); case LegacyManiaSkinConfigurationLookups.ColumnWidth: - - float width; - bool isSpecialColumn = stage.IsSpecialColumn(columnIndex); - // Best effort until we have better mobile support. - if (RuntimeInfo.IsMobile) - width = 170 * Math.Min(1, 7f / beatmap.TotalColumns) * (isSpecialColumn ? 1.8f : 1); - else - width = 60 * (isSpecialColumn ? 2 : 1); + float width = 60 * (isSpecialColumn ? 2 : 1); return SkinUtils.As(new Bindable(width)); diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index 0bc0bf4caf..44c318a2c5 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -3,14 +3,17 @@ #nullable disable +using System; using System.Collections.Generic; using System.Linq; +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Skinning; using osu.Game.Skinning; +using osuTK; namespace osu.Game.Rulesets.Mania.UI { @@ -60,6 +63,12 @@ namespace osu.Game.Rulesets.Mania.UI onSkinChanged(); } + protected override void LoadComplete() + { + base.LoadComplete(); + updateMobileSizing(); + } + private void onSkinChanged() { for (int i = 0; i < stageDefinition.Columns; i++) @@ -77,12 +86,15 @@ namespace osu.Game.Rulesets.Mania.UI new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ColumnWidth, i)) ?.Value; - if (width == null) - // only used by default skin (legacy skins get defaults set in LegacyManiaSkinConfiguration) - columns[i].Width = stageDefinition.IsSpecialColumn(i) ? Column.SPECIAL_COLUMN_WIDTH : Column.COLUMN_WIDTH; - else - columns[i].Width = width.Value; + bool isSpecialColumn = stageDefinition.IsSpecialColumn(i); + + // only used by default skin (legacy skins get defaults set in LegacyManiaSkinConfiguration) + width ??= isSpecialColumn ? Column.SPECIAL_COLUMN_WIDTH : Column.COLUMN_WIDTH; + + columns[i].Width = width.Value; } + + updateMobileSizing(); } /// @@ -92,10 +104,27 @@ namespace osu.Game.Rulesets.Mania.UI /// The content. public void SetContentForColumn(int column, TContent content) => columns[column].Child = content; - public new MarginPadding Padding + private void updateMobileSizing() { - get => base.Padding; - set => base.Padding = value; + if (!IsLoaded) + return; + + for (int i = 0; i < stageDefinition.Columns; i++) + { + // GridContainer+CellContainer containing this stage (gets split up for dual stages). + Vector2 containingCell = this.FindClosestParent().Parent!.DrawSize; + + // Best effort until we have better mobile support. + if (RuntimeInfo.IsMobile) + { + // These numbers are based on mobile phones, aspect ~1.92. + float mobileAdjust = 2.83f * Math.Min(1, 7f / stageDefinition.Columns); + // We should scale it back for cases like tablets which aren't so extreme. + mobileAdjust *= (containingCell.X / containingCell.Y) / 1.92f; + + columns[i].Width *= mobileAdjust; + } + } } protected override void Dispose(bool isDisposing) From 4ad312ef5b8bd4ce392f1a5cbb738da5cb991389 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 19:12:45 +0900 Subject: [PATCH 181/567] Update xmldoc for `LegacyComboIncrease` --- osu.Game/Rulesets/Scoring/HitResult.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index 6380b73558..9705421571 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -139,9 +139,12 @@ namespace osu.Game.Rulesets.Scoring /// /// A special result used as a padding value for legacy rulesets. It is a hit type and affects combo, but does not affect the base score (does not affect accuracy). + /// + /// DO NOT USE FOR ANYTHING EVER. /// /// - /// DO NOT USE. + /// This is used when dealing with legacy scores, which historically only have counts stored for 300/100/50/miss. + /// For these scores, we pad the hit statistics with `LegacyComboIncrease` to meet the correct max combo for the score. /// [EnumMember(Value = "legacy_combo_increase")] [Order(99)] From eb5a8284f1200e80a8e9b616e68b8a056c8a84e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 19:15:25 +0900 Subject: [PATCH 182/567] Move mobile check earlier to avoid unnecessary looping --- osu.Game.Rulesets.Mania/UI/ColumnFlow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index 44c318a2c5..f28619fb64 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -106,7 +106,7 @@ namespace osu.Game.Rulesets.Mania.UI private void updateMobileSizing() { - if (!IsLoaded) + if (!IsLoaded || !RuntimeInfo.IsMobile) return; for (int i = 0; i < stageDefinition.Columns; i++) From e8f3e52c9e0bccbe6f67f4904e4db0a45bd29f4b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 19:17:48 +0900 Subject: [PATCH 183/567] Fix nullref failure in tests --- osu.Game.Rulesets.Mania/UI/ColumnFlow.cs | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index f28619fb64..3ecd14ce81 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -109,22 +109,23 @@ namespace osu.Game.Rulesets.Mania.UI if (!IsLoaded || !RuntimeInfo.IsMobile) return; + // GridContainer+CellContainer containing this stage (gets split up for dual stages). + Vector2? containingCell = this.FindClosestParent()?.Parent?.DrawSize; + + // Will be null in tests. + if (containingCell == null) + return; + + float aspectRatio = containingCell.Value.X / containingCell.Value.Y; + + // These numbers are based on mobile phones, aspect ~1.92. + float mobileAdjust = 2.83f * Math.Min(1, 7f / stageDefinition.Columns); + // We should scale it back for cases like tablets which aren't so extreme. + mobileAdjust *= aspectRatio / 1.92f; + + // Best effort until we have better mobile support. for (int i = 0; i < stageDefinition.Columns; i++) - { - // GridContainer+CellContainer containing this stage (gets split up for dual stages). - Vector2 containingCell = this.FindClosestParent().Parent!.DrawSize; - - // Best effort until we have better mobile support. - if (RuntimeInfo.IsMobile) - { - // These numbers are based on mobile phones, aspect ~1.92. - float mobileAdjust = 2.83f * Math.Min(1, 7f / stageDefinition.Columns); - // We should scale it back for cases like tablets which aren't so extreme. - mobileAdjust *= (containingCell.X / containingCell.Y) / 1.92f; - - columns[i].Width *= mobileAdjust; - } - } + columns[i].Width *= mobileAdjust; } protected override void Dispose(bool isDisposing) From 94f63d604401ad7b2a9153da1b944d6986045e51 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 15 Dec 2023 19:18:53 +0900 Subject: [PATCH 184/567] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b0ab8e445c..807e3ede2a 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -37,7 +37,7 @@ - + From b384c9f9388f10ca2447a47e5b0fa75000e75f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 15 Dec 2023 15:42:19 +0100 Subject: [PATCH 185/567] Extract common method for determining stable import usability of directory --- osu.Game/Database/LegacyImportManager.cs | 46 +++++++++++++++++++ .../FirstRunSetup/ScreenImportFromStable.cs | 4 +- .../StableDirectorySelectScreen.cs | 26 +++++------ 3 files changed, 59 insertions(+), 17 deletions(-) diff --git a/osu.Game/Database/LegacyImportManager.cs b/osu.Game/Database/LegacyImportManager.cs index 20738f859e..7e1641d16f 100644 --- a/osu.Game/Database/LegacyImportManager.cs +++ b/osu.Game/Database/LegacyImportManager.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; using osu.Framework; @@ -54,6 +57,49 @@ namespace osu.Game.Database public void UpdateStorage(string stablePath) => cachedStorage = new StableStorage(stablePath, gameHost as DesktopGameHost); + /// + /// Checks whether a valid location to run a stable import from can be determined starting from the supplied . + /// + /// The directory to check for stable import eligibility. + /// + /// If the return value is , + /// this parameter will contain the to use as the root directory for importing. + /// + public bool IsUsableForStableImport(DirectoryInfo? directory, [NotNullWhen(true)] out DirectoryInfo? stableRoot) + { + if (directory == null) + { + stableRoot = null; + return false; + } + + // A full stable installation will have a configuration file present. + // This is the best case scenario, as it may contain a custom beatmap directory we need to traverse to. + if (directory.GetFiles(@"osu!.*.cfg").Any()) + { + stableRoot = directory; + return true; + } + + // The user may only have their songs or skins folders left. + // We still want to allow them to import based on this. + if (directory.GetDirectories(@"Songs").Any() || directory.GetDirectories(@"Skins").Any()) + { + stableRoot = directory; + return true; + } + + // The user may have traversed *inside* their songs or skins folders. + if (directory.Parent != null && (directory.Name == @"Songs" || directory.Name == @"Skins")) + { + stableRoot = directory.Parent; + return true; + } + + stableRoot = null; + return false; + } + public bool CheckSongsFolderHardLinkAvailability() { var stableStorage = GetCurrentStableStorage(); diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index 23f3b3e1af..185a47c371 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -269,11 +269,11 @@ namespace osu.Game.Overlays.FirstRunSetup if (directory.OldValue?.FullName == directory.NewValue.FullName) return; - if (directory.NewValue?.GetFiles(@"osu!.*.cfg").Any() ?? false) + if (legacyImportManager.IsUsableForStableImport(directory.NewValue, out var stableRoot)) { this.HidePopover(); - string path = directory.NewValue.FullName; + string path = stableRoot.FullName; legacyImportManager.UpdateStorage(path); Current.Value = path; diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs index 17f09ade4e..3f12b9c0df 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/StableDirectorySelectScreen.cs @@ -1,11 +1,13 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.IO; -using System.Linq; using System.Threading.Tasks; +using osu.Framework.Allocation; using osu.Framework.Localisation; using osu.Framework.Screens; +using osu.Game.Database; namespace osu.Game.Overlays.Settings.Sections.Maintenance { @@ -13,18 +15,12 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance { private readonly TaskCompletionSource taskCompletionSource; + [Resolved] + private LegacyImportManager legacyImportManager { get; set; } = null!; + protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled; - protected override bool IsValidDirectory(DirectoryInfo? info) => - // A full stable installation will have a configuration file present. - // This is the best case scenario, as it may contain a custom beatmap directory we need to traverse to. - info?.GetFiles("osu!.*.cfg").Any() == true || - // The user may only have their songs or skins folders left. - // We still want to allow them to import based on this. - info?.GetDirectories("Songs").Any() == true || - info?.GetDirectories("Skins").Any() == true || - // The user may have traverse *inside* their songs or skins folders. - shouldUseParentDirectory(info); + protected override bool IsValidDirectory(DirectoryInfo? info) => legacyImportManager.IsUsableForStableImport(info, out _); public override LocalisableString HeaderText => "Please select your osu!stable install location"; @@ -35,7 +31,10 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance protected override void OnSelection(DirectoryInfo directory) { - taskCompletionSource.TrySetResult(shouldUseParentDirectory(directory) ? directory.Parent!.FullName : directory.FullName); + if (!legacyImportManager.IsUsableForStableImport(directory, out var stableRoot)) + throw new InvalidOperationException($@"{nameof(OnSelection)} was called on an invalid directory. This should never happen."); + + taskCompletionSource.TrySetResult(stableRoot.FullName); this.Exit(); } @@ -44,8 +43,5 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance taskCompletionSource.TrySetCanceled(); return base.OnExiting(e); } - - private bool shouldUseParentDirectory(DirectoryInfo? info) - => info?.Parent != null && (info.Name == "Songs" || info.Name == "Skins"); } } From acb7016156c7dd3411ed1d70154eafaab970e57e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Dec 2023 23:53:26 +0900 Subject: [PATCH 186/567] Remove unused using --- osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 2a3655eccd..d12020db59 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -15,7 +15,6 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; -using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Replays; using osu.Game.Rulesets.Replays; From 91f4123aa79b05c0a3e56a4025b54f993e001b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 15 Dec 2023 16:00:29 +0100 Subject: [PATCH 187/567] Fix first run locator stable locator directory desyncing between display & popover --- .../FirstRunSetup/ScreenImportFromStable.cs | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs index 185a47c371..24ac5e72e8 100644 --- a/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs +++ b/osu.Game/Overlays/FirstRunSetup/ScreenImportFromStable.cs @@ -244,6 +244,8 @@ namespace osu.Game.Overlays.FirstRunSetup [Resolved(canBeNull: true)] // Can't really be null but required to handle potential of disposal before DI completes. private OsuGameBase? game { get; set; } + private bool changingDirectory; + protected override void LoadComplete() { base.LoadComplete(); @@ -259,24 +261,37 @@ namespace osu.Game.Overlays.FirstRunSetup private void onDirectorySelected(ValueChangedEvent directory) { - if (directory.NewValue == null) - { - Current.Value = string.Empty; + if (changingDirectory) return; + + try + { + changingDirectory = true; + + if (directory.NewValue == null) + { + Current.Value = string.Empty; + return; + } + + // DirectorySelectors can trigger a noop value changed, but `DirectoryInfo` equality doesn't catch this. + if (directory.OldValue?.FullName == directory.NewValue.FullName) + return; + + if (legacyImportManager.IsUsableForStableImport(directory.NewValue, out var stableRoot)) + { + this.HidePopover(); + + string path = stableRoot.FullName; + + legacyImportManager.UpdateStorage(path); + Current.Value = path; + currentDirectory.Value = stableRoot; + } } - - // DirectorySelectors can trigger a noop value changed, but `DirectoryInfo` equality doesn't catch this. - if (directory.OldValue?.FullName == directory.NewValue.FullName) - return; - - if (legacyImportManager.IsUsableForStableImport(directory.NewValue, out var stableRoot)) + finally { - this.HidePopover(); - - string path = stableRoot.FullName; - - legacyImportManager.UpdateStorage(path); - Current.Value = path; + changingDirectory = false; } } From 432ce275c4dad16cc1ad848bfbe4900445d0c8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 15 Dec 2023 20:43:18 +0100 Subject: [PATCH 188/567] Explain magic constants better --- osu.Game.Rulesets.Mania/UI/ColumnFlow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs index 3ecd14ce81..8734f8ac8a 100644 --- a/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs +++ b/osu.Game.Rulesets.Mania/UI/ColumnFlow.cs @@ -118,8 +118,9 @@ namespace osu.Game.Rulesets.Mania.UI float aspectRatio = containingCell.Value.X / containingCell.Value.Y; - // These numbers are based on mobile phones, aspect ~1.92. + // 2.83 is a mostly arbitrary scale-up (170 / 60, based on original implementation for argon) float mobileAdjust = 2.83f * Math.Min(1, 7f / stageDefinition.Columns); + // 1.92 is a "reference" mobile screen aspect ratio for phones. // We should scale it back for cases like tablets which aren't so extreme. mobileAdjust *= aspectRatio / 1.92f; From f07771f59b19c5ac3c9d9709bb32d3baf6fe4138 Mon Sep 17 00:00:00 2001 From: clayton Date: Fri, 15 Dec 2023 22:41:55 -0800 Subject: [PATCH 189/567] Fix fallback column colors for legacy split stage mania skins --- .../Skinning/Legacy/LegacyManiaColumnElement.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs index 7e3fb0438c..3a69142b3c 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Legacy/LegacyManiaColumnElement.cs @@ -34,7 +34,9 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy FallbackColumnIndex = "S"; else { - int distanceToEdge = Math.Min(Column.Index, (stage.Columns - 1) - Column.Index); + // Account for cases like dual-stage (assume that all stages have the same column count for now). + int columnInStage = Column.Index % stage.Columns; + int distanceToEdge = Math.Min(columnInStage, (stage.Columns - 1) - columnInStage); FallbackColumnIndex = distanceToEdge % 2 == 0 ? "1" : "2"; } } From d7aca2f64143d75d11fb09f2acfbb10709396206 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 19:27:03 +0900 Subject: [PATCH 190/567] Add IApplicableHealthProcessor --- .../Mods/IApplicableHealthProcessor.cs | 18 ++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs diff --git a/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs b/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs new file mode 100644 index 0000000000..e16faa9595 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs @@ -0,0 +1,18 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// Interface for a that provides its own health processor. + /// + public interface IApplicableHealthProcessor + { + /// + /// Creates the . + /// + HealthProcessor CreateHealthProcessor(double drainStartTime); + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 1c97efcff7..cc08079d88 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -227,7 +227,8 @@ namespace osu.Game.Screens.Play dependencies.CacheAs(ScoreProcessor); - HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime); + HealthProcessor = gameplayMods.OfType().FirstOrDefault()?.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime); + HealthProcessor ??= ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime); HealthProcessor.ApplyBeatmap(playableBeatmap); dependencies.CacheAs(HealthProcessor); From 4b9aefa6f2d7b7ad5a2fdc31685a6a900c55d444 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 19:33:02 +0900 Subject: [PATCH 191/567] Change osu ruleset to use new HP algorithm by default --- .../TestSceneOsuHealthProcessor.cs | 8 ++++---- osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs | 7 ++++++- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 -- ...{OsuHealthProcessor.cs => OsuLegacyHealthProcessor.cs} | 4 ++-- osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) rename osu.Game.Rulesets.Osu/Scoring/{OsuHealthProcessor.cs => OsuLegacyHealthProcessor.cs} (95%) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs index 16f28c0212..83c818c20d 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Tests [Test] public void TestNoBreak() { - OsuHealthProcessor hp = new OsuHealthProcessor(-1000); + OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000); hp.ApplyBeatmap(new Beatmap { HitObjects = @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Tests [Test] public void TestSingleBreak() { - OsuHealthProcessor hp = new OsuHealthProcessor(-1000); + OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000); hp.ApplyBeatmap(new Beatmap { HitObjects = @@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.Tests [Test] public void TestOverlappingBreak() { - OsuHealthProcessor hp = new OsuHealthProcessor(-1000); + OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000); hp.ApplyBeatmap(new Beatmap { HitObjects = @@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Tests [Test] public void TestSequentialBreak() { - OsuHealthProcessor hp = new OsuHealthProcessor(-1000); + OsuLegacyHealthProcessor hp = new OsuLegacyHealthProcessor(-1000); hp.ApplyBeatmap(new Beatmap { HitObjects = diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs b/osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs index f20f95b384..10d7af5e58 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModClassic.cs @@ -18,7 +18,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Osu.Mods { - public class OsuModClassic : ModClassic, IApplicableToHitObject, IApplicableToDrawableHitObject, IApplicableToDrawableRuleset + public class OsuModClassic : ModClassic, IApplicableToHitObject, IApplicableToDrawableHitObject, IApplicableToDrawableRuleset, IApplicableHealthProcessor { public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModStrictTracking)).ToArray(); @@ -34,6 +34,9 @@ namespace osu.Game.Rulesets.Osu.Mods [SettingSource("Fade out hit circles earlier", "Make hit circles fade out into a miss, rather than after it.")] public Bindable FadeHitCircleEarly { get; } = new Bindable(true); + [SettingSource("Classic health", "More closely resembles the original HP drain mechanics.")] + public Bindable ClassicHealth { get; } = new Bindable(true); + private bool usingHiddenFading; public void ApplyToHitObject(HitObject hitObject) @@ -115,5 +118,7 @@ namespace osu.Game.Rulesets.Osu.Mods } }; } + + public HealthProcessor? CreateHealthProcessor(double drainStartTime) => ClassicHealth.Value ? new OsuLegacyHealthProcessor(drainStartTime) : null; } } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 35cbfa3790..e53f20277b 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -48,8 +48,6 @@ namespace osu.Game.Rulesets.Osu public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(); - public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new OsuHealthProcessor(drainStartTime); - public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap, this); public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap); diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs similarity index 95% rename from osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs rename to osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs index 7025a7be65..e383e82b86 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs @@ -10,9 +10,9 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Scoring { - public partial class OsuHealthProcessor : LegacyDrainingHealthProcessor + public partial class OsuLegacyHealthProcessor : LegacyDrainingHealthProcessor { - public OsuHealthProcessor(double drainStartTime) + public OsuLegacyHealthProcessor(double drainStartTime) : base(drainStartTime) { } diff --git a/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs b/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs index e16faa9595..be46828069 100644 --- a/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs +++ b/osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs @@ -11,8 +11,8 @@ namespace osu.Game.Rulesets.Mods public interface IApplicableHealthProcessor { /// - /// Creates the . + /// Creates the . May be null to use the ruleset default. /// - HealthProcessor CreateHealthProcessor(double drainStartTime); + HealthProcessor? CreateHealthProcessor(double drainStartTime); } } From 10610d3387acd1863c406723d20e9557459def66 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 19:33:38 +0900 Subject: [PATCH 192/567] Rename test scene --- ...uHealthProcessor.cs => TestSceneOsuLegacyHealthProcessor.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename osu.Game.Rulesets.Osu.Tests/{TestSceneOsuHealthProcessor.cs => TestSceneOsuLegacyHealthProcessor.cs} (98%) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneOsuLegacyHealthProcessor.cs similarity index 98% rename from osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs rename to osu.Game.Rulesets.Osu.Tests/TestSceneOsuLegacyHealthProcessor.cs index 83c818c20d..a7ae06a9ce 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneOsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneOsuLegacyHealthProcessor.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.Osu.Scoring; namespace osu.Game.Rulesets.Osu.Tests { [TestFixture] - public class TestSceneOsuHealthProcessor + public class TestSceneOsuLegacyHealthProcessor { [Test] public void TestNoBreak() From f77884b62f0a8c2b8b058c9e1180c21bd25cbdba Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 19:57:48 +0900 Subject: [PATCH 193/567] Only hit passed-through ticks if none were missed --- .../TestSceneSliderLateHitJudgement.cs | 23 ++------------- .../Objects/Drawables/SliderInputManager.cs | 29 ++++++++++++++----- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index d12020db59..54140e4d49 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -220,7 +220,7 @@ namespace osu.Game.Rulesets.Osu.Tests /// If any hitobject does not meet this criteria, ALL hitobjects after that one should be missed. /// [Test] - public void TestHitLateInRangeDoesNotHitAfterAnyOutOfRange() + public void TestHitLateDoesNotHitTicksIfAnyOutOfRange() { performTest(new List { @@ -241,25 +241,8 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); - // The first few ticks that are in the follow range of the head should be hit. - assertTickJudgement(0, HitResult.LargeTickHit); // This tick is hidden under the slider head :( - assertTickJudgement(1, HitResult.LargeTickHit); - assertTickJudgement(2, HitResult.LargeTickHit); - - // Every other tick should be missed - assertTickJudgement(3, HitResult.LargeTickMiss); - assertTickJudgement(4, HitResult.LargeTickMiss); - assertTickJudgement(5, HitResult.LargeTickMiss); - assertTickJudgement(6, HitResult.LargeTickMiss); - assertTickJudgement(7, HitResult.LargeTickMiss); - assertTickJudgement(8, HitResult.LargeTickMiss); - assertTickJudgement(9, HitResult.LargeTickMiss); - assertTickJudgement(10, HitResult.LargeTickMiss); - - // In particular, these three are in the follow range of the head, but should not be hit - // because the slider was at some point outside the follow range of the head. - assertTickJudgement(11, HitResult.LargeTickMiss); - assertTickJudgement(12, HitResult.LargeTickMiss); + // At least one tick was out of range, so they all should be missed. + assertAllTickJudgements(HitResult.LargeTickMiss); // This particular test actually starts tracking the slider just before the end, so the tail should be hit because of its leniency. assertTailJudgement(HitResult.LargeTickHit); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index 9feeb6ef14..e71f4fcd48 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -80,10 +80,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Vector2 mousePositionInSlider = slider.ToLocalSpace(screenSpaceMousePosition.Value) - slider.OriginPosition; - // When the head is hit and the mouse is in the expanded follow area, force a hit on every nested hitobject - // from the start of the slider that is within the follow area. + // When the head is hit late: + // - If the cursor has at all times been within range of the expanded follow area, hit all nested objects that have been passed through. + // - If the cursor has at some point left the expanded follow area, miss those nested objects instead. - bool forceMiss = false; + bool allTicksInRange = true; foreach (var nested in slider.NestedHitObjects.OfType()) { @@ -102,13 +103,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables // When the first nested object that is further outside the follow area is reached, // forcefully miss all other nested objects that would otherwise be valid to be hit. // This covers a case of a slider overlapping itself that requires tracking to a tick on an outer edge. - if (forceMiss || (objectPosition - mousePositionInSlider).LengthSquared > radius * radius) + if ((objectPosition - mousePositionInSlider).LengthSquared > radius * radius) { - nested.MissForcefully(); - forceMiss = true; + allTicksInRange = false; + break; } - else + } + + foreach (var nested in slider.NestedHitObjects.OfType()) + { + // Skip nested objects that are already judged. + if (nested.Judged) + continue; + + // Stop the process when a nested object is reached that can't be hit before the current time. + if (nested.HitObject.StartTime > Time.Current) + break; + + if (allTicksInRange) nested.HitForcefully(); + else + nested.MissForcefully(); } // Enable tracking, since the mouse is within the follow area (if it were expanded). From fbe48d7be84874d902d5559f723379bc5c9c395a Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 20:11:15 +0900 Subject: [PATCH 194/567] Fix tail being missed too early --- osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index e71f4fcd48..996a477153 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (slider.Tracking.Value) nestedObject.HitForcefully(); - else + else if (timeOffset >= 0) nestedObject.MissForcefully(); } From 9b02bd712b19b34bd8d3813ce9a2c700063267c7 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 20:12:02 +0900 Subject: [PATCH 195/567] Only track if in slider ball after any ticks missed --- .../TestSceneSliderLateHitJudgement.cs | 31 +++++++++++++++++++ .../Objects/Drawables/SliderInputManager.cs | 6 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 54140e4d49..78633369c7 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -280,6 +280,37 @@ namespace osu.Game.Rulesets.Osu.Tests assertSliderJudgement(HitResult.IgnoreHit); } + /// + /// Same as except the tracking is limited to the ball + /// because the tick was missed. + /// + [Test] + public void TestHitLateInRangeDoesNotHitOutOfRangeTickAndTrackingLimitedToBall() + { + performTest(new List + { + new OsuReplayFrame(time_slider_start + 150, slider_start_position, OsuAction.LeftButton), + new OsuReplayFrame(time_slider_end + 150, slider_start_position, OsuAction.LeftButton), + }, s => + { + s.Path = new SliderPath(PathType.PERFECT_CURVE, new[] + { + Vector2.Zero, + new Vector2(50, 50), + new Vector2(20, 0), + }); + + s.TickDistanceMultiplier = 0.25f; + s.SliderVelocityMultiplier = 3; + }); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTickJudgement(1, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.LargeTickHit); + assertSliderJudgement(HitResult.IgnoreHit); + } + /// /// If the head circle is hit and the mouse is in range of the follow circle, /// then a tick not within the follow radius from the cursor position should not be hit. diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index 996a477153..a497c04894 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -126,8 +126,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables nested.MissForcefully(); } - // Enable tracking, since the mouse is within the follow area (if it were expanded). - updateTracking(true); + // If all ticks were hit so far, enable tracking the full extent. + // If any ticks were missed, assume tracking would've broken at some point, and should only activate if the cursor is within the slider ball. + // For the second case, this may be the last chance we have to enable tracking before other objects get judged, otherwise the same would normally happen via Update(). + updateTracking(allTicksInRange || isMouseInFollowArea(false)); } public void TryJudgeNestedObject(DrawableOsuHitObject nestedObject, double timeOffset) From fddfa33e4982a87b2b27302c0dcd057526827412 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 20:19:17 +0900 Subject: [PATCH 196/567] Fix 1-frame issues due to referencing external value --- osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index a497c04894..d698ba56c4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!slider.HeadCircle.Judged) { - if (slider.Tracking.Value) + if (Tracking) { // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. slider.HeadCircle.MissForcefully(); @@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - if (slider.Tracking.Value) + if (Tracking) nestedObject.HitForcefully(); else if (timeOffset >= 0) nestedObject.MissForcefully(); From 2b33aec12418e17f462730a4542f81e0d68cfe57 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 21:26:48 +0900 Subject: [PATCH 197/567] Require slider head to be judged before ticks --- .../TestSceneSliderLateHitJudgement.cs | 80 ++++++++++++++++--- .../Objects/Drawables/SliderInputManager.cs | 13 +-- 2 files changed, 68 insertions(+), 25 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 78633369c7..e1797e877e 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -341,6 +341,45 @@ namespace osu.Game.Rulesets.Osu.Tests assertSliderJudgement(HitResult.IgnoreHit); } + /// + /// Late hit and release on each slider head of a slider stream. + /// + [Test] + public void TestLateHitSliderStream() + { + var beatmap = new Beatmap(); + + for (int i = 0; i < 20; i++) + { + beatmap.HitObjects.Add(new Slider + { + StartTime = time_slider_start + 75 * i, // 200BPM @ 1/4 + Position = new Vector2(256 - slider_path_length / 2, 192), + TickDistanceMultiplier = 3, + Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(20, 0), + }), + }); + } + + var replay = new List(); + + for (int i = 0; i < 20; i++) + { + replay.Add(new OsuReplayFrame(time_slider_start + 75 * i + 75, slider_start_position, i % 2 == 0 ? OsuAction.LeftButton : OsuAction.RightButton)); + replay.Add(new OsuReplayFrame(time_slider_start + 75 * i + 140, slider_start_position)); + } + + performTest(replay, beatmap); + + assertHeadJudgement(HitResult.Meh); + assertTickJudgement(0, HitResult.LargeTickMiss); + assertTailJudgement(HitResult.IgnoreMiss); + assertSliderJudgement(HitResult.IgnoreHit); + } + private void assertHeadJudgement(HitResult result) { AddAssert( @@ -406,21 +445,36 @@ namespace osu.Game.Rulesets.Osu.Tests adjustSliderFunc?.Invoke(slider); + var beatmap = new Beatmap + { + HitObjects = { slider }, + BeatmapInfo = + { + Difficulty = new BeatmapDifficulty + { + SliderMultiplier = 4, + SliderTickRate = 3 + }, + Ruleset = new OsuRuleset().RulesetInfo, + } + }; + + performTest(frames, beatmap); + } + + private void performTest(List frames, Beatmap beatmap) + { + beatmap.BeatmapInfo.Ruleset = new OsuRuleset().RulesetInfo; + beatmap.BeatmapInfo.StackLeniency = 0; + beatmap.BeatmapInfo.Difficulty = new BeatmapDifficulty + { + SliderMultiplier = 4, + SliderTickRate = 3, + }; + AddStep("load player", () => { - Beatmap.Value = CreateWorkingBeatmap(new Beatmap - { - HitObjects = { slider }, - BeatmapInfo = - { - Difficulty = new BeatmapDifficulty - { - SliderMultiplier = 4, - SliderTickRate = 3 - }, - Ruleset = new OsuRuleset().RulesetInfo, - } - }); + Beatmap.Value = CreateWorkingBeatmap(beatmap); var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index d698ba56c4..8aa982783e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -162,18 +162,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } if (!slider.HeadCircle.Judged) - { - if (Tracking) - { - // Attempt to preserve correct ordering of judgements as best we can by forcing an un-judged head to be missed when the user has clearly skipped it. - slider.HeadCircle.MissForcefully(); - } - else - { - // Don't judge this object as a miss before the head has been judged, to allow the head to be hit late. - return; - } - } + return; if (Tracking) nestedObject.HitForcefully(); From 04d542105f1518119f18f7d3b160802d7d468e67 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 17 Dec 2023 21:52:21 +0900 Subject: [PATCH 198/567] Fix assertions --- .../TestSceneSliderLateHitJudgement.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index e1797e877e..6ba9c723da 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -374,10 +374,10 @@ namespace osu.Game.Rulesets.Osu.Tests performTest(replay, beatmap); - assertHeadJudgement(HitResult.Meh); - assertTickJudgement(0, HitResult.LargeTickMiss); - assertTailJudgement(HitResult.IgnoreMiss); - assertSliderJudgement(HitResult.IgnoreHit); + AddAssert( + $"all heads = {HitResult.Ok}", + () => judgementResults.Where(r => r.HitObject is SliderHeadCircle).Select(r => r.Type), + () => Has.All.EqualTo(HitResult.Ok)); } private void assertHeadJudgement(HitResult result) From 30116512ca2dcd61a63813cab04cfc9d9bacb734 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 18 Dec 2023 12:01:51 +0900 Subject: [PATCH 199/567] Populate MaxCombo scoring attrib for non-osu rulesets --- .../Difficulty/CatchLegacyScoreSimulator.cs | 1 + .../Difficulty/ManiaLegacyScoreSimulator.cs | 6 +++++- .../Difficulty/TaikoLegacyScoreSimulator.cs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index ed27e11208..7a84d9245d 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -75,6 +75,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; attributes.BonusScore = legacyBonusScore; + attributes.MaxCombo = combo; return attributes; } diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs index ddb4b868a3..d9fd96ac6a 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaLegacyScoreSimulator.cs @@ -15,7 +15,11 @@ namespace osu.Game.Rulesets.Mania.Difficulty { public LegacyScoreAttributes Simulate(IWorkingBeatmap workingBeatmap, IBeatmap playableBeatmap) { - return new LegacyScoreAttributes { ComboScore = 1000000 }; + return new LegacyScoreAttributes + { + ComboScore = 1000000, + MaxCombo = 0 // Max combo is mod-dependent, so any value here is insufficient. + }; } public double GetLegacyScoreMultiplier(IReadOnlyList mods, LegacyBeatmapConversionDifficultyInfo difficulty) diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index 1db44592b8..a8ed056c89 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -76,6 +76,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; attributes.BonusScore = legacyBonusScore; + attributes.MaxCombo = combo; return attributes; } From f84c1815734d5aa7a921a0feacc73611f1568c51 Mon Sep 17 00:00:00 2001 From: clayton Date: Sun, 17 Dec 2023 23:47:50 -0800 Subject: [PATCH 200/567] Don't convert TaikoModRandom to/from legacy mods --- .../TaikoLegacyModConversionTest.cs | 1 - osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/osu.Game.Rulesets.Taiko.Tests/TaikoLegacyModConversionTest.cs b/osu.Game.Rulesets.Taiko.Tests/TaikoLegacyModConversionTest.cs index 5f7a78ddf1..c15dc17ae4 100644 --- a/osu.Game.Rulesets.Taiko.Tests/TaikoLegacyModConversionTest.cs +++ b/osu.Game.Rulesets.Taiko.Tests/TaikoLegacyModConversionTest.cs @@ -25,7 +25,6 @@ namespace osu.Game.Rulesets.Taiko.Tests new object[] { LegacyMods.HalfTime, new[] { typeof(TaikoModHalfTime) } }, new object[] { LegacyMods.Flashlight, new[] { typeof(TaikoModFlashlight) } }, new object[] { LegacyMods.Autoplay, new[] { typeof(TaikoModAutoplay) } }, - new object[] { LegacyMods.Random, new[] { typeof(TaikoModRandom) } }, new object[] { LegacyMods.HardRock | LegacyMods.DoubleTime, new[] { typeof(TaikoModHardRock), typeof(TaikoModDoubleTime) } }, new object[] { LegacyMods.ScoreV2, new[] { typeof(ModScoreV2) } }, }; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 9d34a34fce..ad3b7b09f7 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -115,23 +115,10 @@ namespace osu.Game.Rulesets.Taiko if (mods.HasFlagFast(LegacyMods.Relax)) yield return new TaikoModRelax(); - if (mods.HasFlagFast(LegacyMods.Random)) - yield return new TaikoModRandom(); - if (mods.HasFlagFast(LegacyMods.ScoreV2)) yield return new ModScoreV2(); } - public override LegacyMods ConvertToLegacyMods(Mod[] mods) - { - var value = base.ConvertToLegacyMods(mods); - - if (mods.OfType().Any()) - value |= LegacyMods.Random; - - return value; - } - public override IEnumerable GetModsFor(ModType type) { switch (type) From ef230884a87a51a25b9380193a13b94ff8144ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 09:03:01 +0100 Subject: [PATCH 201/567] Fix collections dropdown crashing during storage migration Closes https://github.com/ppy/osu/issues/25815. `CollectionDropdown.collectionsChanged()` was assuming that if it received `null` changes, then it must mean that the change subscription is being initialised and the `filters` list will not contain any items. However, that is not the only circumstance wherein a realm subscription can fire with `null` changes; that can also happen after the main realm instance gets recycled via the notification registration flow: https://github.com/ppy/osu/blob/2f28a92f0a03c8aed6fac2ec7fb41f7ed865f798/osu.Game/Database/RealmAccess.cs#L545-L549 https://github.com/ppy/osu/blob/2f28a92f0a03c8aed6fac2ec7fb41f7ed865f798/osu.Game/Database/RealmAccess.cs#L1228-L1251 Therefore, to fix the crash, just ensure that the list is cleared every time. --- osu.Game/Collections/CollectionDropdown.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Collections/CollectionDropdown.cs b/osu.Game/Collections/CollectionDropdown.cs index e43d8f4b02..8d83ed3ec9 100644 --- a/osu.Game/Collections/CollectionDropdown.cs +++ b/osu.Game/Collections/CollectionDropdown.cs @@ -66,6 +66,7 @@ namespace osu.Game.Collections { if (changes == null) { + filters.Clear(); filters.Add(allBeatmapsItem); filters.AddRange(collections.Select(c => new CollectionFilterMenuItem(c.ToLive(realm)))); if (ShowManageCollectionsItem) From 7462a9f4ab84997dfd550f8b3025f5630c72beab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 18:17:47 +0900 Subject: [PATCH 202/567] Add helper method to handle progress notifications for background jobs --- osu.Game/BackgroundDataStoreProcessor.cs | 51 +++++++++++++++++++----- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 10cc13dc29..794d534f10 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -279,20 +279,17 @@ namespace osu.Game if (scoreIds.Count == 0) return; - ProgressNotification notification = new ProgressNotification { State = ProgressNotificationState.Active }; - - notificationOverlay?.Post(notification); + var notification = showProgressNotification("Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm"); int processedCount = 0; int failedCount = 0; foreach (var id in scoreIds) { - if (notification.State == ProgressNotificationState.Cancelled) + if (notification?.State == ProgressNotificationState.Cancelled) break; - notification.Text = $"Upgrading scores to new scoring algorithm ({processedCount} of {scoreIds.Count})"; - notification.Progress = (float)processedCount / scoreIds.Count; + updateNotificationProgress(notification, processedCount, scoreIds.Count); sleepIfRequired(); @@ -325,24 +322,58 @@ namespace osu.Game } } - if (processedCount == scoreIds.Count) + completeNotification(notification, processedCount, scoreIds.Count, failedCount); + } + + private void updateNotificationProgress(ProgressNotification? notification, int processedCount, int totalCount) + { + if (notification == null) + return; + + notification.Text = notification.Text.ToString().Split('(').First().TrimEnd() + $" ({processedCount} of {totalCount})"; + notification.Progress = (float)processedCount / totalCount; + } + + private void completeNotification(ProgressNotification? notification, int processedCount, int totalCount, int? failedCount = null) + { + if (notification == null) + return; + + if (processedCount == totalCount) { - notification.CompletionText = $"{processedCount} score(s) have been upgraded to the new scoring algorithm"; + notification.CompletionText = $"{processedCount} {notification.CompletionText}"; notification.Progress = 1; notification.State = ProgressNotificationState.Completed; } else { - notification.Text = $"{processedCount} of {scoreIds.Count} score(s) have been upgraded to the new scoring algorithm."; + notification.Text = $"{processedCount} of {totalCount} {notification.CompletionText}"; // We may have arrived here due to user cancellation or completion with failures. if (failedCount > 0) - notification.Text += $" Check logs for issues with {failedCount} failed upgrades."; + notification.Text += $" Check logs for issues with {failedCount} failed items."; notification.State = ProgressNotificationState.Cancelled; } } + private ProgressNotification? showProgressNotification(string running, string completed) + { + if (notificationOverlay == null) + return null; + + ProgressNotification notification = new ProgressNotification + { + Text = running, + CompletionText = completed, + State = ProgressNotificationState.Active + }; + + notificationOverlay?.Post(notification); + + return notification; + } + private void sleepIfRequired() { while (localUserPlayInfo?.IsPlaying.Value == true) From e7d1cf7868663126479d2997b7d0da3062817072 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 18:22:40 +0900 Subject: [PATCH 203/567] Add progress notifications for background tasks which don't already have them --- osu.Game/BackgroundDataStoreProcessor.cs | 60 +++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 794d534f10..58b1c912c4 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -144,12 +144,24 @@ namespace osu.Game } }); + if (beatmapSetIds.Count == 0) + return; + Logger.Log($"Found {beatmapSetIds.Count} beatmap sets which require reprocessing."); - int i = 0; + // Technically this is doing more than just star ratings, but easier for the end user to understand. + var notification = showProgressNotification("Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated"); + + int processedCount = 0; + int failedCount = 0; foreach (var id in beatmapSetIds) { + if (notification?.State == ProgressNotificationState.Cancelled) + break; + + updateNotificationProgress(notification, processedCount, beatmapSetIds.Count); + sleepIfRequired(); realmAccess.Run(r => @@ -160,16 +172,19 @@ namespace osu.Game { try { - Logger.Log($"Background processing {set} ({++i} / {beatmapSetIds.Count})"); beatmapUpdater.Process(set); + ++processedCount; } catch (Exception e) { Logger.Log($"Background processing failed on {set}: {e}"); + ++failedCount; } } }); } + + completeNotification(notification, processedCount, beatmapSetIds.Count, failedCount); } private void processBeatmapsWithMissingObjectCounts() @@ -184,12 +199,23 @@ namespace osu.Game beatmapIds.Add(b.ID); }); - Logger.Log($"Found {beatmapIds.Count} beatmaps which require reprocessing."); + if (beatmapIds.Count == 0) + return; - int i = 0; + Logger.Log($"Found {beatmapIds.Count} beatmaps which require statistics population."); + + var notification = showProgressNotification("Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics"); + + int processedCount = 0; + int failedCount = 0; foreach (var id in beatmapIds) { + if (notification?.State == ProgressNotificationState.Cancelled) + break; + + updateNotificationProgress(notification, processedCount, beatmapIds.Count); + sleepIfRequired(); realmAccess.Run(r => @@ -200,16 +226,19 @@ namespace osu.Game { try { - Logger.Log($"Background processing {beatmap} ({++i} / {beatmapIds.Count})"); beatmapUpdater.ProcessObjectCounts(beatmap); + ++processedCount; } catch (Exception e) { Logger.Log($"Background processing failed on {beatmap}: {e}"); + ++failedCount; } } }); } + + completeNotification(notification, processedCount, beatmapIds.Count, failedCount); } private void processScoresWithMissingStatistics() @@ -231,10 +260,23 @@ namespace osu.Game } }); - Logger.Log($"Found {scoreIds.Count} scores which require reprocessing."); + if (scoreIds.Count == 0) + return; + + Logger.Log($"Found {scoreIds.Count} scores which require statistics population."); + + var notification = showProgressNotification("Populating missing statistics for scores", "scores have been populated with missing statistics"); + + int processedCount = 0; + int failedCount = 0; foreach (var id in scoreIds) { + if (notification?.State == ProgressNotificationState.Cancelled) + break; + + updateNotificationProgress(notification, processedCount, scoreIds.Count); + sleepIfRequired(); try @@ -251,6 +293,7 @@ namespace osu.Game }); Logger.Log($"Populated maximum statistics for score {id}"); + ++processedCount; } catch (ObjectDisposedException) { @@ -260,8 +303,11 @@ namespace osu.Game { Logger.Log(@$"Failed to populate maximum statistics for {id}: {e}"); realmAccess.Write(r => r.Find(id)!.BackgroundReprocessingFailed = true); + ++failedCount; } } + + completeNotification(notification, processedCount, scoreIds.Count, failedCount); } private void convertLegacyTotalScoreToStandardised() @@ -332,6 +378,8 @@ namespace osu.Game notification.Text = notification.Text.ToString().Split('(').First().TrimEnd() + $" ({processedCount} of {totalCount})"; notification.Progress = (float)processedCount / totalCount; + + // TODO add log output } private void completeNotification(ProgressNotification? notification, int processedCount, int totalCount, int? failedCount = null) From bfa90e9dcb73f0c8687a184e4b91b95d2d98d72f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 18:34:55 +0900 Subject: [PATCH 204/567] Also populate `ObjectCount`s when running a full beatmap process Saves running things twice on an old install --- osu.Game/BackgroundDataStoreProcessor.cs | 1 + osu.Game/Beatmaps/BeatmapUpdater.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 58b1c912c4..38dc170ccc 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -67,6 +67,7 @@ namespace osu.Game checkForOutdatedStarRatings(); processBeatmapSetsWithMissingMetrics(); + // Note that the previous method will also update these on a fresh run. processBeatmapsWithMissingObjectCounts(); processScoresWithMissingStatistics(); convertLegacyTotalScoreToStandardised(); diff --git a/osu.Game/Beatmaps/BeatmapUpdater.cs b/osu.Game/Beatmaps/BeatmapUpdater.cs index 27492b8bac..e897d28916 100644 --- a/osu.Game/Beatmaps/BeatmapUpdater.cs +++ b/osu.Game/Beatmaps/BeatmapUpdater.cs @@ -77,6 +77,8 @@ namespace osu.Game.Beatmaps beatmap.StarRating = calculator.Calculate().StarRating; beatmap.Length = working.Beatmap.CalculatePlayableLength(); beatmap.BPM = 60000 / working.Beatmap.GetMostCommonBeatLength(); + beatmap.EndTimeObjectCount = working.Beatmap.HitObjects.Count(h => h is IHasDuration); + beatmap.TotalObjectCount = working.Beatmap.HitObjects.Count; } // And invalidate again afterwards as re-fetching the most up-to-date database metadata will be required. From 5ab38151239d39d4feec8b2f84d92e651c992a60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 18:41:36 +0900 Subject: [PATCH 205/567] Add logging of progress every so often --- osu.Game/BackgroundDataStoreProcessor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 38dc170ccc..6a801ab5bf 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -380,7 +380,8 @@ namespace osu.Game notification.Text = notification.Text.ToString().Split('(').First().TrimEnd() + $" ({processedCount} of {totalCount})"; notification.Progress = (float)processedCount / totalCount; - // TODO add log output + if (processedCount % 100 == 0) + Logger.Log(notification.Text.ToString()); } private void completeNotification(ProgressNotification? notification, int processedCount, int totalCount, int? failedCount = null) From e3251b40b311e504c6bb22e75e1b1ab347704714 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 19:00:44 +0900 Subject: [PATCH 206/567] Fix progress notifications queueing up infinite text changes when not visible --- osu.Game/Overlays/Notifications/ProgressNotification.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index 6ea032213e..2362cb11f6 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Notifications set { text = value; - Schedule(() => textDrawable.Text = text); + Scheduler.AddOnce(t => textDrawable.Text = t, text); } } From 62444c3d0423284daf1f8511977cd8d8f93fab6b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 19:17:59 +0900 Subject: [PATCH 207/567] Fix song select's carousel scroll position getting reset on background processing This only happened for users using absolute right-click scroll. --- osu.Game/Graphics/Containers/OsuScrollContainer.cs | 10 +++++----- .../Graphics/Containers/UserTrackingScrollContainer.cs | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index da6996c170..124becc35a 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -44,9 +44,6 @@ namespace osu.Game.Graphics.Containers private bool shouldPerformRightMouseScroll(MouseButtonEvent e) => RightMouseScrollbar && e.Button == MouseButton.Right; - private void scrollFromMouseEvent(MouseEvent e) => - ScrollTo(Clamp(ToLocalSpace(e.ScreenSpaceMousePosition)[ScrollDim] / DrawSize[ScrollDim]) * Content.DrawSize[ScrollDim], true, DistanceDecayOnRightMouseScrollbar); - private bool rightMouseDragging; protected override bool IsDragging => base.IsDragging || rightMouseDragging; @@ -80,7 +77,7 @@ namespace osu.Game.Graphics.Containers { if (shouldPerformRightMouseScroll(e)) { - scrollFromMouseEvent(e); + ScrollFromMouseEvent(e); return true; } @@ -91,7 +88,7 @@ namespace osu.Game.Graphics.Containers { if (rightMouseDragging) { - scrollFromMouseEvent(e); + ScrollFromMouseEvent(e); return; } @@ -129,6 +126,9 @@ namespace osu.Game.Graphics.Containers return base.OnScroll(e); } + protected virtual void ScrollFromMouseEvent(MouseEvent e) => + ScrollTo(Clamp(ToLocalSpace(e.ScreenSpaceMousePosition)[ScrollDim] / DrawSize[ScrollDim]) * Content.DrawSize[ScrollDim], true, DistanceDecayOnRightMouseScrollbar); + protected override ScrollbarContainer CreateScrollbar(Direction direction) => new OsuScrollbar(direction); protected partial class OsuScrollbar : ScrollbarContainer diff --git a/osu.Game/Graphics/Containers/UserTrackingScrollContainer.cs b/osu.Game/Graphics/Containers/UserTrackingScrollContainer.cs index 6934c95385..354a57b7d2 100644 --- a/osu.Game/Graphics/Containers/UserTrackingScrollContainer.cs +++ b/osu.Game/Graphics/Containers/UserTrackingScrollContainer.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; +using osu.Framework.Input.Events; namespace osu.Game.Graphics.Containers { @@ -46,6 +47,12 @@ namespace osu.Game.Graphics.Containers base.ScrollIntoView(target, animated); } + protected override void ScrollFromMouseEvent(MouseEvent e) + { + UserScrolling = true; + base.ScrollFromMouseEvent(e); + } + public new void ScrollTo(float value, bool animated = true, double? distanceDecay = null) { UserScrolling = false; From 03ac2c30949c66900e04a67250ff21e2f34f2dfe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 19:20:57 +0900 Subject: [PATCH 208/567] Remove some excessive logging --- osu.Game/BackgroundDataStoreProcessor.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 6a801ab5bf..55be7f2c9e 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -293,7 +293,6 @@ namespace osu.Game r.Find(id)!.MaximumStatisticsJson = JsonConvert.SerializeObject(score.MaximumStatistics); }); - Logger.Log($"Populated maximum statistics for score {id}"); ++processedCount; } catch (ObjectDisposedException) @@ -354,7 +353,6 @@ namespace osu.Game s.TotalScoreVersion = LegacyScoreEncoder.LATEST_VERSION; }); - Logger.Log($"Converted total score for score {id}"); ++processedCount; } catch (ObjectDisposedException) From 32cc3f9ef74594875f9049bbe7f5bdea901cb1e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:00:57 +0900 Subject: [PATCH 209/567] Combine multiple similar invalidation logic into single event --- osu.Game/Screens/Select/BeatmapCarousel.cs | 33 ++++++++-------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index eb47a7201a..19ade780e1 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -168,7 +168,7 @@ namespace osu.Game.Screens.Select applyActiveCriteria(false); if (loadedTestBeatmaps) - signalBeatmapsLoaded(); + invalidateAfterChange(true); // Restore selection if (selectedBeatmapBefore != null && newRoot.BeatmapSetsByID.TryGetValue(selectedBeatmapBefore.BeatmapSet!.ID, out var newSelectionCandidates)) @@ -298,7 +298,8 @@ namespace osu.Game.Screens.Select removeBeatmapSet(id); } - signalBeatmapsLoaded(); + invalidateAfterChange(!BeatmapSetsLoaded); + BeatmapSetsLoaded = true; return; } @@ -393,12 +394,7 @@ namespace osu.Game.Screens.Select root.RemoveItem(set); } - itemsCache.Invalidate(); - - if (!Scroll.UserScrolling) - ScrollToSelected(true); - - BeatmapSetsChanged?.Invoke(); + invalidateAfterChange(true); }); public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => @@ -465,12 +461,7 @@ namespace osu.Game.Screens.Select } } - itemsCache.Invalidate(); - - if (!Scroll.UserScrolling) - ScrollToSelected(true); - - BeatmapSetsChanged?.Invoke(); + invalidateAfterChange(true); }); /// @@ -748,15 +739,15 @@ namespace osu.Game.Screens.Select } } - private void signalBeatmapsLoaded() + private void invalidateAfterChange(bool invokeSetsChangedEvent) { - if (!BeatmapSetsLoaded) - { - BeatmapSetsChanged?.Invoke(); - BeatmapSetsLoaded = true; - } - itemsCache.Invalidate(); + + if (!Scroll.UserScrolling) + ScrollToSelected(true); + + if (invokeSetsChangedEvent) + BeatmapSetsChanged?.Invoke(); } private float? scrollTarget; From 87b7699fcc29ab7e70ec1f632a0341bbe08a23b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:09:09 +0900 Subject: [PATCH 210/567] Avoid calling invalidation logic per beatmap set updated Realm will batch the updates. We don't want to do expensive operations per set when we don't need to. --- osu.Game/Screens/Select/BeatmapCarousel.cs | 33 +++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 19ade780e1..63654fd36a 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -289,7 +289,7 @@ namespace osu.Game.Screens.Select foreach (var id in realmSets) { if (!root.BeatmapSetsByID.ContainsKey(id)) - UpdateBeatmapSet(realm.Realm.Find(id)!.Detach()); + updateBeatmapSet(realm.Realm.Find(id)!.Detach()); } foreach (var id in root.BeatmapSetsByID.Keys) @@ -304,10 +304,10 @@ namespace osu.Game.Screens.Select } foreach (int i in changes.NewModifiedIndices) - UpdateBeatmapSet(sender[i].Detach()); + updateBeatmapSet(sender[i].Detach()); foreach (int i in changes.InsertedIndices) - UpdateBeatmapSet(sender[i].Detach()); + updateBeatmapSet(sender[i].Detach()); if (changes.DeletedIndices.Length > 0 && SelectedBeatmapInfo != null) { @@ -348,6 +348,8 @@ namespace osu.Game.Screens.Select SelectBeatmap(sender[modifiedAndInserted.First()].Beatmaps.First()); } } + + invalidateAfterChange(!BeatmapSetsLoaded); } private void beatmapsChanged(IRealmCollection sender, ChangeSet? changes) @@ -356,6 +358,8 @@ namespace osu.Game.Screens.Select if (changes == null) return; + bool changed = false; + foreach (int i in changes.InsertedIndices) { var beatmapInfo = sender[i]; @@ -368,17 +372,24 @@ namespace osu.Game.Screens.Select if (root.BeatmapSetsByID.TryGetValue(beatmapSet.ID, out var existingSets) && existingSets.SelectMany(s => s.Beatmaps).All(b => b.BeatmapInfo.ID != beatmapInfo.ID)) { - UpdateBeatmapSet(beatmapSet.Detach()); + updateBeatmapSet(beatmapSet.Detach()); + changed = true; } } + + if (changed) + invalidateAfterChange(true); } private IQueryable getBeatmapSets(Realm realm) => realm.All().Where(s => !s.DeletePending && !s.Protected); - public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => + public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => + { removeBeatmapSet(beatmapSet.ID); + invalidateAfterChange(true); + }); - private void removeBeatmapSet(Guid beatmapSetID) => Schedule(() => + private void removeBeatmapSet(Guid beatmapSetID) { if (!root.BeatmapSetsByID.TryGetValue(beatmapSetID, out var existingSets)) return; @@ -393,11 +404,15 @@ namespace osu.Game.Screens.Select root.RemoveItem(set); } + } + public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => + { + updateBeatmapSet(beatmapSet); invalidateAfterChange(true); }); - public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => + private void updateBeatmapSet(BeatmapSetInfo beatmapSet) { Guid? previouslySelectedID = null; @@ -460,9 +475,7 @@ namespace osu.Game.Screens.Select select((CarouselItem?)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet); } } - - invalidateAfterChange(true); - }); + } /// /// Selects a given beatmap on the carousel. From 6fa1f5ef9bfaac577cad7b29d4840e9302c6a889 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:10:31 +0900 Subject: [PATCH 211/567] Simplify invalidation logic The only case where this was checking is guaranteed by realm to only be called once. --- osu.Game/Screens/Select/BeatmapCarousel.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 63654fd36a..5178413ad6 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -168,7 +168,7 @@ namespace osu.Game.Screens.Select applyActiveCriteria(false); if (loadedTestBeatmaps) - invalidateAfterChange(true); + invalidateAfterChange(); // Restore selection if (selectedBeatmapBefore != null && newRoot.BeatmapSetsByID.TryGetValue(selectedBeatmapBefore.BeatmapSet!.ID, out var newSelectionCandidates)) @@ -298,7 +298,7 @@ namespace osu.Game.Screens.Select removeBeatmapSet(id); } - invalidateAfterChange(!BeatmapSetsLoaded); + invalidateAfterChange(); BeatmapSetsLoaded = true; return; } @@ -349,7 +349,7 @@ namespace osu.Game.Screens.Select } } - invalidateAfterChange(!BeatmapSetsLoaded); + invalidateAfterChange(); } private void beatmapsChanged(IRealmCollection sender, ChangeSet? changes) @@ -378,7 +378,7 @@ namespace osu.Game.Screens.Select } if (changed) - invalidateAfterChange(true); + invalidateAfterChange(); } private IQueryable getBeatmapSets(Realm realm) => realm.All().Where(s => !s.DeletePending && !s.Protected); @@ -386,7 +386,7 @@ namespace osu.Game.Screens.Select public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => { removeBeatmapSet(beatmapSet.ID); - invalidateAfterChange(true); + invalidateAfterChange(); }); private void removeBeatmapSet(Guid beatmapSetID) @@ -409,7 +409,7 @@ namespace osu.Game.Screens.Select public void UpdateBeatmapSet(BeatmapSetInfo beatmapSet) => Schedule(() => { updateBeatmapSet(beatmapSet); - invalidateAfterChange(true); + invalidateAfterChange(); }); private void updateBeatmapSet(BeatmapSetInfo beatmapSet) @@ -752,15 +752,14 @@ namespace osu.Game.Screens.Select } } - private void invalidateAfterChange(bool invokeSetsChangedEvent) + private void invalidateAfterChange() { itemsCache.Invalidate(); if (!Scroll.UserScrolling) ScrollToSelected(true); - if (invokeSetsChangedEvent) - BeatmapSetsChanged?.Invoke(); + BeatmapSetsChanged?.Invoke(); } private float? scrollTarget; From 034c5cd6541d622fe42ed1c301b647a3ac06afd8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:30:56 +0900 Subject: [PATCH 212/567] Debounce count updates for good measure --- osu.Game/Screens/Select/SongSelect.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index dfea4e3794..7c30fd5baa 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -162,7 +162,7 @@ namespace osu.Game.Screens.Select BleedBottom = Footer.HEIGHT, SelectionChanged = updateSelectedBeatmap, BeatmapSetsChanged = carouselBeatmapsLoaded, - FilterApplied = updateVisibleBeatmapCount, + FilterApplied = () => Scheduler.Add(updateVisibleBeatmapCount), GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s), }, c => carouselContainer.Child = c); @@ -843,7 +843,7 @@ namespace osu.Game.Screens.Select private void carouselBeatmapsLoaded() { bindBindables(); - updateVisibleBeatmapCount(); + Scheduler.AddOnce(updateVisibleBeatmapCount); Carousel.AllowSelection = true; @@ -877,7 +877,8 @@ namespace osu.Game.Screens.Select { // Intentionally not localised until we have proper support for this (see https://github.com/ppy/osu-framework/pull/4918 // but also in this case we want support for formatting a number within a string). - FilterControl.InformationalText = Carousel.CountDisplayed != 1 ? $"{Carousel.CountDisplayed:#,0} matches" : $"{Carousel.CountDisplayed:#,0} match"; + int carouselCountDisplayed = Carousel.CountDisplayed; + FilterControl.InformationalText = carouselCountDisplayed != 1 ? $"{carouselCountDisplayed:#,0} matches" : $"{carouselCountDisplayed:#,0} match"; } private bool boundLocalBindables; From 5755fa214a450d1663babcad4fd1eb5bcafb12e0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:44:08 +0900 Subject: [PATCH 213/567] Cache non-filtered beatmap counts to massively improve count performance --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- .../Screens/Select/Carousel/CarouselGroup.cs | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 5178413ad6..919a320bca 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -64,7 +64,7 @@ namespace osu.Game.Screens.Select /// /// The total count of non-filtered beatmaps displayed. /// - public int CountDisplayed => beatmapSets.Where(s => !s.Filtered.Value).Sum(s => s.Beatmaps.Count(b => !b.Filtered.Value)); + public int CountDisplayed => beatmapSets.Where(s => !s.Filtered.Value).Sum(s => s.TotalItemsNotFiltered); /// /// The currently selected beatmap set. diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index c353ee98ae..5aefdf5e28 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -14,6 +14,8 @@ namespace osu.Game.Screens.Select.Carousel public IReadOnlyList Items => items; + public int TotalItemsNotFiltered { get; private set; } + private readonly List items = new List(); /// @@ -31,6 +33,9 @@ namespace osu.Game.Screens.Select.Carousel { items.Remove(i); + if (!i.Filtered.Value) + TotalItemsNotFiltered--; + // it's important we do the deselection after removing, so any further actions based on // State.ValueChanged make decisions post-removal. i.State.Value = CarouselItemState.Collapsed; @@ -55,6 +60,9 @@ namespace osu.Game.Screens.Select.Carousel // criteria may be null for initial population. the filtering will be applied post-add. items.Add(i); } + + if (!i.Filtered.Value) + TotalItemsNotFiltered--; } public CarouselGroup(List? items = null) @@ -84,7 +92,14 @@ namespace osu.Game.Screens.Select.Carousel { base.Filter(criteria); - items.ForEach(c => c.Filter(criteria)); + TotalItemsNotFiltered = 0; + + foreach (var c in items) + { + c.Filter(criteria); + if (!c.Filtered.Value) + TotalItemsNotFiltered++; + } // Sorting is expensive, so only perform if it's actually changed. if (lastCriteria?.Sort != criteria.Sort) From 25df42630ecba979457a9dcd2a7678d154a85a5e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:47:08 +0900 Subject: [PATCH 214/567] Improve performance of `attemptSelection` using new cached count and `LastSelected` --- osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index 7f90e05744..8d2ddc5812 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace osu.Game.Screens.Select.Carousel { @@ -101,7 +100,7 @@ namespace osu.Game.Screens.Select.Carousel if (State.Value != CarouselItemState.Selected) return; // we only perform eager selection if none of our items are in a selected state already. - if (Items.Any(i => i.State.Value == CarouselItemState.Selected)) return; + if (LastSelected?.State.Value == CarouselItemState.Selected || TotalItemsNotFiltered == 0) return; PerformSelection(); } From be16e0e538465369aa9e33223f2814b34fdbddaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 12:47:42 +0100 Subject: [PATCH 215/567] Add failing test for adding collection w/ name colliding w/\ default items --- .../TestSceneManageCollectionsDialog.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/osu.Game.Tests/Visual/Collections/TestSceneManageCollectionsDialog.cs b/osu.Game.Tests/Visual/Collections/TestSceneManageCollectionsDialog.cs index cfa45ec6ef..747cf73baf 100644 --- a/osu.Game.Tests/Visual/Collections/TestSceneManageCollectionsDialog.cs +++ b/osu.Game.Tests/Visual/Collections/TestSceneManageCollectionsDialog.cs @@ -166,6 +166,29 @@ namespace osu.Game.Tests.Visual.Collections }))); } + [Test] + public void TestCollectionNameCollisionsWithBuiltInItems() + { + AddStep("add dropdown", () => + { + Add(new CollectionDropdown + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + RelativeSizeAxes = Axes.X, + Width = 0.4f, + }); + }); + AddStep("add two collections which collide with default items", () => Realm.Write(r => r.Add(new[] + { + new BeatmapCollection(name: "All beatmaps"), + new BeatmapCollection(name: "Manage collections...") + { + BeatmapMD5Hashes = { beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps[0].MD5Hash } + }, + }))); + } + [Test] public void TestRemoveCollectionViaButton() { From eeeb5aa3d4d0eeb8360b345751157eb52f09ad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 12:52:06 +0100 Subject: [PATCH 216/567] Fix crash when creating collections named "All beatmaps" or "Manage collections..." Closes https://github.com/ppy/osu/issues/25834 The name fallback that was there previously since https://github.com/ppy/osu/pull/11892 was half broken. This way should be a lot less prone to failure. --- .../Collections/CollectionFilterMenuItem.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/osu.Game/Collections/CollectionFilterMenuItem.cs b/osu.Game/Collections/CollectionFilterMenuItem.cs index 2ac5784f09..49262ed917 100644 --- a/osu.Game/Collections/CollectionFilterMenuItem.cs +++ b/osu.Game/Collections/CollectionFilterMenuItem.cs @@ -37,22 +37,17 @@ namespace osu.Game.Collections CollectionName = name; } - public bool Equals(CollectionFilterMenuItem? other) + public virtual bool Equals(CollectionFilterMenuItem? other) { - if (other == null) - return false; + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; - // collections may have the same name, so compare first on reference equality. - // this relies on the assumption that only one instance of the BeatmapCollection exists game-wide, managed by CollectionManager. - if (Collection != null) - return Collection.ID == other.Collection?.ID; + if (Collection == null) return false; - // fallback to name-based comparison. - // this is required for special dropdown items which don't have a collection (all beatmaps / manage collections items below). - return CollectionName == other.CollectionName; + return Collection.ID == other.Collection?.ID; } - public override int GetHashCode() => CollectionName.GetHashCode(); + public override int GetHashCode() => Collection?.ID.GetHashCode() ?? 0; } public class AllBeatmapsCollectionFilterMenuItem : CollectionFilterMenuItem @@ -61,6 +56,10 @@ namespace osu.Game.Collections : base("All beatmaps") { } + + public override bool Equals(CollectionFilterMenuItem? other) => other is AllBeatmapsCollectionFilterMenuItem; + + public override int GetHashCode() => 1; } public class ManageCollectionsFilterMenuItem : CollectionFilterMenuItem @@ -69,5 +68,9 @@ namespace osu.Game.Collections : base("Manage collections...") { } + + public override bool Equals(CollectionFilterMenuItem? other) => other is ManageCollectionsFilterMenuItem; + + public override int GetHashCode() => 2; } } From 17f1f8bb43b7cadb1765338428870736a6f713bc Mon Sep 17 00:00:00 2001 From: 65-7a Date: Tue, 19 Dec 2023 00:28:23 +1100 Subject: [PATCH 217/567] Fix padding on dropdown search bar --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index ea0da30911..632036fef9 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -397,7 +397,7 @@ namespace osu.Game.Graphics.UserInterface protected override DropdownSearchBar CreateSearchBar() => new OsuDropdownSearchBar { - Padding = new MarginPadding { Right = 36 }, + Padding = new MarginPadding { Right = 26 }, }; private partial class OsuDropdownSearchBar : DropdownSearchBar From 25e3a8e82e712d18c904ccfcc29fbcf821e94163 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 22:24:57 +0900 Subject: [PATCH 218/567] Fix a few of silly issues --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +++ osu.Game/Screens/Select/Carousel/CarouselGroup.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 919a320bca..607b891beb 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -168,7 +168,10 @@ namespace osu.Game.Screens.Select applyActiveCriteria(false); if (loadedTestBeatmaps) + { invalidateAfterChange(); + BeatmapSetsLoaded = true; + } // Restore selection if (selectedBeatmapBefore != null && newRoot.BeatmapSetsByID.TryGetValue(selectedBeatmapBefore.BeatmapSet!.ID, out var newSelectionCandidates)) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index 5aefdf5e28..f5ea32a22a 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -62,7 +62,7 @@ namespace osu.Game.Screens.Select.Carousel } if (!i.Filtered.Value) - TotalItemsNotFiltered--; + TotalItemsNotFiltered++; } public CarouselGroup(List? items = null) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 7c30fd5baa..d23a660ff6 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -162,7 +162,7 @@ namespace osu.Game.Screens.Select BleedBottom = Footer.HEIGHT, SelectionChanged = updateSelectedBeatmap, BeatmapSetsChanged = carouselBeatmapsLoaded, - FilterApplied = () => Scheduler.Add(updateVisibleBeatmapCount), + FilterApplied = () => Scheduler.AddOnce(updateVisibleBeatmapCount), GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s), }, c => carouselContainer.Child = c); From d81cabc06361ab9cfb20f7294c38166d4bdb03a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 22:35:36 +0900 Subject: [PATCH 219/567] Revert "Improve performance of `attemptSelection` using new cached count and `LastSelected`" This reverts commit 25df42630ecba979457a9dcd2a7678d154a85a5e. --- osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index 8d2ddc5812..7f90e05744 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace osu.Game.Screens.Select.Carousel { @@ -100,7 +101,7 @@ namespace osu.Game.Screens.Select.Carousel if (State.Value != CarouselItemState.Selected) return; // we only perform eager selection if none of our items are in a selected state already. - if (LastSelected?.State.Value == CarouselItemState.Selected || TotalItemsNotFiltered == 0) return; + if (Items.Any(i => i.State.Value == CarouselItemState.Selected)) return; PerformSelection(); } From 9aaaa128098af6a8e57e07d5131bb719779b428c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 00:01:09 +0900 Subject: [PATCH 220/567] Don't show progress notifications when there are too few items to be worthwhile --- osu.Game/BackgroundDataStoreProcessor.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 55be7f2c9e..33b66ecfc7 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -151,7 +151,7 @@ namespace osu.Game Logger.Log($"Found {beatmapSetIds.Count} beatmap sets which require reprocessing."); // Technically this is doing more than just star ratings, but easier for the end user to understand. - var notification = showProgressNotification("Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated"); + var notification = showProgressNotification(beatmapSetIds.Count, "Reprocessing star rating for beatmaps", "beatmaps' star ratings have been updated"); int processedCount = 0; int failedCount = 0; @@ -205,7 +205,7 @@ namespace osu.Game Logger.Log($"Found {beatmapIds.Count} beatmaps which require statistics population."); - var notification = showProgressNotification("Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics"); + var notification = showProgressNotification(beatmapIds.Count, "Populating missing statistics for beatmaps", "beatmaps have been populated with missing statistics"); int processedCount = 0; int failedCount = 0; @@ -266,7 +266,7 @@ namespace osu.Game Logger.Log($"Found {scoreIds.Count} scores which require statistics population."); - var notification = showProgressNotification("Populating missing statistics for scores", "scores have been populated with missing statistics"); + var notification = showProgressNotification(scoreIds.Count, "Populating missing statistics for scores", "scores have been populated with missing statistics"); int processedCount = 0; int failedCount = 0; @@ -325,7 +325,7 @@ namespace osu.Game if (scoreIds.Count == 0) return; - var notification = showProgressNotification("Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm"); + var notification = showProgressNotification(scoreIds.Count, "Upgrading scores to new scoring algorithm", "scores have been upgraded to the new scoring algorithm"); int processedCount = 0; int failedCount = 0; @@ -405,11 +405,14 @@ namespace osu.Game } } - private ProgressNotification? showProgressNotification(string running, string completed) + private ProgressNotification? showProgressNotification(int totalCount, string running, string completed) { if (notificationOverlay == null) return null; + if (totalCount < 10) + return null; + ProgressNotification notification = new ProgressNotification { Text = running, From 374425ea75ee36a853f170c3a3ae04deccdb9981 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 01:07:33 +0900 Subject: [PATCH 221/567] Fix keyboard precision of nightcore/daycore adjustments being incorrect Closes https://github.com/ppy/osu/issues/25854. --- osu.Game/Rulesets/Mods/ModDaycore.cs | 3 ++- osu.Game/Rulesets/Mods/ModNightcore.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index 39ebd1fe4c..09b35c249e 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -6,6 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Configuration; +using osu.Game.Overlays.Settings; namespace osu.Game.Rulesets.Mods { @@ -17,7 +18,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "Whoaaaaa..."; - [SettingSource("Speed decrease", "The actual decrease to apply")] + [SettingSource("Speed decrease", "The actual decrease to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(0.75) { MinValue = 0.5, diff --git a/osu.Game/Rulesets/Mods/ModNightcore.cs b/osu.Game/Rulesets/Mods/ModNightcore.cs index b519ab4db7..b42927256c 100644 --- a/osu.Game/Rulesets/Mods/ModNightcore.cs +++ b/osu.Game/Rulesets/Mods/ModNightcore.cs @@ -14,6 +14,7 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; using osu.Game.Skinning; @@ -28,7 +29,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Uguuuuuuuu..."; - [SettingSource("Speed increase", "The actual increase to apply")] + [SettingSource("Speed increase", "The actual increase to apply", SettingControlType = typeof(MultiplierSettingsSlider))] public override BindableNumber SpeedChange { get; } = new BindableDouble(1.5) { MinValue = 1.01, From 51f4c7254c80bca74ea0ae9e772c630feb7f6a4e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 01:32:30 +0900 Subject: [PATCH 222/567] Fix mod search textbox having focus while settings are visible Stopped arrow key adjust on slider bars from working. Also just felt wrong that you could type into an off-screen textbox. --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 13 ++++++++----- osu.Game/Overlays/Mods/ModSettingsArea.cs | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index ce798ae752..30d7b6191e 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -508,6 +508,11 @@ namespace osu.Game.Overlays.Mods modSettingsArea.ResizeHeightTo(modAreaHeight, transition_duration, Easing.InOutCubic); TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic); + + if (customisationVisible.Value) + GetContainingInputManager().ChangeFocus(modSettingsArea); + else + Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null)); } /// @@ -622,7 +627,7 @@ namespace osu.Game.Overlays.Mods } if (textSearchStartsActive.Value) - SearchTextBox.TakeFocus(); + SearchTextBox.HoldFocus = true; } protected override void PopOut() @@ -761,11 +766,9 @@ namespace osu.Game.Overlays.Mods return false; // TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`) - if (SearchTextBox.HasFocus) - SearchTextBox.KillFocus(); - else + SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus; + if (SearchTextBox.HoldFocus) SearchTextBox.TakeFocus(); - return true; } diff --git a/osu.Game/Overlays/Mods/ModSettingsArea.cs b/osu.Game/Overlays/Mods/ModSettingsArea.cs index 6158c2c70f..54bfcc7199 100644 --- a/osu.Game/Overlays/Mods/ModSettingsArea.cs +++ b/osu.Game/Overlays/Mods/ModSettingsArea.cs @@ -32,6 +32,8 @@ namespace osu.Game.Overlays.Mods [Resolved] private OverlayColourProvider colourProvider { get; set; } = null!; + public override bool AcceptsFocus => true; + public ModSettingsArea() { RelativeSizeAxes = Axes.X; From 41485c19cfe597a5144911fdaff34fe218f1d963 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 02:08:25 +0900 Subject: [PATCH 223/567] Add realm refresh steps in an attempt to stabilise failing test I think this is required because there is a higher chance of batched updates with the new structure (and less calls to `BeatmapSetsChanged` which causes re-selection). --- osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 6b53277964..28b4dae56d 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -464,6 +464,8 @@ namespace osu.Game.Tests.Visual.SongSelect manager.Import(testBeatmapSetInfo); }, 10); + AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); + AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID); Task?> updateTask = null!; @@ -476,6 +478,8 @@ namespace osu.Game.Tests.Visual.SongSelect }); AddUntilStep("wait for update completion", () => updateTask.IsCompleted); + AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); + AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID); } From bf668174ecc743f5941035a57fbbbcfa8d2278fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 19:02:23 +0100 Subject: [PATCH 224/567] Use nunit constraints in test for transparency --- osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 28b4dae56d..6af53df725 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -466,7 +466,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); - AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID); + AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID)); Task?> updateTask = null!; @@ -480,7 +480,7 @@ namespace osu.Game.Tests.Visual.SongSelect AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); - AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID == originalOnlineSetID); + AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID)); } [Test] From 9594ae7802fce0edea82d09d2bc2ecfe4bb50f85 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 03:22:22 +0900 Subject: [PATCH 225/567] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index bd35bb8d54..cf01f2f99b 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index 84a4e61267..c7b9d02b26 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From cc800a18b203e474fc9fe6d43f50c2bc4e63ea03 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 18 Dec 2023 21:11:00 +0100 Subject: [PATCH 226/567] Fix opening log files from notification not presenting the correct file --- osu.Game/OsuGame.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8d9e029c9d..e7ff99ef01 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -1190,7 +1190,7 @@ namespace osu.Game } else if (recentLogCount == short_term_display_limit) { - string logFile = $@"{entry.Target.Value.ToString().ToLowerInvariant()}.log"; + string logFile = Logger.GetLogger(entry.Target.Value).Filename; Schedule(() => Notifications.Post(new SimpleNotification { @@ -1198,7 +1198,7 @@ namespace osu.Game Text = NotificationsStrings.SubsequentMessagesLogged, Activated = () => { - Storage.GetStorageForDirectory(@"logs").PresentFileExternally(logFile); + Logger.Storage.PresentFileExternally(logFile); return true; } })); From 017003deea88739c244e88facd84252a940a6372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 21:56:56 +0100 Subject: [PATCH 227/567] Fix osu! standardised score conversion sometimes exceeding bounds Co-authored-by: Zyf Closes https://github.com/ppy/osu/issues/25860 Users reported that some stable scores would convert to large negative total scores in lazer after the introduction of combo exponent. Those large negative total scores were actually mangled NaNs. The root cause of this was the following calculation going below zero unexpectedly: https://github.com/ppy/osu/blob/8e8d9b2cd96be4c4b3d8f1f01dc013fc9d41f765/osu.Game/Database/StandardisedScoreMigrationTools.cs#L323 which then propagates negative numbers onward until https://github.com/ppy/osu/blob/8e8d9b2cd96be4c4b3d8f1f01dc013fc9d41f765/osu.Game/Database/StandardisedScoreMigrationTools.cs#L337 which yields a NaN due to attempting to take the square root of a negative number. To fix, clamp `comboPortionInScoreV1` to sane limits: to `comboPortionFromLongestComboInScoreV1` from below, and to `maximumAchievableComboPortionInScoreV1` from above. This is a less direct fix than perhaps imagined, but it seems like a better one as it will also affect the calculation of both the lower and the upper estimate of the score. --- .../Database/StandardisedScoreMigrationTools.cs | 15 +++++++++++++-- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 6484500bcc..a30c40fdb0 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -293,13 +293,24 @@ namespace osu.Game.Database // Roughly corresponds to integrating f(combo) = combo ^ COMBO_EXPONENT (omitting constants) double maximumAchievableComboPortionInStandardisedScore = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT); - double comboPortionInScoreV1 = maximumAchievableComboPortionInScoreV1 * comboProportion / score.Accuracy; - // This is - roughly - how much score, in the combo portion, the longest combo on this particular play would gain in score V1. double comboPortionFromLongestComboInScoreV1 = Math.Pow(score.MaxCombo, 2); // Same for standardised score. double comboPortionFromLongestComboInStandardisedScore = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT); + // We estimate the combo portion of the score in score V1 terms. + // The division by accuracy is supposed to lessen the impact of accuracy on the combo portion, + // but in some edge cases it cannot sanely undo it. + // Therefore the resultant value is clamped from both sides for sanity. + // The clamp from below to `comboPortionFromLongestComboInScoreV1` targets near-FC scores wherein + // the player had bad accuracy at the end of their longest combo, which causes the division by accuracy + // to underestimate the combo portion. + // The clamp from above to `maximumAchievableComboPortionInScoreV1` targets FC scores wherein + // the player had bad accuracy at the start of the map, which causes the division by accuracy + // to overestimate the combo portion. + double comboPortionInScoreV1 = Math.Clamp(maximumAchievableComboPortionInScoreV1 * comboProportion / score.Accuracy, + comboPortionFromLongestComboInScoreV1, maximumAchievableComboPortionInScoreV1); + // Calculate how many times the longest combo the user has achieved in the play can repeat // without exceeding the combo portion in score V1 as achieved by the player. // This is a pessimistic estimate; it intentionally does not operate on object count and uses only score instead. diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 00b1f04782..5c51e68d9f 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -32,9 +32,10 @@ namespace osu.Game.Scoring.Legacy /// 30000003: First version after converting legacy total score to standardised. /// 30000004: Fixed mod multipliers during legacy score conversion. Reconvert all scores. /// 30000005: Introduce combo exponent in the osu! gamemode. Reconvert all scores. + /// 30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000005; + public const int LATEST_VERSION = 30000006; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From 9c8df4e6d1a041c0b2fc19873aa8ae8e1d0d9fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 18 Dec 2023 22:23:58 +0100 Subject: [PATCH 228/567] Run score conversion for previously-imported scores --- osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs | 3 +++ osu.Game/BackgroundDataStoreProcessor.cs | 3 +-- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs index e65088ca2e..43ce7200d2 100644 --- a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs +++ b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs @@ -127,8 +127,11 @@ namespace osu.Game.Tests.Database }); } + [TestCase(30000001)] [TestCase(30000002)] [TestCase(30000003)] + [TestCase(30000004)] + [TestCase(30000005)] public void TestScoreUpgradeSuccess(int scoreVersion) { ScoreInfo scoreInfo = null!; diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 33b66ecfc7..0d5cb84359 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -316,8 +316,7 @@ namespace osu.Game HashSet scoreIds = realmAccess.Run(r => new HashSet(r.All() .Where(s => !s.BackgroundReprocessingFailed && s.BeatmapInfo != null - && (s.TotalScoreVersion == 30000002 - || s.TotalScoreVersion == 30000003)) + && s.TotalScoreVersion < LegacyScoreEncoder.LATEST_VERSION) .AsEnumerable().Select(s => s.ID))); Logger.Log($"Found {scoreIds.Count} scores which require total score conversion."); diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index a30c40fdb0..6980e81f58 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -26,7 +26,7 @@ namespace osu.Game.Database if (score.IsLegacyScore) return false; - if (score.TotalScoreVersion > 30000004) + if (score.TotalScoreVersion > 30000005) return false; // Recalculate the old-style standardised score to see if this was an old lazer score. From ee8a5d5a3077c5a1045ef74fc8b037296a26a005 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 13:33:45 +0900 Subject: [PATCH 229/567] Update bug-issue.yml with new workflow for exporting logs --- .github/ISSUE_TEMPLATE/bug-issue.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index ff6d869e72..17a3e1df41 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -46,22 +46,16 @@ body: value: | ## Logs - Attaching log files is required for every reported bug. See instructions below on how to find them. - - **Logs are reset when you reopen the game.** If the game crashed or has been closed since you found the bug, retrieve the logs using the file explorer instead. + Attaching log files is required for **every** issue, regardless of whether you deem them required or not. See instructions below on how to find them. ### Desktop platforms If the game has not yet been closed since you found the bug: - 1. Head on to game settings and click on "Open osu! folder" - 2. Then open the `logs` folder located there + 1. Head on to game settings and click on "Export logs" + 2. Click the notification to locate the file + 3. Drag the generated `.zip` files into the github issue window - The default places to find the logs on desktop platforms are as follows: - - `%AppData%/osu/logs` *on Windows* - - `~/.local/share/osu/logs` *on Linux* - - `~/Library/Application Support/osu/logs` *on macOS* - - If you have selected a custom location for the game files, you can find the `logs` folder there. + ![export logs button](https://github.com/ppy/osu/assets/191335/0866443f-0728-47bc-9dbd-f2b79ac802d5) ### Mobile platforms @@ -69,10 +63,6 @@ body: - *On Android*, navigate to `Android/data/sh.ppy.osulazer/files/logs` using a file browser app. - *On iOS*, connect your device to a PC and copy the `logs` directory from the app's document storage using iTunes. (https://support.apple.com/en-us/HT201301#copy-to-computer) - --- - - After locating the `logs` folder, select all log files inside and drag them into the "Logs" box below. - - type: textarea attributes: label: Logs From 469a659938dfb3c696c9a9fb51c7252214014a31 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 13:35:02 +0900 Subject: [PATCH 230/567] Fix arrow pointing to wrong place --- .github/ISSUE_TEMPLATE/bug-issue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index 17a3e1df41..00a873f9c8 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -53,9 +53,9 @@ body: If the game has not yet been closed since you found the bug: 1. Head on to game settings and click on "Export logs" 2. Click the notification to locate the file - 3. Drag the generated `.zip` files into the github issue window + 3. Drag the generated `.zip` files into the github issue window - ![export logs button](https://github.com/ppy/osu/assets/191335/0866443f-0728-47bc-9dbd-f2b79ac802d5) + ![export logs button](https://github.com/ppy/osu/assets/191335/cbfa5550-b7ed-4c5c-8dd0-8b87cc90ad9b) ### Mobile platforms From c1b55c7facaa675d62a68179657df8b9a1170846 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 13:48:46 +0900 Subject: [PATCH 231/567] Add ScoreProcessor methods to override numeric result --- .../Scoring/CatchScoreProcessor.cs | 2 +- .../Scoring/ManiaScoreProcessor.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 24 ++++++++++++++----- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 66c76f9b17..503252df02 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Scoring } protected override double GetComboScoreChange(JudgementResult result) - => Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); + => GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); public override ScoreRank RankFromAccuracy(double accuracy) { diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index c53f3c3e07..e5f9b33c6b 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Mania.Scoring } protected override double GetComboScoreChange(JudgementResult result) - => Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + => GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); private class JudgementOrderComparer : IComparer { diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index a77e6db6f3..a34e977ee9 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring protected override double GetComboScoreChange(JudgementResult result) { - return Judgement.ToNumericResult(result.Type) + return GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)) * strongScaleValue(result); } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index f110172988..aa8905c0b6 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -227,12 +227,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult); + currentMaximumBaseScore += GetMaxNumericResultFor(result); currentAccuracyJudgementCount++; } if (result.Type.AffectsAccuracy()) - currentBaseScore += Judgement.ToNumericResult(result.Type); + currentBaseScore += GetNumericResultFor(result); if (result.Type.IsBonus()) currentBonusPortion += GetBonusScoreChange(result); @@ -276,12 +276,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult); + currentMaximumBaseScore -= GetMaxNumericResultFor(result); currentAccuracyJudgementCount--; } if (result.Type.AffectsAccuracy()) - currentBaseScore -= Judgement.ToNumericResult(result.Type); + currentBaseScore -= GetNumericResultFor(result); if (result.Type.IsBonus()) currentBonusPortion -= GetBonusScoreChange(result); @@ -297,9 +297,21 @@ namespace osu.Game.Rulesets.Scoring updateScore(); } - protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type); + protected virtual double GetBonusScoreChange(JudgementResult result) => GetNumericResultFor(result); - protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Judgement.MaxResult) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); + protected virtual double GetComboScoreChange(JudgementResult result) => GetMaxNumericResultFor(result) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); + + /// + /// Retrieves the numeric score representation for a . + /// + /// The . + protected virtual double GetNumericResultFor(JudgementResult result) => result.Judgement.NumericResultFor(result); + + /// + /// Retrieves the maximum numeric score representation for a . + /// + /// The . + protected virtual double GetMaxNumericResultFor(JudgementResult result) => result.Judgement.MaxNumericResult; protected virtual void ApplyScoreChange(JudgementResult result) { From 35c0eaee1c5ff6a55609e61aa40c14c6a3645fe9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 13:50:46 +0900 Subject: [PATCH 232/567] Make taiko OKs worth 150 points --- .../Scoring/TaikoScoreProcessor.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index a34e977ee9..bc1e42c5d1 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -33,6 +33,17 @@ namespace osu.Game.Rulesets.Taiko.Scoring * strongScaleValue(result); } + protected override double GetNumericResultFor(JudgementResult result) + { + switch (result.Type) + { + case HitResult.Ok: + return 150; + } + + return base.GetNumericResultFor(result); + } + private double strongScaleValue(JudgementResult result) { if (result.HitObject is StrongNestedHitObject strong) From f2edb3ea54ef0bd5cbc181bd6b25a4ba20eaba8d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 14:01:08 +0900 Subject: [PATCH 233/567] Add test --- .../TestSceneTaikoScoreProcessor.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs diff --git a/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs new file mode 100644 index 0000000000..6f3b9f9748 --- /dev/null +++ b/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs @@ -0,0 +1,41 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Scoring; + +namespace osu.Game.Rulesets.Taiko.Tests +{ + [TestFixture] + public class TestSceneTaikoScoreProcessor + { + [Test] + public void TestInaccurateHitScore() + { + var beatmap = new Beatmap + { + HitObjects = + { + new Hit(), + new Hit { StartTime = 1000 } + } + }; + + var scoreProcessor = new TaikoScoreProcessor(); + scoreProcessor.ApplyBeatmap(beatmap); + + // Apply a miss judgement + scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new TaikoJudgement()) { Type = HitResult.Great }); + scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[1], new TaikoJudgement()) { Type = HitResult.Ok }); + + Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(453745)); + Assert.That(scoreProcessor.Accuracy.Value, Is.EqualTo(0.75).Within(0.0001)); + } + } +} From 30957f847cdca20f1ee3a8619c406808289080a0 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 14:27:29 +0900 Subject: [PATCH 234/567] Rename class/file (this is not a test scene) --- ...stSceneTaikoScoreProcessor.cs => TaikoScoreProcessorTest.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename osu.Game.Rulesets.Taiko.Tests/{TestSceneTaikoScoreProcessor.cs => TaikoScoreProcessorTest.cs} (96%) diff --git a/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko.Tests/TaikoScoreProcessorTest.cs similarity index 96% rename from osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs rename to osu.Game.Rulesets.Taiko.Tests/TaikoScoreProcessorTest.cs index 6f3b9f9748..d74fe99a9f 100644 --- a/osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko.Tests/TaikoScoreProcessorTest.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Taiko.Scoring; namespace osu.Game.Rulesets.Taiko.Tests { [TestFixture] - public class TestSceneTaikoScoreProcessor + public class TaikoScoreProcessorTest { [Test] public void TestInaccurateHitScore() From 44efa2c540c392c998af7cd052a88d35d053aa5b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 15:09:03 +0900 Subject: [PATCH 235/567] Fix incorrect ordering of items at song select when certain sort modes are used --- .../Screens/Select/Carousel/CarouselGroup.cs | 2 +- osu.Game/Screens/Select/FilterCriteria.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index c353ee98ae..be841465bf 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -87,7 +87,7 @@ namespace osu.Game.Screens.Select.Carousel items.ForEach(c => c.Filter(criteria)); // Sorting is expensive, so only perform if it's actually changed. - if (lastCriteria?.Sort != criteria.Sort) + if (lastCriteria?.RequiresSorting(criteria) != false) { criteriaComparer = Comparer.Create((x, y) => { diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 811f623ee5..0bea2247ce 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -219,6 +219,44 @@ namespace osu.Game.Screens.Select public bool Equals(OptionalTextFilter other) => SearchTerm == other.SearchTerm; } + /// + /// Given a new filter criteria, decide whether a full sort needs to be performed. + /// + /// + /// + public bool RequiresSorting(FilterCriteria newCriteria) + { + if (Sort != newCriteria.Sort) + return true; + + switch (Sort) + { + // Some sorts are stable across all other changes. + // Running these sorts will sort all items, including currently hidden items. + case SortMode.Artist: + case SortMode.Author: + case SortMode.DateSubmitted: + case SortMode.DateAdded: + case SortMode.DateRanked: + case SortMode.Source: + case SortMode.Title: + return false; + + // Some sorts use aggregate max comparisons, which will change based on filtered items. + // These sorts generally ignore items hidden by filtered state, so we must force a sort under all circumstances here. + // + // This makes things very slow when typing a text search, and we probably want to consider a way to optimise things going forward. + case SortMode.LastPlayed: + case SortMode.BPM: + case SortMode.Length: + case SortMode.Difficulty: + return true; + + default: + throw new ArgumentOutOfRangeException(); + } + } + public enum MatchMode { /// From ddb67c87a8c20680c6ef77d8faa512b50d090be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 19 Dec 2023 08:13:02 +0100 Subject: [PATCH 236/567] Roll back incorrect change in `ShouldMigrateToNewStandardised()` --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 6980e81f58..11eacd1c6b 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -26,7 +26,7 @@ namespace osu.Game.Database if (score.IsLegacyScore) return false; - if (score.TotalScoreVersion > 30000005) + if (score.TotalScoreVersion > 30000002) return false; // Recalculate the old-style standardised score to see if this was an old lazer score. From 011bd61e7d3f7301fd00bd5acd0d89120a92b61a Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 16:47:49 +0900 Subject: [PATCH 237/567] Give sliders in test scene a sample --- .../TestSceneSliderEarlyHitJudgement.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs index 9caee86a32..4ea21e51f6 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Screens; +using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Replays; using osu.Game.Rulesets.Judgements; @@ -160,6 +161,10 @@ namespace osu.Game.Rulesets.Osu.Tests Position = new Vector2(256 - slider_path_length / 2, 192), TickDistanceMultiplier = 3, ClassicSliderBehaviour = classic, + Samples = new[] + { + new HitSampleInfo(HitSampleInfo.HIT_NORMAL) + }, Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, From 7c05d66bd7913c3f7aa1a569af5fa1dd901c58dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 19 Dec 2023 08:57:18 +0100 Subject: [PATCH 238/567] Add more detail to exception --- osu.Game/Screens/Select/FilterCriteria.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 0bea2247ce..a7c8e7d093 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -253,7 +253,7 @@ namespace osu.Game.Screens.Select return true; default: - throw new ArgumentOutOfRangeException(); + throw new ArgumentOutOfRangeException(nameof(Sort), Sort, "Unknown sort mode"); } } From fe5e071e70cbd0a24f555fb9255dfa957246eb36 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 19 Dec 2023 17:01:52 +0900 Subject: [PATCH 239/567] Fix sliding sample playing before Slider's start time --- .../Objects/Drawables/DrawableSlider.cs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 1f9a028045..b306fd38c1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -128,8 +128,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var drawableHitObject in NestedHitObjects) drawableHitObject.AccentColour.Value = colour.NewValue; }, true); - - Tracking.BindValueChanged(updateSlidingSample); } protected override void OnApply() @@ -166,14 +164,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables slidingSample?.Stop(); } - private void updateSlidingSample(ValueChangedEvent tracking) - { - if (tracking.NewValue) - slidingSample?.Play(); - else - slidingSample?.Stop(); - } - protected override void AddNestedHitObject(DrawableHitObject hitObject) { base.AddNestedHitObject(hitObject); @@ -238,9 +228,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Tracking.Value = SliderInputManager.Tracking; - if (Tracking.Value && slidingSample != null) - // keep the sliding sample playing at the current tracking position - slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball)); + if (slidingSample != null) + { + if (Tracking.Value && Time.Current >= HitObject.StartTime) + { + // keep the sliding sample playing at the current tracking position + if (!slidingSample.IsPlaying) + slidingSample.Play(); + slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball)); + } + else if (slidingSample.IsPlaying) + slidingSample.Stop(); + } double completionProgress = Math.Clamp((Time.Current - HitObject.StartTime) / HitObject.Duration, 0, 1); From 7e9c1b2acbaabb19564821d748deb2c97a964554 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 17:27:52 +0900 Subject: [PATCH 240/567] Use `sender`'s realm (because we can) --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 607b891beb..4c6c67c348 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -320,7 +320,7 @@ namespace osu.Game.Screens.Select // To handle the beatmap update flow, attempt to track selection changes across delete-insert transactions. // When an update occurs, the previous beatmap set is either soft or hard deleted. // Check if the current selection was potentially deleted by re-querying its validity. - bool selectedSetMarkedDeleted = realm.Run(r => r.Find(SelectedBeatmapSet.ID))?.DeletePending != false; + bool selectedSetMarkedDeleted = sender.Realm.Find(SelectedBeatmapSet.ID)?.DeletePending != false; int[] modifiedAndInserted = changes.NewModifiedIndices.Concat(changes.InsertedIndices).ToArray(); From 8f5d21dc703e3c1f3930e4b4e1c58c90acaba87a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 18:10:55 +0900 Subject: [PATCH 241/567] Actually fix realm selection retention regression --- .../SongSelect/TestScenePlaySongSelect.cs | 4 ---- osu.Game/Screens/Select/BeatmapCarousel.cs | 24 +++++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 6af53df725..518035fb82 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -464,8 +464,6 @@ namespace osu.Game.Tests.Visual.SongSelect manager.Import(testBeatmapSetInfo); }, 10); - AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); - AddUntilStep("has selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID)); Task?> updateTask = null!; @@ -478,8 +476,6 @@ namespace osu.Game.Tests.Visual.SongSelect }); AddUntilStep("wait for update completion", () => updateTask.IsCompleted); - AddStep("Force realm refresh", () => Realm.Run(r => r.Refresh())); - AddUntilStep("retained selection", () => songSelect!.Carousel.SelectedBeatmapInfo?.BeatmapSet?.OnlineID, () => Is.EqualTo(originalOnlineSetID)); } diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 4c6c67c348..47cdbe34f4 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -269,8 +269,28 @@ namespace osu.Game.Screens.Select if (changes == null) return; - foreach (int i in changes.InsertedIndices) - removeBeatmapSet(sender[i].ID); + var removeableSets = changes.InsertedIndices.Select(i => sender[i].ID).ToHashSet(); + + // This schedule is required to retain selection of beatmaps over an ImportAsUpdate operation. + // This is covered by TestPlaySongSelect.TestSelectionRetainedOnBeatmapUpdate. + // + // In short, we have specialised logic in `beatmapSetsChanged` (directly below) to infer that an + // update operation has occurred. For this to work, we need to confirm the `DeletePending` flag + // of the current selection. + // + // If we don't schedule the following code, it is possible for the `deleteBeatmapSetsChanged` handler + // to be invoked before the `beatmapSetsChanged` handler (realm call order seems non-deterministic) + // which will lead to the currently selected beatmap changing via `CarouselGroupEagerSelect`. + // + // We need a better path forward here. A few ideas: + // - Avoid the necessity of having realm subscriptions on deleted/hidden items, maybe by storing all guids in realm + // to a local list so we can better look them up on receiving `DeletedIndices`. + // - Add a new property on `BeatmapSetInfo` to link to the pre-update set, and use that to handle the update case. + Schedule(() => + { + foreach (var set in removeableSets) + removeBeatmapSet(set); + }); } private void beatmapSetsChanged(IRealmCollection sender, ChangeSet? changes) From f09c6b8c1ba778d2a5a6f6f3c29de875bc3dc7a3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 18:20:02 +0900 Subject: [PATCH 242/567] Change default values of new object counts to `-1` to identify non-processed values --- osu.Game/BackgroundDataStoreProcessor.cs | 2 +- osu.Game/Beatmaps/BeatmapInfo.cs | 4 ++-- osu.Game/Beatmaps/IBeatmapInfo.cs | 3 +++ osu.Game/Database/RealmAccess.cs | 17 ++++++++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 33b66ecfc7..d4cd1ff6ea 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -196,7 +196,7 @@ namespace osu.Game realmAccess.Run(r => { - foreach (var b in r.All().Where(b => b.TotalObjectCount == 0)) + foreach (var b in r.All().Where(b => b.TotalObjectCount < 0 || b.EndTimeObjectCount < 0)) beatmapIds.Add(b.ID); }); diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index 2d04732f91..425fd98d27 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -120,9 +120,9 @@ namespace osu.Game.Beatmaps [JsonIgnore] public bool Hidden { get; set; } - public int EndTimeObjectCount { get; set; } + public int EndTimeObjectCount { get; set; } = -1; - public int TotalObjectCount { get; set; } + public int TotalObjectCount { get; set; } = -1; /// /// Reset any fetched online linking information (and history). diff --git a/osu.Game/Beatmaps/IBeatmapInfo.cs b/osu.Game/Beatmaps/IBeatmapInfo.cs index 9dcff5ce5e..04c2017ded 100644 --- a/osu.Game/Beatmaps/IBeatmapInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapInfo.cs @@ -59,11 +59,13 @@ namespace osu.Game.Beatmaps /// /// The basic star rating for this beatmap (with no mods applied). + /// Defaults to -1 (meaning not-yet-calculated). /// double StarRating { get; } /// /// The number of hitobjects in the beatmap with a distinct end time. + /// Defaults to -1 (meaning not-yet-calculated). /// /// /// Canonically, these are hitobjects are either sliders or spinners. @@ -72,6 +74,7 @@ namespace osu.Game.Beatmaps /// /// The total number of hitobjects in the beatmap. + /// Defaults to -1 (meaning not-yet-calculated). /// int TotalObjectCount { get; } } diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index 191bb49b0c..ad61292c2e 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -89,8 +89,9 @@ namespace osu.Game.Database /// 35 2023-10-16 Clear key combinations of keybindings that are assigned to more than one action in a given settings section. /// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs. /// 38 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapInfo. + /// 39 2023-12-19 Migrate any EndTimeObjectCount and TotalObjectCount values of 0 to -1 to better identify non-calculated values. /// - private const int schema_version = 38; + private const int schema_version = 39; /// /// Lock object which is held during sections, blocking realm retrieval during blocking periods. @@ -1095,6 +1096,20 @@ namespace osu.Game.Database break; } + + case 39: + foreach (var b in migration.NewRealm.All()) + { + // Either actually no objects, or processing ran and failed. + // Reset to -1 so the next time they become zero we know that processing was attempted. + if (b.TotalObjectCount == 0 && b.EndTimeObjectCount == 0) + { + b.TotalObjectCount = -1; + b.EndTimeObjectCount = -1; + } + } + + break; } Logger.Log($"Migration completed in {stopwatch.ElapsedMilliseconds}ms"); From 372f930f8bd17b6ab4b928805fa4ee78a2100a48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 18:27:44 +0900 Subject: [PATCH 243/567] Refactor usage of object counts for mania key count lookup to be a bit safer Protects against non-initialised values and also div-by-zero. --- .../Beatmaps/ManiaBeatmapConverter.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index a496049729..def22608d6 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -59,23 +59,26 @@ namespace osu.Game.Rulesets.Mania.Beatmaps { double roundedCircleSize = Math.Round(difficulty.CircleSize); - if (new ManiaRuleset().RulesetInfo.Equals(difficulty.SourceRuleset)) + if (difficulty.SourceRuleset.ShortName == ManiaRuleset.SHORT_NAME) return (int)Math.Max(1, roundedCircleSize); double roundedOverallDifficulty = Math.Round(difficulty.OverallDifficulty); - int countSliderOrSpinner = difficulty.EndTimeObjectCount; + if (difficulty.TotalObjectCount > 0 && difficulty.EndTimeObjectCount >= 0) + { + int countSliderOrSpinner = difficulty.EndTimeObjectCount; - // In osu!stable, this division appears as if it happens on floats, but due to release-mode - // optimisations, it actually ends up happening on doubles. - double percentSpecialObjects = (double)countSliderOrSpinner / difficulty.TotalObjectCount; + // In osu!stable, this division appears as if it happens on floats, but due to release-mode + // optimisations, it actually ends up happening on doubles. + double percentSpecialObjects = (double)countSliderOrSpinner / difficulty.TotalObjectCount; - if (percentSpecialObjects < 0.2) - return 7; - if (percentSpecialObjects < 0.3 || roundedCircleSize >= 5) - return roundedOverallDifficulty > 5 ? 7 : 6; - if (percentSpecialObjects > 0.6) - return roundedOverallDifficulty > 4 ? 5 : 4; + if (percentSpecialObjects < 0.2) + return 7; + if (percentSpecialObjects < 0.3 || roundedCircleSize >= 5) + return roundedOverallDifficulty > 5 ? 7 : 6; + if (percentSpecialObjects > 0.6) + return roundedOverallDifficulty > 4 ? 5 : 4; + } return Math.Max(4, Math.Min((int)roundedOverallDifficulty + 1, 7)); } From 0a64d631e2af017dd042b8786201fd64de7b6e36 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:09:47 +0900 Subject: [PATCH 244/567] Add support for dual-column advanced stats --- .../Screens/Select/Details/AdvancedStats.cs | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index ee805c2d12..3254ac4d99 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -64,21 +64,43 @@ namespace osu.Game.Screens.Select.Details } } - public AdvancedStats() + public AdvancedStats(int columns = 1) { - Child = new FillFlowContainer + switch (columns) { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Children = new[] - { - FirstValue = new StatisticRow(), // circle size/key amount - HpDrain = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsDrain }, - Accuracy = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAccuracy }, - ApproachRate = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAr }, - starDifficulty = new StatisticRow(10, true) { Title = BeatmapsetsStrings.ShowStatsStars }, - }, - }; + case 1: + Child = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new[] + { + FirstValue = new StatisticRow(), // circle size/key amount + HpDrain = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsDrain }, + Accuracy = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAccuracy }, + ApproachRate = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAr }, + starDifficulty = new StatisticRow(10, true) { Title = BeatmapsetsStrings.ShowStatsStars }, + }, + }; + break; + + case 2: + Child = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Full, + Children = new[] + { + FirstValue = new StatisticRow { Width = 0.5f }, // circle size/key amount + HpDrain = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsDrain, Width = 0.5f }, + Accuracy = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAccuracy, Width = 0.5f }, + ApproachRate = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAr, Width = 0.5f }, + starDifficulty = new StatisticRow(10, true) { Title = BeatmapsetsStrings.ShowStatsStars, Width = 0.5f }, + }, + }; + break; + } } [BackgroundDependencyLoader] From 07bb0805e9b1980ed26212ab485193b28fa11baf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:09:56 +0900 Subject: [PATCH 245/567] Move advanced stats to a more permanent location on song select --- osu.Game/Screens/Select/BeatmapDetails.cs | 8 --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 55 ++++++++++++++++++++- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 179323176a..e1166b5abe 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -28,7 +28,6 @@ namespace osu.Game.Screens.Select private const float spacing = 10; private const float transition_duration = 250; - private readonly AdvancedStats advanced; private readonly UserRatings ratingsDisplay; private readonly MetadataSection description, source, tags; private readonly Container failRetryContainer; @@ -109,12 +108,6 @@ namespace osu.Game.Screens.Select Padding = new MarginPadding { Right = spacing / 2 }, Children = new[] { - new DetailBox().WithChild(advanced = new AdvancedStats - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Horizontal = spacing, Top = spacing * 2, Bottom = spacing }, - }), new DetailBox().WithChild(new OnlineViewContainer(string.Empty) { RelativeSizeAxes = Axes.X, @@ -180,7 +173,6 @@ namespace osu.Game.Screens.Select private void updateStatistics() { - advanced.BeatmapInfo = BeatmapInfo; description.Metadata = BeatmapInfo?.DifficultyName ?? string.Empty; source.Metadata = BeatmapInfo?.Metadata.Source ?? string.Empty; tags.Metadata = BeatmapInfo?.Metadata.Tags ?? string.Empty; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 8bbf569566..a9ac30394f 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -305,7 +305,7 @@ namespace osu.Game.Screens.Select }, infoLabelContainer = new FillFlowContainer { - Margin = new MarginPadding { Top = 20 }, + Margin = new MarginPadding { Top = 8 }, Spacing = new Vector2(20, 0), AutoSizeAxes = Axes.Both, } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index dfea4e3794..0f2b49f9bf 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -13,6 +13,8 @@ using osu.Framework.Bindables; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Effects; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Bindings; @@ -35,6 +37,7 @@ using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; using osu.Game.Screens.Menu; using osu.Game.Screens.Play; +using osu.Game.Screens.Select.Details; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; using osuTK; @@ -45,7 +48,7 @@ namespace osu.Game.Screens.Select { public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler { - public static readonly float WEDGE_HEIGHT = 245; + public static readonly float WEDGE_HEIGHT = 200; protected const float BACKGROUND_BLUR = 20; private const float left_area_padding = 20; @@ -132,6 +135,8 @@ namespace osu.Game.Screens.Select private IDisposable? modSelectOverlayRegistration; + private AdvancedStats advancedStats = null!; + [Resolved] private MusicController music { get; set; } = null!; @@ -253,12 +258,56 @@ namespace osu.Game.Screens.Select }, }, new Container + { + RelativeSizeAxes = Axes.X, + Height = 90, + Padding = new MarginPadding(10) + { + Left = left_area_padding, + Right = left_area_padding * 2, + }, + Y = WEDGE_HEIGHT, + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = 10, + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Hollow = true, + Colour = new Color4(130, 204, 255, 15), + Radius = 10, + }, + Children = new Drawable[] + { + new Box + { + Colour = new Color4(130, 204, 255, 40), + Blending = BlendingParameters.Additive, + RelativeSizeAxes = Axes.Both, + }, + advancedStats = new AdvancedStats(2) + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.8f, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + } + }, + } + }, + new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Bottom = Footer.HEIGHT, - Top = WEDGE_HEIGHT, + Top = WEDGE_HEIGHT + 70, Left = left_area_padding, Right = left_area_padding * 2, }, @@ -797,6 +846,8 @@ namespace osu.Game.Screens.Select ModSelect.Beatmap = beatmap; + advancedStats.BeatmapInfo = beatmap.BeatmapInfo; + bool beatmapSelected = beatmap is not DummyWorkingBeatmap; if (beatmapSelected) From 3b848e85037a28afcc9fa43d99603af1c5cf456f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:18:36 +0900 Subject: [PATCH 246/567] Tidy up visual look --- osu.Game/Screens/Select/BeatmapDetails.cs | 24 +++++++---- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- .../Screens/Select/Details/AdvancedStats.cs | 43 ++++++++++++------- osu.Game/Screens/Select/SongSelect.cs | 4 +- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index e1166b5abe..679ebfcf48 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -3,9 +3,9 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps; using osu.Game.Graphics; @@ -67,12 +67,24 @@ namespace osu.Game.Screens.Select public BeatmapDetails() { + CornerRadius = 10; + Masking = true; + + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Hollow = true, + Colour = new Color4(130, 204, 255, 15), + Radius = 10, + }; + Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.5f), + Colour = new Color4(130, 204, 255, 40), + Blending = BlendingParameters.Additive, }, new Container { @@ -122,7 +134,8 @@ namespace osu.Game.Screens.Select }, new OsuScrollContainer { - RelativeSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.X, + Height = 250, Width = 0.5f, ScrollbarVisible = false, Padding = new MarginPadding { Left = spacing / 2 }, @@ -271,11 +284,6 @@ namespace osu.Game.Screens.Select InternalChildren = new Drawable[] { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.5f), - }, content = new Container { RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index a9ac30394f..2613857998 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select { Type = EdgeEffectType.Glow, Colour = new Color4(130, 204, 255, 150), - Radius = 20, + Radius = 15, Roundness = 15, }; } diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 3254ac4d99..66a913fda1 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -311,23 +311,36 @@ namespace osu.Game.Screens.Select.Details Font = OsuFont.GetFont(size: 12) }, }, - bar = new Bar + new Container { - Origin = Anchor.CentreLeft, - Anchor = Anchor.CentreLeft, - RelativeSizeAxes = Axes.X, - Height = 5, - BackgroundColour = Color4.White.Opacity(0.5f), - Padding = new MarginPadding { Left = name_width + 10, Right = value_width + 10 }, - }, - ModBar = new Bar - { - Origin = Anchor.CentreLeft, - Anchor = Anchor.CentreLeft, - RelativeSizeAxes = Axes.X, - Alpha = 0.5f, - Height = 5, + RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = name_width + 10, Right = value_width + 10 }, + Children = new Drawable[] + { + new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + RelativeSizeAxes = Axes.X, + Height = 5, + + CornerRadius = 2, + Masking = true, + Children = new Drawable[] + { + bar = new Bar + { + RelativeSizeAxes = Axes.Both, + BackgroundColour = Color4.White.Opacity(0.5f), + }, + ModBar = new Bar + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + }, + } + }, + } }, new Container { diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 0f2b49f9bf..208a8eb321 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -240,7 +240,7 @@ namespace osu.Game.Screens.Select Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = left_area_padding }, + Padding = new MarginPadding { Top = 5 }, Children = new Drawable[] { new LeftSideInteractionContainer(() => Carousel.ScrollToSelected()) @@ -264,7 +264,7 @@ namespace osu.Game.Screens.Select Padding = new MarginPadding(10) { Left = left_area_padding, - Right = left_area_padding * 2, + Right = left_area_padding * 2 + 5, }, Y = WEDGE_HEIGHT, Children = new Drawable[] From 2c5ca9c1c88b6c80cea70d47d5fdb121825e0146 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:31:05 +0900 Subject: [PATCH 247/567] Change default song select tab display to local leaderboard --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ea526c6d54..0df870655f 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -37,7 +37,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.Ruleset, string.Empty); SetDefault(OsuSetting.Skin, SkinInfo.ARGON_SKIN.ToString()); - SetDefault(OsuSetting.BeatmapDetailTab, PlayBeatmapDetailArea.TabType.Details); + SetDefault(OsuSetting.BeatmapDetailTab, PlayBeatmapDetailArea.TabType.Local); SetDefault(OsuSetting.BeatmapDetailModsFilter, false); SetDefault(OsuSetting.ShowConvertedBeatmaps, true); From 502e3edac3ea2c5082718ca49d87064fdea4e92e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:39:48 +0900 Subject: [PATCH 248/567] Add missing invalidation call --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 47cdbe34f4..fe7eee701f 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -290,6 +290,8 @@ namespace osu.Game.Screens.Select { foreach (var set in removeableSets) removeBeatmapSet(set); + + invalidateAfterChange(); }); } From c556475c2c3522729cc1cf17b02b1497730d6e66 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:46:30 +0900 Subject: [PATCH 249/567] Revert to using a more manual approach to holding focus --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 30d7b6191e..baa7e594c1 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -132,6 +132,8 @@ namespace osu.Game.Overlays.Mods protected ShearedToggleButton? CustomisationButton { get; private set; } protected SelectAllModsButton? SelectAllModsButton { get; set; } + private bool textBoxShouldFocus; + private Sample? columnAppearSample; private WorkingBeatmap? beatmap; @@ -510,9 +512,9 @@ namespace osu.Game.Overlays.Mods TopLevelContent.MoveToY(-modAreaHeight, transition_duration, Easing.InOutCubic); if (customisationVisible.Value) - GetContainingInputManager().ChangeFocus(modSettingsArea); + SearchTextBox.KillFocus(); else - Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null)); + setTextBoxFocus(textBoxShouldFocus); } /// @@ -626,8 +628,7 @@ namespace osu.Game.Overlays.Mods nonFilteredColumnCount += 1; } - if (textSearchStartsActive.Value) - SearchTextBox.HoldFocus = true; + setTextBoxFocus(textSearchStartsActive.Value); } protected override void PopOut() @@ -766,12 +767,20 @@ namespace osu.Game.Overlays.Mods return false; // TODO: should probably eventually support typical platform search shortcuts (`Ctrl-F`, `/`) - SearchTextBox.HoldFocus = !SearchTextBox.HoldFocus; - if (SearchTextBox.HoldFocus) - SearchTextBox.TakeFocus(); + setTextBoxFocus(!textBoxShouldFocus); return true; } + private void setTextBoxFocus(bool keepFocus) + { + textBoxShouldFocus = keepFocus; + + if (textBoxShouldFocus) + SearchTextBox.TakeFocus(); + else + SearchTextBox.KillFocus(); + } + #endregion #region Sample playback control From bbfdd6892ded1baf4e1d3da372e7678fe3e84d1e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 19 Dec 2023 19:58:49 +0900 Subject: [PATCH 250/567] Allow choosing "Edit" from any beatmap carousel item --- osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs | 2 +- .../Select/Carousel/CarouselGroupEagerSelect.cs | 2 +- .../Screens/Select/Carousel/DrawableCarouselBeatmap.cs | 2 +- .../Select/Carousel/DrawableCarouselBeatmapSet.cs | 10 +++++++++- osu.Game/Screens/Select/PlaySongSelect.cs | 7 ++++--- osu.Game/Screens/Select/SongSelect.cs | 6 +++--- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs index 67822a27ee..6d2e938fb7 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs @@ -45,7 +45,7 @@ namespace osu.Game.Screens.Select.Carousel .ForEach(AddItem); } - protected override CarouselItem? GetNextToSelect() + public override CarouselItem? GetNextToSelect() { if (LastSelected == null || LastSelected.Filtered.Value) { diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index 7f90e05744..b4313c1895 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -110,7 +110,7 @@ namespace osu.Game.Screens.Select.Carousel /// Finds the item this group would select next if it attempted selection /// /// An unfiltered item nearest to the last selected one or null if all items are filtered - protected virtual CarouselItem? GetNextToSelect() + public virtual CarouselItem? GetNextToSelect() { if (Items.Count == 0) return null; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index 3c64df656d..baf0a14062 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -91,7 +91,7 @@ namespace osu.Game.Screens.Select.Carousel if (songSelect != null) { - mainMenuItems = songSelect.CreateForwardNavigationMenuItemsForBeatmap(beatmapInfo); + mainMenuItems = songSelect.CreateForwardNavigationMenuItemsForBeatmap(() => beatmapInfo); selectRequested = b => songSelect.FinaliseSelection(b); } diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index dd711b2513..f16e92a82a 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -44,6 +44,8 @@ namespace osu.Game.Screens.Select.Carousel private Task? beatmapsLoadTask; + private MenuItem[]? mainMenuItems; + [Resolved] private BeatmapManager manager { get; set; } = null!; @@ -57,8 +59,11 @@ namespace osu.Game.Screens.Select.Carousel } [BackgroundDependencyLoader] - private void load(BeatmapSetOverlay? beatmapOverlay) + private void load(BeatmapSetOverlay? beatmapOverlay, SongSelect? songSelect) { + if (songSelect != null) + mainMenuItems = songSelect.CreateForwardNavigationMenuItemsForBeatmap(() => (((CarouselBeatmapSet)Item!).GetNextToSelect() as CarouselBeatmap)!.BeatmapInfo); + restoreHiddenRequested = s => { foreach (var b in s.Beatmaps) @@ -222,6 +227,9 @@ namespace osu.Game.Screens.Select.Carousel if (Item?.State.Value == CarouselItemState.NotSelected) items.Add(new OsuMenuItem("Expand", MenuItemType.Highlighted, () => Item.State.Value = CarouselItemState.Selected)); + if (mainMenuItems != null) + items.AddRange(mainMenuItems); + if (beatmapSet.OnlineID > 0 && viewDetails != null) items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => viewDetails(beatmapSet.OnlineID))); diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 86bebdc2ff..7b7b8857f3 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; @@ -34,10 +35,10 @@ namespace osu.Game.Screens.Select public override bool AllowExternalScreenChange => true; - public override MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(BeatmapInfo beatmap) => new MenuItem[] + public override MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(Func getBeatmap) => new MenuItem[] { - new OsuMenuItem(ButtonSystemStrings.Play.ToSentence(), MenuItemType.Highlighted, () => FinaliseSelection(beatmap)), - new OsuMenuItem(ButtonSystemStrings.Edit.ToSentence(), MenuItemType.Standard, () => Edit(beatmap)) + new OsuMenuItem(ButtonSystemStrings.Play.ToSentence(), MenuItemType.Highlighted, () => FinaliseSelection(getBeatmap())), + new OsuMenuItem(ButtonSystemStrings.Edit.ToSentence(), MenuItemType.Standard, () => Edit(getBeatmap())) }; protected override UserActivity InitialActivity => new UserActivity.ChoosingBeatmap(); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index dfea4e3794..f4d1028747 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -89,11 +89,11 @@ namespace osu.Game.Screens.Select /// Creates any "action" menu items for the provided beatmap (ie. "Select", "Play", "Edit"). /// These will always be placed at the top of the context menu, with common items added below them. /// - /// The beatmap to create items for. + /// The beatmap to create items for. /// The menu items. - public virtual MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(BeatmapInfo beatmap) => new MenuItem[] + public virtual MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(Func getBeatmap) => new MenuItem[] { - new OsuMenuItem(@"Select", MenuItemType.Highlighted, () => FinaliseSelection(beatmap)) + new OsuMenuItem(@"Select", MenuItemType.Highlighted, () => FinaliseSelection(getBeatmap())) }; [Resolved] From d793d1cea16de4098c58fb5c50a3e20142a7a996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 19 Dec 2023 14:52:16 +0100 Subject: [PATCH 251/567] Add test coverage of desired input handling behaviour --- .../TestSceneModSelectOverlay.cs | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs index 80be4412b3..4b101a52f4 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneModSelectOverlay.cs @@ -572,7 +572,7 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestTextSearchActiveByDefault() { - configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true); + AddStep("text search starts active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true)); createScreen(); AddUntilStep("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus); @@ -587,7 +587,7 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestTextSearchNotActiveByDefault() { - configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, false); + AddStep("text search does not start active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, false)); createScreen(); AddUntilStep("search text box not focused", () => !modSelectOverlay.SearchTextBox.HasFocus); @@ -599,6 +599,31 @@ namespace osu.Game.Tests.Visual.UserInterface AddAssert("search text box unfocused", () => !modSelectOverlay.SearchTextBox.HasFocus); } + [Test] + public void TestTextSearchDoesNotBlockCustomisationPanelKeyboardInteractions() + { + AddStep("text search starts active", () => configManager.SetValue(OsuSetting.ModSelectTextSearchStartsActive, true)); + createScreen(); + + AddUntilStep("search text box focused", () => modSelectOverlay.SearchTextBox.HasFocus); + + AddStep("select DT", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime() }); + AddAssert("DT selected", () => modSelectOverlay.ChildrenOfType().Count(panel => panel.Active.Value), () => Is.EqualTo(1)); + + AddStep("open customisation area", () => modSelectOverlay.CustomisationButton!.TriggerClick()); + assertCustomisationToggleState(false, true); + AddStep("hover over mod settings slider", () => + { + var slider = modSelectOverlay.ChildrenOfType().Single().ChildrenOfType>().First(); + InputManager.MoveMouseTo(slider); + }); + AddStep("press right arrow", () => InputManager.PressKey(Key.Right)); + AddAssert("DT speed changed", () => !SelectedMods.Value.OfType().Single().SpeedChange.IsDefault); + + AddStep("close customisation area", () => InputManager.PressKey(Key.Escape)); + AddUntilStep("search text box reacquired focus", () => modSelectOverlay.SearchTextBox.HasFocus); + } + [Test] public void TestDeselectAllViaKey() { From 3f41c20ac6badc09efb5cf61205ecc106c1cabc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 19 Dec 2023 17:25:15 +0100 Subject: [PATCH 252/567] Use safer fix for now --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 11eacd1c6b..d2321f4fc4 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -305,11 +305,10 @@ namespace osu.Game.Database // The clamp from below to `comboPortionFromLongestComboInScoreV1` targets near-FC scores wherein // the player had bad accuracy at the end of their longest combo, which causes the division by accuracy // to underestimate the combo portion. - // The clamp from above to `maximumAchievableComboPortionInScoreV1` targets FC scores wherein - // the player had bad accuracy at the start of the map, which causes the division by accuracy - // to overestimate the combo portion. - double comboPortionInScoreV1 = Math.Clamp(maximumAchievableComboPortionInScoreV1 * comboProportion / score.Accuracy, - comboPortionFromLongestComboInScoreV1, maximumAchievableComboPortionInScoreV1); + // Ideally, this would be clamped from above to `maximumAchievableComboPortionInScoreV1` too, + // but in practice this appears to fail for some scores (https://github.com/ppy/osu/pull/25876#issuecomment-1862248413). + // TODO: investigate the above more closely + double comboPortionInScoreV1 = Math.Max(maximumAchievableComboPortionInScoreV1 * comboProportion / score.Accuracy, comboPortionFromLongestComboInScoreV1); // Calculate how many times the longest combo the user has achieved in the play can repeat // without exceeding the combo portion in score V1 as achieved by the player. From ec578e1d9f62697eee1b2b0b9f53c6a7727c0ca7 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Tue, 19 Dec 2023 21:20:21 +0100 Subject: [PATCH 253/567] fix near-zero length sliders n stuff being placeable --- .../Edit/Blueprints/BananaShowerPlacementBlueprint.cs | 3 ++- .../Edit/Blueprints/JuiceStreamPlacementBlueprint.cs | 3 ++- .../Edit/Blueprints/HoldNotePlacementBlueprint.cs | 3 ++- .../Edit/Blueprints/TaikoSpanPlacementBlueprint.cs | 3 ++- osu.Game/Rulesets/Objects/SliderPath.cs | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Edit/Blueprints/BananaShowerPlacementBlueprint.cs b/osu.Game.Rulesets.Catch/Edit/Blueprints/BananaShowerPlacementBlueprint.cs index 1e63d32c41..6902f78172 100644 --- a/osu.Game.Rulesets.Catch/Edit/Blueprints/BananaShowerPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Catch/Edit/Blueprints/BananaShowerPlacementBlueprint.cs @@ -3,6 +3,7 @@ using System; using osu.Framework.Input.Events; +using osu.Framework.Utils; using osu.Game.Rulesets.Catch.Edit.Blueprints.Components; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Edit; @@ -17,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints private double placementStartTime; private double placementEndTime; - protected override bool IsValidForPlacement => HitObject.Duration > 0; + protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0); public BananaShowerPlacementBlueprint() { diff --git a/osu.Game.Rulesets.Catch/Edit/Blueprints/JuiceStreamPlacementBlueprint.cs b/osu.Game.Rulesets.Catch/Edit/Blueprints/JuiceStreamPlacementBlueprint.cs index 9e50b5a80f..c8c8db1ebd 100644 --- a/osu.Game.Rulesets.Catch/Edit/Blueprints/JuiceStreamPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Catch/Edit/Blueprints/JuiceStreamPlacementBlueprint.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.Input.Events; +using osu.Framework.Utils; using osu.Game.Rulesets.Catch.Edit.Blueprints.Components; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Edit; @@ -24,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints private InputManager inputManager = null!; - protected override bool IsValidForPlacement => HitObject.Duration > 0; + protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0); public JuiceStreamPlacementBlueprint() { diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs index 02ad1655b5..991b7f476c 100644 --- a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs +++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs @@ -5,6 +5,7 @@ using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Input.Events; +using osu.Framework.Utils; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Mania.Edit.Blueprints.Components; using osu.Game.Rulesets.Mania.Objects; @@ -23,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints [Resolved] private IScrollingInfo scrollingInfo { get; set; } = null!; - protected override bool IsValidForPlacement => HitObject.Duration > 0; + protected override bool IsValidForPlacement => Precision.DefinitelyBigger(HitObject.Duration, 0); public HoldNotePlacementBlueprint() : base(new HoldNote()) diff --git a/osu.Game.Rulesets.Taiko/Edit/Blueprints/TaikoSpanPlacementBlueprint.cs b/osu.Game.Rulesets.Taiko/Edit/Blueprints/TaikoSpanPlacementBlueprint.cs index bc4129c982..b0919417a4 100644 --- a/osu.Game.Rulesets.Taiko/Edit/Blueprints/TaikoSpanPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Taiko/Edit/Blueprints/TaikoSpanPlacementBlueprint.cs @@ -6,6 +6,7 @@ using System; using osu.Framework.Graphics; using osu.Framework.Input.Events; +using osu.Framework.Utils; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -25,7 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Edit.Blueprints private readonly IHasDuration spanPlacementObject; - protected override bool IsValidForPlacement => spanPlacementObject.Duration > 0; + protected override bool IsValidForPlacement => Precision.DefinitelyBigger(spanPlacementObject.Duration, 0); public TaikoSpanPlacementBlueprint(HitObject hitObject) : base(hitObject) diff --git a/osu.Game/Rulesets/Objects/SliderPath.cs b/osu.Game/Rulesets/Objects/SliderPath.cs index e9a192669f..dc71608132 100644 --- a/osu.Game/Rulesets/Objects/SliderPath.cs +++ b/osu.Game/Rulesets/Objects/SliderPath.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Objects /// public readonly Bindable ExpectedDistance = new Bindable(); - public bool HasValidLength => Distance > 0; + public bool HasValidLength => Precision.DefinitelyBigger(Distance, 0); /// /// The control points of the path. From c167f10ad5ff9b82b26ee5f3eb3b709fd7467f82 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Tue, 19 Dec 2023 21:20:45 +0100 Subject: [PATCH 254/567] fix crash from dragging near zero-length repeating object in timeline --- .../Compose/Components/Timeline/TimelineHitObjectBlueprint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs index 77afad2d4f..47dc3fb82e 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs @@ -409,7 +409,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline double lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1); int proposedCount = Math.Max(0, (int)Math.Round(proposedDuration / lengthOfOneRepeat) - 1); - if (proposedCount == repeatHitObject.RepeatCount || lengthOfOneRepeat == 0) + if (proposedCount == repeatHitObject.RepeatCount || Precision.AlmostEquals(lengthOfOneRepeat, 0)) return; repeatHitObject.RepeatCount = proposedCount; From 1b004dbebce337df0a38b6e3d4408758460d4399 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 19 Dec 2023 12:20:44 -0800 Subject: [PATCH 255/567] Allow Relax to fail and remove failable mod exclusions Allows the Relax mod to fail, and remove NF/PF/SD mod exclusion ref: https://github.com/ppy/osu/discussions/13229 --- osu.Game/Rulesets/Mods/ModFailCondition.cs | 2 +- osu.Game/Rulesets/Mods/ModNoFail.cs | 2 +- osu.Game/Rulesets/Mods/ModRelax.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModFailCondition.cs b/osu.Game/Rulesets/Mods/ModFailCondition.cs index e671c065cf..a116826e32 100644 --- a/osu.Game/Rulesets/Mods/ModFailCondition.cs +++ b/osu.Game/Rulesets/Mods/ModFailCondition.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods { public abstract class ModFailCondition : Mod, IApplicableToHealthProcessor, IApplicableFailOverride { - public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax) }; + public override Type[] IncompatibleMods => new[] { typeof(ModBlockFail) }; [SettingSource("Restart on fail", "Automatically restarts when failed.")] public BindableBool Restart { get; } = new BindableBool(); diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index 8c61d948a4..8fca98b018 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -16,6 +16,6 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "You can't fail, no matter what."; public override double ScoreMultiplier => 0.5; - public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModFailCondition) }; + public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition) }; } } diff --git a/osu.Game/Rulesets/Mods/ModRelax.cs b/osu.Game/Rulesets/Mods/ModRelax.cs index 49c10339ee..3d672b5ef8 100644 --- a/osu.Game/Rulesets/Mods/ModRelax.cs +++ b/osu.Game/Rulesets/Mods/ModRelax.cs @@ -7,13 +7,13 @@ using osu.Game.Graphics; namespace osu.Game.Rulesets.Mods { - public abstract class ModRelax : ModBlockFail + public abstract class ModRelax : Mod { public override string Name => "Relax"; public override string Acronym => "RX"; public override IconUsage? Icon => OsuIcon.ModRelax; public override ModType Type => ModType.Automation; public override double ScoreMultiplier => 0.1; - public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModFailCondition) }; + public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay) }; } } From 85e5d74a16eead4bc1dc01049698be56d8669de1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 12:42:06 +0900 Subject: [PATCH 256/567] Apply proposed changes --- osu.Game/Screens/Select/BeatmapDetails.cs | 13 +------ .../Screens/Select/Details/AdvancedStats.cs | 34 ++++++++++++++++--- osu.Game/Screens/Select/SongSelect.cs | 13 ++----- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 679ebfcf48..dec2c1c1de 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -5,7 +5,6 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps; using osu.Game.Graphics; @@ -19,7 +18,6 @@ using osu.Game.Overlays.BeatmapSet; using osu.Game.Resources.Localisation.Web; using osu.Game.Screens.Select.Details; using osuTK; -using osuTK.Graphics; namespace osu.Game.Screens.Select { @@ -70,21 +68,12 @@ namespace osu.Game.Screens.Select CornerRadius = 10; Masking = true; - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Hollow = true, - Colour = new Color4(130, 204, 255, 15), - Radius = 10, - }; - Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, - Colour = new Color4(130, 204, 255, 40), - Blending = BlendingParameters.Additive, + Colour = Colour4.Black.Opacity(0.3f), }, new Container { diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 66a913fda1..0d68a0ec3c 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -92,11 +92,35 @@ namespace osu.Game.Screens.Select.Details Direction = FillDirection.Full, Children = new[] { - FirstValue = new StatisticRow { Width = 0.5f }, // circle size/key amount - HpDrain = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsDrain, Width = 0.5f }, - Accuracy = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAccuracy, Width = 0.5f }, - ApproachRate = new StatisticRow { Title = BeatmapsetsStrings.ShowStatsAr, Width = 0.5f }, - starDifficulty = new StatisticRow(10, true) { Title = BeatmapsetsStrings.ShowStatsStars, Width = 0.5f }, + FirstValue = new StatisticRow + { + Width = 0.5f, + Padding = new MarginPadding { Right = 5, Vertical = 2.5f }, + }, // circle size/key amount + HpDrain = new StatisticRow + { + Title = BeatmapsetsStrings.ShowStatsDrain, + Width = 0.5f, + Padding = new MarginPadding { Left = 5, Vertical = 2.5f }, + }, + Accuracy = new StatisticRow + { + Title = BeatmapsetsStrings.ShowStatsAccuracy, + Width = 0.5f, + Padding = new MarginPadding { Right = 5, Vertical = 2.5f }, + }, + ApproachRate = new StatisticRow + { + Title = BeatmapsetsStrings.ShowStatsAr, + Width = 0.5f, + Padding = new MarginPadding { Left = 5, Vertical = 2.5f }, + }, + starDifficulty = new StatisticRow(10, true) + { + Title = BeatmapsetsStrings.ShowStatsStars, + Width = 0.5f, + Padding = new MarginPadding { Right = 5, Vertical = 2.5f }, + }, }, }; break; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 208a8eb321..0d302dc561 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -13,7 +13,6 @@ using osu.Framework.Bindables; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -274,28 +273,20 @@ namespace osu.Game.Screens.Select RelativeSizeAxes = Axes.Both, Masking = true, CornerRadius = 10, - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Hollow = true, - Colour = new Color4(130, 204, 255, 15), - Radius = 10, - }, Children = new Drawable[] { new Box { - Colour = new Color4(130, 204, 255, 40), - Blending = BlendingParameters.Additive, RelativeSizeAxes = Axes.Both, + Colour = Colour4.Black.Opacity(0.3f), }, advancedStats = new AdvancedStats(2) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Width = 0.8f, Anchor = Anchor.Centre, Origin = Anchor.Centre, + Padding = new MarginPadding(10) }, } }, From 856c59f7f75d9322e03d98b874ab04691c5bc968 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 14:08:12 +0900 Subject: [PATCH 257/567] Fix thread safety of `OnlineMetadataClient.UserStates` Closes https://github.com/ppy/osu-framework/issues/6081. --- osu.Game/Online/Metadata/OnlineMetadataClient.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game/Online/Metadata/OnlineMetadataClient.cs b/osu.Game/Online/Metadata/OnlineMetadataClient.cs index 27093d7961..b916386b06 100644 --- a/osu.Game/Online/Metadata/OnlineMetadataClient.cs +++ b/osu.Game/Online/Metadata/OnlineMetadataClient.cs @@ -97,8 +97,11 @@ namespace osu.Game.Online.Metadata { if (!connected.NewValue) { - isWatchingUserPresence.Value = false; - userStates.Clear(); + Schedule(() => + { + isWatchingUserPresence.Value = false; + userStates.Clear(); + }); return; } @@ -187,13 +190,13 @@ namespace osu.Game.Online.Metadata public override Task UserPresenceUpdated(int userId, UserPresence? presence) { - lock (userStates) + Schedule(() => { if (presence != null) userStates[userId] = presence.Value; else userStates.Remove(userId); - } + }); return Task.CompletedTask; } @@ -215,8 +218,8 @@ namespace osu.Game.Online.Metadata if (connector?.IsConnected.Value != true) throw new OperationCanceledException(); - // must happen synchronously before any remote calls to avoid misordering. - userStates.Clear(); + // must happen synchronously before any remote calls to avoid mis-ordering. + Schedule(() => userStates.Clear()); Debug.Assert(connection != null); await connection.InvokeAsync(nameof(IMetadataServer.EndWatchingUserPresence)).ConfigureAwait(false); } From d7603e8021a0a0ae3cd09ee73344c76054cbcd8a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 14:32:38 +0900 Subject: [PATCH 258/567] Adjust "classic" mod multiplier to 0.96x Following discussions on discord, this seems like the most agreed upon value. Increasing this is important so that imported legacy scores don't lose too much value. --- osu.Game/Rulesets/Mods/ModClassic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModClassic.cs b/osu.Game/Rulesets/Mods/ModClassic.cs index 42fdee0402..16cb928bd4 100644 --- a/osu.Game/Rulesets/Mods/ModClassic.cs +++ b/osu.Game/Rulesets/Mods/ModClassic.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods public override string Acronym => "CL"; - public override double ScoreMultiplier => 0.5; + public override double ScoreMultiplier => 0.96; public override IconUsage? Icon => FontAwesome.Solid.History; From 14d2d0d21538e4240211fa839ab6a34256cf797b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 14:50:21 +0900 Subject: [PATCH 259/567] Remove `ModBlockFail` Was only being used by `NoFail` now. --- osu.Game/Rulesets/Mods/ModBlockFail.cs | 31 ---------------------- osu.Game/Rulesets/Mods/ModFailCondition.cs | 2 +- osu.Game/Rulesets/Mods/ModNoFail.cs | 24 ++++++++++++++++- 3 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 osu.Game/Rulesets/Mods/ModBlockFail.cs diff --git a/osu.Game/Rulesets/Mods/ModBlockFail.cs b/osu.Game/Rulesets/Mods/ModBlockFail.cs deleted file mode 100644 index cdfb36ebbc..0000000000 --- a/osu.Game/Rulesets/Mods/ModBlockFail.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Configuration; -using osu.Game.Screens.Play; - -namespace osu.Game.Rulesets.Mods -{ - public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig - { - private readonly Bindable showHealthBar = new Bindable(); - - /// - /// We never fail, 'yo. - /// - public bool PerformFail() => false; - - public bool RestartOnFail => false; - - public void ReadFromConfig(OsuConfigManager config) - { - config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar); - } - - public void ApplyToHUD(HUDOverlay overlay) - { - overlay.ShowHealthBar.BindTo(showHealthBar); - } - } -} diff --git a/osu.Game/Rulesets/Mods/ModFailCondition.cs b/osu.Game/Rulesets/Mods/ModFailCondition.cs index a116826e32..471c3bfe8d 100644 --- a/osu.Game/Rulesets/Mods/ModFailCondition.cs +++ b/osu.Game/Rulesets/Mods/ModFailCondition.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods { public abstract class ModFailCondition : Mod, IApplicableToHealthProcessor, IApplicableFailOverride { - public override Type[] IncompatibleMods => new[] { typeof(ModBlockFail) }; + public override Type[] IncompatibleMods => new[] { typeof(ModNoFail) }; [SettingSource("Restart on fail", "Automatically restarts when failed.")] public BindableBool Restart { get; } = new BindableBool(); diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index 8fca98b018..0cf81bf4c9 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -2,13 +2,16 @@ // See the LICENCE file in the repository root for full licence text. using System; +using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Configuration; using osu.Game.Graphics; +using osu.Game.Screens.Play; namespace osu.Game.Rulesets.Mods { - public abstract class ModNoFail : ModBlockFail + public abstract class ModNoFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig { public override string Name => "No Fail"; public override string Acronym => "NF"; @@ -17,5 +20,24 @@ namespace osu.Game.Rulesets.Mods public override LocalisableString Description => "You can't fail, no matter what."; public override double ScoreMultiplier => 0.5; public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition) }; + + private readonly Bindable showHealthBar = new Bindable(); + + /// + /// We never fail, 'yo. + /// + public bool PerformFail() => false; + + public bool RestartOnFail => false; + + public void ReadFromConfig(OsuConfigManager config) + { + config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar); + } + + public void ApplyToHUD(HUDOverlay overlay) + { + overlay.ShowHealthBar.BindTo(showHealthBar); + } } } From b6f0c98a0907ad1869a19c4dc00c83cedbf4b03c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 14:56:52 +0900 Subject: [PATCH 260/567] Also apply to autopilot --- osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs index 56bf0e08e9..bf74b741d5 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Osu.Mods { - public class OsuModAutopilot : Mod, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToDrawableRuleset + public class OsuModAutopilot : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset { public override string Name => "Autopilot"; public override string Acronym => "AP"; @@ -37,10 +37,6 @@ namespace osu.Game.Rulesets.Osu.Mods typeof(ModTouchDevice) }; - public bool PerformFail() => false; - - public bool RestartOnFail => false; - private OsuInputManager inputManager = null!; private List replayFrames = null!; From 64f62e7d904a31a31df6b0926aba6284ef4f7087 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 17:31:08 +0900 Subject: [PATCH 261/567] Fix song select running updates when screen is not active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Who would have guessed that `Schedule` calls were there for a reason! I've tidied things up. Most of the changes I've made here are not required – the schedule is the main thing here. The reason the sound was playing is because one-too-many schedules was removed causing beatmap updates to update carousel specifics while still at the player loader screen. Note that the selection sound still plays on returning to song select, but this is not a regression. I'm looking at fixing this in a separate PR because I'm in a good place as far as understanding the logic right now and it would be a waste to leave it broken. Closes https://github.com/ppy/osu/issues/25875. --- osu.Game/Screens/Select/BeatmapCarousel.cs | 100 ++++++++++++--------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index fe7eee701f..53529d592b 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -301,6 +301,9 @@ namespace osu.Game.Screens.Select if (loadedTestBeatmaps) return; + var setsRequiringUpdate = new HashSet(); + var setsRequiringRemoval = new HashSet(); + if (changes == null) { // During initial population, we must manually account for the fact that our original query was done on an async thread. @@ -314,67 +317,80 @@ namespace osu.Game.Screens.Select foreach (var id in realmSets) { if (!root.BeatmapSetsByID.ContainsKey(id)) - updateBeatmapSet(realm.Realm.Find(id)!.Detach()); + setsRequiringUpdate.Add(realm.Realm.Find(id)!.Detach()); } foreach (var id in root.BeatmapSetsByID.Keys) { if (!realmSets.Contains(id)) - removeBeatmapSet(id); + setsRequiringRemoval.Add(id); } + } + else + { + foreach (int i in changes.NewModifiedIndices) + setsRequiringUpdate.Add(sender[i].Detach()); - invalidateAfterChange(); - BeatmapSetsLoaded = true; - return; + foreach (int i in changes.InsertedIndices) + setsRequiringUpdate.Add(sender[i].Detach()); } - foreach (int i in changes.NewModifiedIndices) - updateBeatmapSet(sender[i].Detach()); - - foreach (int i in changes.InsertedIndices) - updateBeatmapSet(sender[i].Detach()); - - if (changes.DeletedIndices.Length > 0 && SelectedBeatmapInfo != null) + // All local operations must be scheduled. + // + // If we don't schedule, beatmaps getting changed while song select is suspended (ie. last played being updated) + // will cause unexpected sounds and operations to occur in the background. + Schedule(() => { - // If SelectedBeatmapInfo is non-null, the set should also be non-null. - Debug.Assert(SelectedBeatmapSet != null); - - // To handle the beatmap update flow, attempt to track selection changes across delete-insert transactions. - // When an update occurs, the previous beatmap set is either soft or hard deleted. - // Check if the current selection was potentially deleted by re-querying its validity. - bool selectedSetMarkedDeleted = sender.Realm.Find(SelectedBeatmapSet.ID)?.DeletePending != false; - - int[] modifiedAndInserted = changes.NewModifiedIndices.Concat(changes.InsertedIndices).ToArray(); - - if (selectedSetMarkedDeleted && modifiedAndInserted.Any()) + try { - // If it is no longer valid, make the bold assumption that an updated version will be available in the modified/inserted indices. - // This relies on the full update operation being in a single transaction, so please don't change that. - foreach (int i in modifiedAndInserted) + foreach (var set in setsRequiringRemoval) + removeBeatmapSet(set); + + foreach (var set in setsRequiringUpdate) + updateBeatmapSet(set); + + if (changes?.DeletedIndices.Length > 0 && SelectedBeatmapInfo != null) { - var beatmapSetInfo = sender[i]; + // If SelectedBeatmapInfo is non-null, the set should also be non-null. + Debug.Assert(SelectedBeatmapSet != null); - foreach (var beatmapInfo in beatmapSetInfo.Beatmaps) + // To handle the beatmap update flow, attempt to track selection changes across delete-insert transactions. + // When an update occurs, the previous beatmap set is either soft or hard deleted. + // Check if the current selection was potentially deleted by re-querying its validity. + bool selectedSetMarkedDeleted = realm.Run(r => r.Find(SelectedBeatmapSet.ID)?.DeletePending != false); + + if (selectedSetMarkedDeleted && setsRequiringUpdate.Any()) { - if (!((IBeatmapMetadataInfo)beatmapInfo.Metadata).Equals(SelectedBeatmapInfo.Metadata)) - continue; - - // Best effort matching. We can't use ID because in the update flow a new version will get its own GUID. - if (beatmapInfo.DifficultyName == SelectedBeatmapInfo.DifficultyName) + // If it is no longer valid, make the bold assumption that an updated version will be available in the modified/inserted indices. + // This relies on the full update operation being in a single transaction, so please don't change that. + foreach (var set in setsRequiringUpdate) { - SelectBeatmap(beatmapInfo); - return; + foreach (var beatmapInfo in set.Beatmaps) + { + if (!((IBeatmapMetadataInfo)beatmapInfo.Metadata).Equals(SelectedBeatmapInfo.Metadata)) + continue; + + // Best effort matching. We can't use ID because in the update flow a new version will get its own GUID. + if (beatmapInfo.DifficultyName == SelectedBeatmapInfo.DifficultyName) + { + SelectBeatmap(beatmapInfo); + return; + } + } } + + // If a direct selection couldn't be made, it's feasible that the difficulty name (or beatmap metadata) changed. + // Let's attempt to follow set-level selection anyway. + SelectBeatmap(setsRequiringUpdate.First().Beatmaps.First()); } } - - // If a direct selection couldn't be made, it's feasible that the difficulty name (or beatmap metadata) changed. - // Let's attempt to follow set-level selection anyway. - SelectBeatmap(sender[modifiedAndInserted.First()].Beatmaps.First()); } - } - - invalidateAfterChange(); + finally + { + BeatmapSetsLoaded = true; + invalidateAfterChange(); + } + }); } private void beatmapsChanged(IRealmCollection sender, ChangeSet? changes) From 104fbbde9460d42c10fe5d4d60db2dbfc4218421 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 18:35:45 +0900 Subject: [PATCH 262/567] Change mania scoring to match ScoreV2 --- .../Objects/Drawables/DrawableNote.cs | 40 ----------------- .../Drawables/DrawableNotePerfectBonus.cs | 26 ----------- .../Scoring/ManiaScoreProcessor.cs | 43 +++++++++++++++++-- osu.Game.Rulesets.Mania/UI/Column.cs | 1 - 4 files changed, 40 insertions(+), 70 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index c70dfcb761..680009bc4c 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -13,8 +13,6 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.Skinning.Default; -using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Screens.Edit; @@ -40,8 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private Drawable headPiece; - private DrawableNotePerfectBonus perfectBonus; - public DrawableNote() : this(null) { @@ -93,10 +89,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - { - perfectBonus.TriggerResult(false); ApplyResult(r => r.Type = r.Judgement.MinResult); - } return; } @@ -107,16 +100,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables result = GetCappedResult(result); - perfectBonus.TriggerResult(result == HitResult.Perfect); ApplyResult(r => r.Type = result); } - public override void MissForcefully() - { - perfectBonus.TriggerResult(false); - base.MissForcefully(); - } - /// /// Some objects in mania may want to limit the max result. /// @@ -137,32 +123,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { } - protected override void AddNestedHitObject(DrawableHitObject hitObject) - { - switch (hitObject) - { - case DrawableNotePerfectBonus bonus: - AddInternal(perfectBonus = bonus); - break; - } - } - - protected override void ClearNestedHitObjects() - { - RemoveInternal(perfectBonus, false); - } - - protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) - { - switch (hitObject) - { - case NotePerfectBonus bonus: - return new DrawableNotePerfectBonus(bonus); - } - - return base.CreateNestedHitObject(hitObject); - } - private void updateSnapColour() { if (beatmap == null || HitObject == null) return; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs deleted file mode 100644 index 70ddb60296..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Mania.Objects.Drawables -{ - public partial class DrawableNotePerfectBonus : DrawableManiaHitObject - { - public override bool DisplayResult => false; - - public DrawableNotePerfectBonus() - : this(null!) - { - } - - public DrawableNotePerfectBonus(NotePerfectBonus hitObject) - : base(hitObject) - { - } - - /// - /// Apply a judgement result. - /// - /// Whether this tick was reached. - internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); - } -} diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index e5f9b33c6b..31435ddaad 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -26,13 +26,50 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 10000 * comboProgress - + 990000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + return 200000 * comboProgress + + 800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + bonusPortion; } + protected override double GetNumericResultFor(JudgementResult result) + { + switch (result.Type) + { + case HitResult.Perfect: + return 305; + } + + return base.GetNumericResultFor(result); + } + + protected override double GetMaxNumericResultFor(JudgementResult result) + { + switch (result.Judgement.MaxResult) + { + case HitResult.Perfect: + return 305; + } + + return base.GetMaxNumericResultFor(result); + } + protected override double GetComboScoreChange(JudgementResult result) - => GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + { + double numericResult; + + switch (result.Type) + { + case HitResult.Perfect: + numericResult = 300; + break; + + default: + numericResult = GetNumericResultFor(result); + break; + } + + return numericResult * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + } private class JudgementOrderComparer : IComparer { diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 9489281176..6cd55bb099 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -109,7 +109,6 @@ namespace osu.Game.Rulesets.Mania.UI TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy()); RegisterPool(10, 50); - RegisterPool(10, 50); RegisterPool(10, 50); RegisterPool(10, 50); RegisterPool(10, 50); From 023bbda7dbb381255e66c84ac209c6510662380f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 18:43:06 +0900 Subject: [PATCH 263/567] Change mania to 85% acc / 15% combo --- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 31435ddaad..d5191c880a 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -26,8 +26,8 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 200000 * comboProgress - + 800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + return 150000 * comboProgress + + 850000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + bonusPortion; } From e003462f7d4077d43513d233ae2b4143270be3e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:09:07 +0900 Subject: [PATCH 264/567] Fix beatmap updates causing one extra carousel selection --- osu.Game/Screens/Select/BeatmapCarousel.cs | 85 +++++++++++-------- .../Carousel/CarouselGroupEagerSelect.cs | 8 +- 2 files changed, 54 insertions(+), 39 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 53529d592b..a51b54b21d 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -455,30 +455,13 @@ namespace osu.Game.Screens.Select private void updateBeatmapSet(BeatmapSetInfo beatmapSet) { - Guid? previouslySelectedID = null; - originalBeatmapSetsDetached.RemoveAll(set => set.ID == beatmapSet.ID); originalBeatmapSetsDetached.Add(beatmapSet.Detach()); - // If the selected beatmap is about to be removed, store its ID so it can be re-selected if required - if (selectedBeatmapSet?.BeatmapSet.ID == beatmapSet.ID) - previouslySelectedID = selectedBeatmap?.BeatmapInfo.ID; - - var removedSets = root.RemoveItemsByID(beatmapSet.ID); - - foreach (var removedSet in removedSets) - { - // If we don't remove this here, it may remain in a hidden state until scrolled off screen. - // Doesn't really affect anything during actual user interaction, but makes testing annoying. - var removedDrawable = Scroll.FirstOrDefault(c => c.Item == removedSet); - if (removedDrawable != null) - expirePanelImmediately(removedDrawable); - } + var newSets = new List(); if (beatmapsSplitOut) { - var newSets = new List(); - foreach (var beatmap in beatmapSet.Beatmaps) { var newSet = createCarouselSet(new BeatmapSetInfo(new[] { beatmap }) @@ -489,18 +472,7 @@ namespace osu.Game.Screens.Select }); if (newSet != null) - { newSets.Add(newSet); - root.AddItem(newSet); - } - } - - // check if we can/need to maintain our current selection. - if (previouslySelectedID != null) - { - var toSelect = newSets.FirstOrDefault(s => s.Beatmaps.Any(b => b.BeatmapInfo.ID == previouslySelectedID)) - ?? newSets.FirstOrDefault(); - select(toSelect); } } else @@ -508,13 +480,18 @@ namespace osu.Game.Screens.Select var newSet = createCarouselSet(beatmapSet); if (newSet != null) - { - root.AddItem(newSet); + newSets.Add(newSet); + } - // check if we can/need to maintain our current selection. - if (previouslySelectedID != null) - select((CarouselItem?)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet); - } + var removedSets = root.ReplaceItem(beatmapSet, newSets); + + // If we don't remove these here, it may remain in a hidden state until scrolled off screen. + // Doesn't really affect anything during actual user interaction, but makes testing annoying. + foreach (var removedSet in removedSets) + { + var removedDrawable = Scroll.FirstOrDefault(c => c.Item == removedSet); + if (removedDrawable != null) + expirePanelImmediately(removedDrawable); } } @@ -1207,6 +1184,44 @@ namespace osu.Game.Screens.Select base.AddItem(i); } + /// + /// A special method to handle replace operations (general for updating a beatmap). + /// Avoids event-driven selection flip-flopping during the remove/add process. + /// + /// The beatmap set to be replaced. + /// All new items to replace the removed beatmap set. + /// All removed items, for any further processing. + public IEnumerable ReplaceItem(BeatmapSetInfo oldItem, List newItems) + { + // Without doing this, the removal of the old beatmap will cause carousel's eager selection + // logic to invoke, causing one unnecessary selection. + DisableSelection = true; + var removedSets = RemoveItemsByID(oldItem.ID); + DisableSelection = false; + + foreach (var set in newItems) + AddItem(set); + + Guid? previouslySelectedID = null; + + var selectedBeatmap = (LastSelected as CarouselBeatmap)?.BeatmapInfo; + + // If the selected beatmap is about to be removed, store its ID so it can be re-selected if required + if (selectedBeatmap?.BeatmapSet?.ID == oldItem.ID) + previouslySelectedID = selectedBeatmap.ID; + + // check if we can/need to maintain our current selection. + if (previouslySelectedID != null) + { + var toSelect = newItems.FirstOrDefault(s => s.Beatmaps.Any(b => b.BeatmapInfo.ID == previouslySelectedID)) + ?? newItems.First(); + + toSelect.State.Value = CarouselItemState.Selected; + } + + return removedSets; + } + public IEnumerable RemoveItemsByID(Guid beatmapSetID) { if (BeatmapSetsByID.TryGetValue(beatmapSetID, out var carouselBeatmapSets)) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index b4313c1895..cf4ba5924f 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -36,13 +36,13 @@ namespace osu.Game.Screens.Select.Carousel /// items have been filtered. This bool will be true during the base /// operation. /// - private bool filteringItems; + protected bool DisableSelection; public override void Filter(FilterCriteria criteria) { - filteringItems = true; + DisableSelection = true; base.Filter(criteria); - filteringItems = false; + DisableSelection = false; attemptSelection(); } @@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select.Carousel private void attemptSelection() { - if (filteringItems) return; + if (DisableSelection) return; // we only perform eager selection if we are a currently selected group. if (State.Value != CarouselItemState.Selected) return; From 7fa4dcf0fbd95c3f68de861a4985613c0ed29538 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:27:57 +0900 Subject: [PATCH 265/567] Fix selection retention logic copy paste failure --- osu.Game/Screens/Select/BeatmapCarousel.cs | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index a51b54b21d..370b559897 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -1193,6 +1193,12 @@ namespace osu.Game.Screens.Select /// All removed items, for any further processing. public IEnumerable ReplaceItem(BeatmapSetInfo oldItem, List newItems) { + var previousSelection = (LastSelected as CarouselBeatmapSet)?.Beatmaps + .FirstOrDefault(s => s.State.Value == CarouselItemState.Selected) + ?.BeatmapInfo; + + bool wasSelected = previousSelection?.BeatmapSet?.ID == oldItem.ID; + // Without doing this, the removal of the old beatmap will cause carousel's eager selection // logic to invoke, causing one unnecessary selection. DisableSelection = true; @@ -1202,21 +1208,14 @@ namespace osu.Game.Screens.Select foreach (var set in newItems) AddItem(set); - Guid? previouslySelectedID = null; - - var selectedBeatmap = (LastSelected as CarouselBeatmap)?.BeatmapInfo; - - // If the selected beatmap is about to be removed, store its ID so it can be re-selected if required - if (selectedBeatmap?.BeatmapSet?.ID == oldItem.ID) - previouslySelectedID = selectedBeatmap.ID; - - // check if we can/need to maintain our current selection. - if (previouslySelectedID != null) + // Check if we can/need to maintain our current selection. + if (wasSelected) { - var toSelect = newItems.FirstOrDefault(s => s.Beatmaps.Any(b => b.BeatmapInfo.ID == previouslySelectedID)) - ?? newItems.First(); + CarouselBeatmap? matchingBeatmap = newItems.SelectMany(s => s.Beatmaps) + .FirstOrDefault(b => b.BeatmapInfo.ID == previousSelection?.ID); - toSelect.State.Value = CarouselItemState.Selected; + if (matchingBeatmap != null) + matchingBeatmap.State.Value = CarouselItemState.Selected; } return removedSets; From 5284b95bb8ffe943f8e53c52b33c0275ac59b529 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:42:05 +0900 Subject: [PATCH 266/567] Schedule even more --- osu.Game/Online/Metadata/OnlineMetadataClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/Metadata/OnlineMetadataClient.cs b/osu.Game/Online/Metadata/OnlineMetadataClient.cs index b916386b06..6d00ce7551 100644 --- a/osu.Game/Online/Metadata/OnlineMetadataClient.cs +++ b/osu.Game/Online/Metadata/OnlineMetadataClient.cs @@ -208,7 +208,7 @@ namespace osu.Game.Online.Metadata Debug.Assert(connection != null); await connection.InvokeAsync(nameof(IMetadataServer.BeginWatchingUserPresence)).ConfigureAwait(false); - isWatchingUserPresence.Value = true; + Schedule(() => isWatchingUserPresence.Value = true); } public override async Task EndWatchingUserPresence() @@ -218,14 +218,14 @@ namespace osu.Game.Online.Metadata if (connector?.IsConnected.Value != true) throw new OperationCanceledException(); - // must happen synchronously before any remote calls to avoid mis-ordering. + // must be scheduled before any remote calls to avoid mis-ordering. Schedule(() => userStates.Clear()); Debug.Assert(connection != null); await connection.InvokeAsync(nameof(IMetadataServer.EndWatchingUserPresence)).ConfigureAwait(false); } finally { - isWatchingUserPresence.Value = false; + Schedule(() => isWatchingUserPresence.Value = false); } } From e0c27510f23b71df4d13b78d7b4800135a3d16ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:47:36 +0900 Subject: [PATCH 267/567] Remove remaining usage of `NotePerfectBonus` --- osu.Game.Rulesets.Mania/Objects/Note.cs | 8 -------- .../Objects/NotePerfectBonus.cs | 20 ------------------- 2 files changed, 28 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs diff --git a/osu.Game.Rulesets.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs index 5914132624..0035960c63 100644 --- a/osu.Game.Rulesets.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Threading; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Judgements; @@ -13,12 +12,5 @@ namespace osu.Game.Rulesets.Mania.Objects public class Note : ManiaHitObject { public override Judgement CreateJudgement() => new ManiaJudgement(); - - protected override void CreateNestedHitObjects(CancellationToken cancellationToken) - { - base.CreateNestedHitObjects(cancellationToken); - - AddNested(new NotePerfectBonus { StartTime = StartTime }); - } } } diff --git a/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs b/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs deleted file mode 100644 index def4c01268..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Mania.Judgements; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.Mania.Objects -{ - public class NotePerfectBonus : ManiaHitObject - { - public override Judgement CreateJudgement() => new NotePerfectBonusJudgement(); - protected override HitWindows CreateHitWindows() => HitWindows.Empty; - - public class NotePerfectBonusJudgement : ManiaJudgement - { - public override HitResult MaxResult => HitResult.SmallBonus; - } - } -} From d417b156b25b9541ae88d1acc1d93aa571abbaf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:57:42 +0900 Subject: [PATCH 268/567] Update test expectations --- .../Mods/TestSceneManiaModDoubleTime.cs | 7 ++++--- osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs | 6 +++--- osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs index c717f03f51..975e43ec08 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using NUnit.Framework; +using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; @@ -25,8 +26,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData { PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 - && Player.ScoreProcessor.Accuracy.Value == 1 - && Player.ScoreProcessor.TotalScore.Value == 1_000_000, + && Precision.AlmostEquals(Player.ScoreProcessor.Accuracy.Value, 0.9836, 0.01) + && Player.ScoreProcessor.TotalScore.Value == 946_049, Autoplay = false, Beatmap = new Beatmap { @@ -53,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods Mod = doubleTime, PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 && Player.ScoreProcessor.Accuracy.Value == 1 - && Player.ScoreProcessor.TotalScore.Value == (long)(1_000_010 * doubleTime.ScoreMultiplier), + && Player.ScoreProcessor.TotalScore.Value == (long)(1_000_000 * doubleTime.ScoreMultiplier), Autoplay = false, Beatmap = new Beatmap { diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs index 044ce37832..d752c443cc 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs @@ -201,11 +201,11 @@ namespace osu.Game.Rulesets.Mania.Tests assertHeadJudgement(HitResult.Perfect); // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. - assertComboAtJudgement(1, 1); + assertComboAtJudgement(0, 1); assertTailJudgement(HitResult.Meh); - assertComboAtJudgement(2, 0); + assertComboAtJudgement(1, 0); // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. - assertComboAtJudgement(4, 1); + assertComboAtJudgement(3, 1); } /// diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs index edf866952b..ee6d999932 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddAssert("all objects perfectly judged", () => judgementResults.Select(result => result.Type), () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); - AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_030)); + AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000)); } [Test] @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddAssert("all objects perfectly judged", () => judgementResults.Select(result => result.Type), () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); - AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_040)); + AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000)); } private void performTest(List hitObjects, List frames) From 38d6b7f45b7d07bfb0b9e5bdac1163dda0dcc25b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 20:03:13 +0900 Subject: [PATCH 269/567] Update total score conversion --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 6484500bcc..a9225050b7 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -367,8 +367,8 @@ namespace osu.Game.Database case 3: return (long)Math.Round(( - 990000 * comboProportion - + 10000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + 850000 * comboProportion + + 150000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + bonusProportion) * modMultiplier); default: From 9b383e3276c23ec9f070b3ab1ccd01df969c83a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 20:23:19 +0900 Subject: [PATCH 270/567] Add support for showing tick misses --- .../Objects/Drawables/DrawableSliderRepeat.cs | 2 - .../Objects/Drawables/DrawableSliderTail.cs | 5 -- .../Objects/Drawables/DrawableSliderTick.cs | 2 - .../Scoring/OsuHitWindows.cs | 2 + .../Skinning/Argon/ArgonJudgementPiece.cs | 30 +++++------ osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 5 +- osu.Game/Graphics/OsuColour.cs | 1 + .../Judgements/DefaultJudgementPiece.cs | 16 +++--- .../Rulesets/Judgements/DrawableJudgement.cs | 9 ++-- osu.Game/Rulesets/Scoring/HitResult.cs | 2 + osu.Game/Skinning/LegacyJudgementPieceNew.cs | 2 +- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 52 +++++++++---------- osu.Game/Skinning/LegacySkin.cs | 6 +-- 13 files changed, 62 insertions(+), 72 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs index 0c8e5b765f..c6d4f7c4ca 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs @@ -34,8 +34,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Drawable scaleContainer; - public override bool DisplayResult => false; - public DrawableSliderRepeat() : base(null) { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs index 60bad5d4a7..c4731118a1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs @@ -24,11 +24,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject; - /// - /// The judgement text is provided by the . - /// - public override bool DisplayResult => false; - /// /// Whether the hit samples only play on successful hits. /// If false, the hit samples will also play on misses. diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index cb323f4ac7..d64fb0bcc6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private const float default_tick_size = 16; - public override bool DisplayResult => false; - protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject; private SkinnableDrawable scaleContainer; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs index fd86e0eeda..5b2c95b536 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs @@ -28,6 +28,8 @@ namespace osu.Game.Rulesets.Osu.Scoring case HitResult.Ok: case HitResult.Meh: case HitResult.Miss: + case HitResult.LargeTickMiss: + case HitResult.IgnoreMiss: return true; } diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs index 6f55d93eff..94766cb077 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs @@ -62,25 +62,23 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon /// public virtual void PlayAnimation() { - switch (Result) + if (Result.IsHit()) { - default: - JudgementText - .FadeInFromZero(300, Easing.OutQuint) - .ScaleTo(Vector2.One) - .ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint); - break; + JudgementText + .FadeInFromZero(300, Easing.OutQuint) + .ScaleTo(Vector2.One) + .ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint); + } + else + { + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, Easing.In); - case HitResult.Miss: - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); + this.MoveTo(Vector2.Zero); + this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); - this.MoveTo(Vector2.Zero); - this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); - - this.RotateTo(0); - this.RotateTo(40, 800, Easing.InQuint); - break; + this.RotateTo(0); + this.RotateTo(40, 800, Easing.InQuint); } this.FadeOutFromOne(800); diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 15ca0a90de..3f60ce3610 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -170,7 +170,10 @@ namespace osu.Game.Rulesets.Osu.UI if (!judgedObject.DisplayResult || !DisplayJudgements.Value) return; - DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject)); + if (!poolDictionary.TryGetValue(result.Type, out var pool)) + return; + + DrawableOsuJudgement explosion = pool.Get(doj => doj.Apply(result, judgedObject)); judgementLayer.Add(explosion); diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index a417164e27..caa2037691 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -77,6 +77,7 @@ namespace osu.Game.Graphics { case HitResult.SmallTickMiss: case HitResult.LargeTickMiss: + case HitResult.IgnoreMiss: case HitResult.Miss: case HitResult.ComboBreak: return Red; diff --git a/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs b/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs index d5f586dc35..3c5e37f91c 100644 --- a/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs +++ b/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs @@ -38,18 +38,16 @@ namespace osu.Game.Rulesets.Judgements /// public virtual void PlayAnimation() { - switch (Result) + if (Result != HitResult.None && !Result.IsHit()) { - case HitResult.Miss: - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, Easing.In); - this.MoveTo(Vector2.Zero); - this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); + this.MoveTo(Vector2.Zero); + this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); - this.RotateTo(0); - this.RotateTo(40, 800, Easing.InQuint); - break; + this.RotateTo(0); + this.RotateTo(40, 800, Easing.InQuint); } this.FadeOutFromOne(800); diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 15434fcc04..b4686c52f3 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -133,12 +133,11 @@ namespace osu.Game.Rulesets.Judgements case HitResult.None: break; - case HitResult.Miss: - ApplyMissAnimations(); - break; - default: - ApplyHitAnimations(); + if (Result.Type.IsHit()) + ApplyHitAnimations(); + else + ApplyMissAnimations(); break; } diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index 9705421571..b490501021 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -86,6 +86,7 @@ namespace osu.Game.Rulesets.Scoring /// Indicates a large tick miss. /// [EnumMember(Value = "large_tick_miss")] + [Description(@"x")] [Order(10)] LargeTickMiss, @@ -117,6 +118,7 @@ namespace osu.Game.Rulesets.Scoring /// Indicates a miss that should be ignored for scoring purposes. /// [EnumMember(Value = "ignore_miss")] + [Description("x")] [Order(13)] IgnoreMiss, diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index 9b1ff9b22f..a93c48ba63 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -50,7 +50,7 @@ namespace osu.Game.Skinning }); } - if (result != HitResult.Miss) + if (result.IsHit()) { //new judgement shows old as a temporary effect AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 082d0e4a67..5381cfc050 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -52,39 +52,35 @@ namespace osu.Game.Skinning if (animation?.FrameCount > 1 && !forceTransforms) return; - switch (result) + if (result.IsHit()) { - case HitResult.Miss: - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); + this.ScaleTo(0.6f).Then() + .ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8 + .Delay(fade_in_length * 0.2f) // t = 1.0 + .ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2 + // stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2. + // so we need to force the current value to be correct at 1.2 (0.95) then complete the + // second half of the transform. + .ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4 + } + else + { + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, Easing.In); - decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; + decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - if (legacyVersion >= 2.0m) - { - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); - } + if (legacyVersion >= 2.0m) + { + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + } - float rotation = RNG.NextSingle(-8.6f, 8.6f); + float rotation = RNG.NextSingle(-8.6f, 8.6f); - this.RotateTo(0); - this.RotateTo(rotation, fade_in_length) - .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); - break; - - default: - - this.ScaleTo(0.6f).Then() - .ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8 - .Delay(fade_in_length * 0.2f) // t = 1.0 - .ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2 - - // stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2. - // so we need to force the current value to be correct at 1.2 (0.95) then complete the - // second half of the transform. - .ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4 - break; + this.RotateTo(0); + this.RotateTo(rotation, fade_in_length) + .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); } } diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 9102231913..7516c73b68 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -453,11 +453,11 @@ namespace osu.Game.Skinning private Drawable? getJudgementAnimation(HitResult result) { + if (!result.IsHit()) + return this.GetAnimation("hit0", true, false); + switch (result) { - case HitResult.Miss: - return this.GetAnimation("hit0", true, false); - case HitResult.Meh: return this.GetAnimation("hit50", true, false); From d2716d855741c7461a33aa317965486a85ecd3d2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 20:26:28 +0900 Subject: [PATCH 271/567] Improve animation for legacy skins --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 32 +++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 5381cfc050..6ad188bb47 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -65,22 +65,32 @@ namespace osu.Game.Skinning } else { - this.ScaleTo(1.6f); - this.ScaleTo(1, 100, Easing.In); + bool isTick = result != HitResult.Miss; - decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - - if (legacyVersion >= 2.0m) + if (isTick) { - this.MoveTo(new Vector2(0, -5)); - this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + this.ScaleTo(0.6f); + this.ScaleTo(0.3f, 100, Easing.In); } + else + { + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, Easing.In); - float rotation = RNG.NextSingle(-8.6f, 8.6f); + decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - this.RotateTo(0); - this.RotateTo(rotation, fade_in_length) - .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); + if (legacyVersion >= 2.0m) + { + this.MoveTo(new Vector2(0, -5)); + this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); + } + + float rotation = RNG.NextSingle(-8.6f, 8.6f); + + this.RotateTo(0); + this.RotateTo(rotation, fade_in_length) + .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); + } } } From d1ba2a4a64f7e5c51c5309d5366b9778b98fbdf4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 20:45:18 +0900 Subject: [PATCH 272/567] Use orange for non-combo-breaking miss --- osu.Game/Graphics/OsuColour.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index caa2037691..0d11d2d4ef 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -75,10 +75,12 @@ namespace osu.Game.Graphics { switch (result) { - case HitResult.SmallTickMiss: - case HitResult.LargeTickMiss: case HitResult.IgnoreMiss: + case HitResult.SmallTickMiss: + return Orange1; + case HitResult.Miss: + case HitResult.LargeTickMiss: case HitResult.ComboBreak: return Red; From bff08d124ba7d925566a1a2445036d3ace99c071 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 22:28:46 +0900 Subject: [PATCH 273/567] Remove mania mod multiplier for DT/NC --- osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs | 5 +++++ osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs index a841a8ab37..bea1a14110 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs @@ -10,5 +10,10 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModDoubleTime : ModDoubleTime, IManiaRateAdjustmentMod { public HitWindows HitWindows { get; set; } = new ManiaHitWindows(); + + // For now, all rate-increasing mods should be given a 1x multiplier in mania because it doesn't always + // make the map harder and is more of a personal preference. + // In the future, we can consider adjusting this by experimenting with not applying the hitwindow leniency. + public override double ScoreMultiplier => 1; } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs index f64f7ae31a..7e5e80db6c 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs @@ -11,5 +11,10 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModNightcore : ModNightcore, IManiaRateAdjustmentMod { public HitWindows HitWindows { get; set; } = new ManiaHitWindows(); + + // For now, all rate-increasing mods should be given a 1x multiplier in mania because it doesn't always + // make the map any harder and is more of a personal preference. + // In the future, we can consider adjusting this by experimenting with not applying the hitwindow leniency. + public override double ScoreMultiplier => 1; } } From b0da24176e5e2026173f25abb8a9e094f7d118ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 15:44:02 +0100 Subject: [PATCH 274/567] Remove outdated inline comments --- osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs index d752c443cc..5f299f419d 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs @@ -200,11 +200,9 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. assertComboAtJudgement(0, 1); assertTailJudgement(HitResult.Meh); assertComboAtJudgement(1, 0); - // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. assertComboAtJudgement(3, 1); } From 9515f7dbfa778a22eef7414e2ec68ff732befa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 15:58:26 +0100 Subject: [PATCH 275/567] Bump score version in order to recompute legacy scores --- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 5c51e68d9f..fa930d77d3 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -33,9 +33,10 @@ namespace osu.Game.Scoring.Legacy /// 30000004: Fixed mod multipliers during legacy score conversion. Reconvert all scores. /// 30000005: Introduce combo exponent in the osu! gamemode. Reconvert all scores. /// 30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores. + /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000006; + public const int LATEST_VERSION = 30000007; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From fcf47267fd3a38e53794ca8dadd0d6222c327b64 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2023 00:48:46 +0900 Subject: [PATCH 276/567] Revert change to `OsuHitWindows` and move logic local to pooling initialisation --- osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs | 2 -- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs index 5b2c95b536..fd86e0eeda 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs @@ -28,8 +28,6 @@ namespace osu.Game.Rulesets.Osu.Scoring case HitResult.Ok: case HitResult.Meh: case HitResult.Miss: - case HitResult.LargeTickMiss: - case HitResult.IgnoreMiss: return true; } diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 3f60ce3610..c94057cf6d 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -20,7 +20,6 @@ using osu.Game.Rulesets.Osu.Configuration; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables.Connections; -using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Osu.UI.Cursor; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; @@ -66,8 +65,21 @@ namespace osu.Game.Rulesets.Osu.UI HitPolicy = new StartTimeOrderedHitPolicy(); - var hitWindows = new OsuHitWindows(); - foreach (var result in Enum.GetValues().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r))) + foreach (var result in Enum.GetValues().Where(r => + { + switch (r) + { + case HitResult.Great: + case HitResult.Ok: + case HitResult.Meh: + case HitResult.Miss: + case HitResult.LargeTickMiss: + case HitResult.IgnoreMiss: + return true; + } + + return false; + })) poolDictionary.Add(result, new DrawableJudgementPool(result, onJudgementLoaded)); AddRangeInternal(poolDictionary.Values); From eb8fb8092d2effd3c4251f8247f0dcc5d8f52a93 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2023 00:58:43 +0900 Subject: [PATCH 277/567] Attempt to standardise miss handling logic --- .../Skinning/Argon/ArgonJudgementPiece.cs | 16 ++++++------- osu.Game/Rulesets/Scoring/HitResult.cs | 19 +++++++++++++++ osu.Game/Skinning/LegacyJudgementPieceNew.cs | 2 +- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 24 +++++++++---------- osu.Game/Skinning/LegacySkin.cs | 2 +- 5 files changed, 41 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs index 94766cb077..edeece0293 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs @@ -62,14 +62,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon /// public virtual void PlayAnimation() { - if (Result.IsHit()) - { - JudgementText - .FadeInFromZero(300, Easing.OutQuint) - .ScaleTo(Vector2.One) - .ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint); - } - else + if (Result.IsMiss()) { this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); @@ -80,6 +73,13 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon this.RotateTo(0); this.RotateTo(40, 800, Easing.InQuint); } + else + { + JudgementText + .FadeInFromZero(300, Easing.OutQuint) + .ScaleTo(Vector2.One) + .ScaleTo(new Vector2(1.2f), 1800, Easing.OutQuint); + } this.FadeOutFromOne(800); diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index b490501021..bdb2a9db23 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -269,6 +269,25 @@ namespace osu.Game.Rulesets.Scoring } } + /// + /// Whether a represents a miss of any type. + /// + public static bool IsMiss(this HitResult result) + { + switch (result) + { + case HitResult.IgnoreMiss: + case HitResult.Miss: + case HitResult.SmallTickMiss: + case HitResult.LargeTickMiss: + case HitResult.ComboBreak: + return true; + + default: + return false; + } + } + /// /// Whether a represents a successful hit. /// diff --git a/osu.Game/Skinning/LegacyJudgementPieceNew.cs b/osu.Game/Skinning/LegacyJudgementPieceNew.cs index a93c48ba63..5ff28726c0 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceNew.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceNew.cs @@ -50,7 +50,7 @@ namespace osu.Game.Skinning }); } - if (result.IsHit()) + if (!result.IsMiss()) { //new judgement shows old as a temporary effect AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 6ad188bb47..39697090d1 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -52,18 +52,7 @@ namespace osu.Game.Skinning if (animation?.FrameCount > 1 && !forceTransforms) return; - if (result.IsHit()) - { - this.ScaleTo(0.6f).Then() - .ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8 - .Delay(fade_in_length * 0.2f) // t = 1.0 - .ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2 - // stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2. - // so we need to force the current value to be correct at 1.2 (0.95) then complete the - // second half of the transform. - .ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4 - } - else + if (result.IsMiss()) { bool isTick = result != HitResult.Miss; @@ -92,6 +81,17 @@ namespace osu.Game.Skinning .Then().RotateTo(rotation * 2, fade_out_delay + fade_out_length - fade_in_length, Easing.In); } } + else + { + this.ScaleTo(0.6f).Then() + .ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8 + .Delay(fade_in_length * 0.2f) // t = 1.0 + .ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2 + // stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2. + // so we need to force the current value to be correct at 1.2 (0.95) then complete the + // second half of the transform. + .ScaleTo(0.95f).ScaleTo(finalScale, fade_in_length * 0.2f); // t = 1.4 + } } public Drawable GetAboveHitObjectsProxiedContent() => CreateProxy(); diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 7516c73b68..a37a386889 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -453,7 +453,7 @@ namespace osu.Game.Skinning private Drawable? getJudgementAnimation(HitResult result) { - if (!result.IsHit()) + if (result.IsMiss()) return this.GetAnimation("hit0", true, false); switch (result) From ebbc8333e84509d39c5ed4afada29f07cd8d2d04 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 19 Dec 2023 23:36:57 -0800 Subject: [PATCH 278/567] Prevent `ExportReplay` being spammed on fail by being held down This was already handled in ReplayDownloadButton (https://github.com/ppy/osu/blob/98efff0bd61ea6cc5d6a884aeda1614d81592b9d/osu.Game/Screens/Ranking/ReplayDownloadButton.cs#L114-L115) but seemingly missed for SaveFailedScoreButton --- osu.Game/Screens/Play/SaveFailedScoreButton.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Play/SaveFailedScoreButton.cs b/osu.Game/Screens/Play/SaveFailedScoreButton.cs index 0a2696339c..b97c140250 100644 --- a/osu.Game/Screens/Play/SaveFailedScoreButton.cs +++ b/osu.Game/Screens/Play/SaveFailedScoreButton.cs @@ -102,6 +102,9 @@ namespace osu.Game.Screens.Play public bool OnPressed(KeyBindingPressEvent e) { + if (e.Repeat) + return false; + switch (e.Action) { case GlobalAction.SaveReplay: From c5fb4d0f5c85714d207916d8035565c7a15a39c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2023 01:52:40 +0900 Subject: [PATCH 279/567] Mark flaky test temporarily --- osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 518035fb82..218bf495e3 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -420,6 +420,7 @@ namespace osu.Game.Tests.Visual.SongSelect } [Test] + [FlakyTest] // temporary while peppy investigates public void TestSelectionRetainedOnBeatmapUpdate() { createSongSelect(); From a763ad84730112774e89960d1c3afc115c3e1851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 19:07:18 +0100 Subject: [PATCH 280/567] Add remarks to `Is{Hit,Miss}()` to explain their simultaneous existence --- osu.Game/Rulesets/Scoring/HitResult.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index bdb2a9db23..e174ebd00f 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -272,6 +272,9 @@ namespace osu.Game.Rulesets.Scoring /// /// Whether a represents a miss of any type. /// + /// + /// Of note, both and return for . + /// public static bool IsMiss(this HitResult result) { switch (result) @@ -291,6 +294,9 @@ namespace osu.Game.Rulesets.Scoring /// /// Whether a represents a successful hit. /// + /// + /// Of note, both and return for . + /// public static bool IsHit(this HitResult result) { switch (result) From 975bacaeb750daef25afa0c7c117e23baeb42586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 19:07:26 +0100 Subject: [PATCH 281/567] Add back blank line to fix code quality inspection --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 39697090d1..ca2c8ce6bc 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -87,6 +87,7 @@ namespace osu.Game.Skinning .ScaleTo(1.1f, fade_in_length * 0.8f).Then() // t = 0.8 .Delay(fade_in_length * 0.2f) // t = 1.0 .ScaleTo(0.9f, fade_in_length * 0.2f).Then() // t = 1.2 + // stable dictates scale of 0.9->1 over time 1.0 to 1.4, but we are already at 1.2. // so we need to force the current value to be correct at 1.2 (0.95) then complete the // second half of the transform. From b6a331b2f7c64100874d2eebe0ecff069a7b9693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 20:52:26 +0100 Subject: [PATCH 282/567] Fix argon pro not showing slider tick judgements Addresses https://github.com/ppy/osu/discussions/25968. --- osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs index f98a47097d..0f9c97059c 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/OsuArgonSkinTransformer.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon { case GameplaySkinComponentLookup resultComponent: // This should eventually be moved to a skin setting, when supported. - if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great) + if (Skin is ArgonProSkin && (resultComponent.Component == HitResult.Great || resultComponent.Component == HitResult.Perfect)) return Drawable.Empty(); return new ArgonJudgementPiece(resultComponent.Component); From 88e36eb08c353e8a65108995ad32718831eded66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 21:46:18 +0100 Subject: [PATCH 283/567] Fix autopilot mod still declaring incompatibility with fail-preventing mods Closes https://github.com/ppy/osu/issues/25974. --- osu.Game.Rulesets.Osu/Mods/OsuModAccuracyChallenge.cs | 3 --- osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs | 2 -- osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs | 3 --- osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs | 3 --- osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs | 1 - 5 files changed, 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAccuracyChallenge.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAccuracyChallenge.cs index 5b79753632..e6daa3846f 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModAccuracyChallenge.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAccuracyChallenge.cs @@ -1,14 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Linq; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModAccuracyChallenge : ModAccuracyChallenge { - public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray(); } } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs index bf74b741d5..efcc728d55 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs @@ -29,8 +29,6 @@ namespace osu.Game.Rulesets.Osu.Mods { typeof(OsuModSpunOut), typeof(ModRelax), - typeof(ModFailCondition), - typeof(ModNoFail), typeof(ModAutoplay), typeof(OsuModMagnetised), typeof(OsuModRepel), diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs b/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs index 9f707a5aa6..53c67cd1c3 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs @@ -1,14 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Linq; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModNoFail : ModNoFail { - public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray(); } } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs b/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs index 33581405a6..da462eb6e8 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs @@ -1,14 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Linq; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModPerfect : ModPerfect { - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); } } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs b/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs index b4edb1581e..e661610fe7 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs @@ -11,7 +11,6 @@ namespace osu.Game.Rulesets.Osu.Mods { public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { - typeof(OsuModAutopilot), typeof(OsuModTargetPractice), }).ToArray(); } From 4e3b9941423591977dfe969d637661308dc7d9f6 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 20:23:43 +0900 Subject: [PATCH 284/567] Relocate HitResult numeric score to ScoreProcessor --- .../Difficulty/CatchLegacyScoreSimulator.cs | 6 +- .../Scoring/CatchScoreProcessor.cs | 2 +- .../Scoring/ManiaScoreProcessor.cs | 31 ++--- .../TestSceneSpinnerRotation.cs | 11 +- .../Difficulty/OsuLegacyScoreSimulator.cs | 6 +- .../Objects/Drawables/DrawableSpinner.cs | 3 +- .../Difficulty/TaikoLegacyScoreSimulator.cs | 6 +- .../Scoring/TaikoScoreProcessor.cs | 19 +++- .../Gameplay/TestSceneScoreProcessor.cs | 2 +- .../StandardisedScoreMigrationTools.cs | 46 +++++++- osu.Game/Rulesets/Judgements/Judgement.cs | 59 +--------- .../Rulesets/Judgements/JudgementResult.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 107 +++++++++++++++--- osu.Game/Scoring/ScoreImporter.cs | 4 +- 14 files changed, 182 insertions(+), 122 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index 7a84d9245d..52605ec0cc 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -7,7 +7,7 @@ using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Mods; using osu.Game.Rulesets.Catch.Objects; -using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Catch.Scoring; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Catch.Difficulty { internal class CatchLegacyScoreSimulator : ILegacyScoreSimulator { + private readonly ScoreProcessor scoreProcessor = new CatchScoreProcessor(); + private int legacyBonusScore; private int standardisedBonusScore; private int combo; @@ -134,7 +136,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += Judgement.ToNumericResult(bonusResult); + standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 503252df02..023369badc 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Scoring } protected override double GetComboScoreChange(JudgementResult result) - => GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); + => GetRawComboScore(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); public override ScoreRank RankFromAccuracy(double accuracy) { diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index d5191c880a..d059d99d9f 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -31,45 +31,30 @@ namespace osu.Game.Rulesets.Mania.Scoring + bonusPortion; } - protected override double GetNumericResultFor(JudgementResult result) + public override int GetRawAccuracyScore(HitResult result) { - switch (result.Type) + switch (result) { case HitResult.Perfect: return 305; } - return base.GetNumericResultFor(result); + return base.GetRawAccuracyScore(result); } - protected override double GetMaxNumericResultFor(JudgementResult result) + public override int GetRawComboScore(HitResult result) { - switch (result.Judgement.MaxResult) + switch (result) { case HitResult.Perfect: - return 305; + return 300; } - return base.GetMaxNumericResultFor(result); + return base.GetRawComboScore(result); } protected override double GetComboScoreChange(JudgementResult result) - { - double numericResult; - - switch (result.Type) - { - case HitResult.Perfect: - numericResult = 300; - break; - - default: - numericResult = GetNumericResultFor(result); - break; - } - - return numericResult * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); - } + => GetRawComboScore(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); private class JudgementOrderComparer : IComparer { diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs index 8711aa9c09..fd445bc1ac 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs @@ -58,10 +58,7 @@ namespace osu.Game.Rulesets.Osu.Tests double trackerRotationTolerance = 0; addSeekStep(5000); - AddStep("calculate rotation tolerance", () => - { - trackerRotationTolerance = Math.Abs(drawableSpinner.RotationTracker.Rotation * 0.1f); - }); + AddStep("calculate rotation tolerance", () => { trackerRotationTolerance = Math.Abs(drawableSpinner.RotationTracker.Rotation * 0.1f); }); AddAssert("is disc rotation not almost 0", () => drawableSpinner.RotationTracker.Rotation, () => Is.Not.EqualTo(0).Within(100)); AddAssert("is disc rotation absolute not almost 0", () => drawableSpinner.Result.TotalRotation, () => Is.Not.EqualTo(0).Within(100)); @@ -133,9 +130,11 @@ namespace osu.Game.Rulesets.Osu.Tests AddAssert("player score matching expected bonus score", () => { + var scoreProcessor = ((ScoreExposedPlayer)Player).ScoreProcessor; + // multipled by 2 to nullify the score multiplier. (autoplay mod selected) - long totalScore = ((ScoreExposedPlayer)Player).ScoreProcessor.TotalScore.Value * 2; - return totalScore == (int)(drawableSpinner.Result.TotalRotation / 360) * new SpinnerTick().CreateJudgement().MaxNumericResult; + long totalScore = scoreProcessor.TotalScore.Value * 2; + return totalScore == (int)(drawableSpinner.Result.TotalRotation / 360) * scoreProcessor.GetRawBonusScore(new SpinnerTick().CreateJudgement().MaxResult); }); addSeekStep(0); diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs index 28967cbf7e..6ac7c33275 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring.Legacy; @@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty { internal class OsuLegacyScoreSimulator : ILegacyScoreSimulator { + private readonly ScoreProcessor scoreProcessor = new OsuScoreProcessor(); + private int legacyBonusScore; private int standardisedBonusScore; private int combo; @@ -171,7 +173,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += Judgement.ToNumericResult(bonusResult); + standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index c0c135d145..787d5e5937 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -17,6 +17,7 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Osu.Skinning; using osu.Game.Rulesets.Osu.Skinning.Default; using osu.Game.Rulesets.Scoring; @@ -312,7 +313,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables updateBonusScore(); } - private static readonly int score_per_tick = new SpinnerBonusTick.OsuSpinnerBonusTickJudgement().MaxNumericResult; + private static readonly int score_per_tick = new OsuScoreProcessor().GetRawBonusScore(new SpinnerBonusTick.OsuSpinnerBonusTickJudgement().MaxResult); private void updateBonusScore() { diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index a8ed056c89..8b34c8c808 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -13,11 +12,14 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring.Legacy; using osu.Game.Rulesets.Taiko.Mods; using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Scoring; namespace osu.Game.Rulesets.Taiko.Difficulty { internal class TaikoLegacyScoreSimulator : ILegacyScoreSimulator { + private readonly ScoreProcessor scoreProcessor = new TaikoScoreProcessor(); + private int legacyBonusScore; private int standardisedBonusScore; private int combo; @@ -191,7 +193,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += Judgement.ToNumericResult(bonusResult); + standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index bc1e42c5d1..e81ba324bd 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -28,20 +28,31 @@ namespace osu.Game.Rulesets.Taiko.Scoring protected override double GetComboScoreChange(JudgementResult result) { - return GetNumericResultFor(result) + return GetRawComboScore(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)) * strongScaleValue(result); } - protected override double GetNumericResultFor(JudgementResult result) + public override int GetRawAccuracyScore(HitResult result) { - switch (result.Type) + switch (result) { case HitResult.Ok: return 150; } - return base.GetNumericResultFor(result); + return base.GetRawAccuracyScore(result); + } + + public override int GetRawComboScore(HitResult result) + { + switch (result) + { + case HitResult.Ok: + return 150; + } + + return base.GetRawComboScore(result); } private double strongScaleValue(JudgementResult result) diff --git a/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs b/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs index 1cf72cf937..5d2ad8b363 100644 --- a/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs +++ b/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs @@ -48,7 +48,7 @@ namespace osu.Game.Tests.Gameplay // Apply a judgement scoreProcessor.ApplyResult(new JudgementResult(new HitObject(), new TestJudgement(HitResult.LargeBonus)) { Type = HitResult.LargeBonus }); - Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(Judgement.LARGE_BONUS_SCORE)); + Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(scoreProcessor.GetRawBonusScore(HitResult.LargeBonus))); } [Test] diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 2e5ca390d7..5324d2569e 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -57,14 +57,14 @@ namespace osu.Game.Database // We are constructing a "best possible" score from the statistics provided because it's the best we can do. List sortedHits = score.Statistics .Where(kvp => kvp.Key.AffectsCombo()) - .OrderByDescending(kvp => Judgement.ToNumericResult(kvp.Key)) + .OrderByDescending(kvp => processor.GetRawComboScore(kvp.Key)) .SelectMany(kvp => Enumerable.Repeat(kvp.Key, kvp.Value)) .ToList(); // Attempt to use maximum statistics from the database. var maximumJudgements = score.MaximumStatistics .Where(kvp => kvp.Key.AffectsCombo()) - .OrderByDescending(kvp => Judgement.ToNumericResult(kvp.Key)) + .OrderByDescending(kvp => processor.GetRawComboScore(kvp.Key)) .SelectMany(kvp => Enumerable.Repeat(new FakeJudgement(kvp.Key), kvp.Value)) .ToList(); @@ -169,10 +169,10 @@ namespace osu.Game.Database public static long GetOldStandardised(ScoreInfo score) { double accuracyScore = - (double)score.Statistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => Judgement.ToNumericResult(kvp.Key) * kvp.Value) - / score.MaximumStatistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => Judgement.ToNumericResult(kvp.Key) * kvp.Value); + (double)score.Statistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => numericScoreFor(kvp.Key) * kvp.Value) + / score.MaximumStatistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => numericScoreFor(kvp.Key) * kvp.Value); double comboScore = (double)score.MaxCombo / score.MaximumStatistics.Where(kvp => kvp.Key.AffectsCombo()).Sum(kvp => kvp.Value); - double bonusScore = score.Statistics.Where(kvp => kvp.Key.IsBonus()).Sum(kvp => Judgement.ToNumericResult(kvp.Key) * kvp.Value); + double bonusScore = score.Statistics.Where(kvp => kvp.Key.IsBonus()).Sum(kvp => numericScoreFor(kvp.Key) * kvp.Value); double accuracyPortion = 0.3; @@ -193,6 +193,42 @@ namespace osu.Game.Database modMultiplier *= mod.ScoreMultiplier; return (long)Math.Round((1000000 * (accuracyPortion * accuracyScore + (1 - accuracyPortion) * comboScore) + bonusScore) * modMultiplier); + + static int numericScoreFor(HitResult result) + { + switch (result) + { + default: + return 0; + + case HitResult.SmallTickHit: + return 10; + + case HitResult.LargeTickHit: + return 30; + + case HitResult.Meh: + return 50; + + case HitResult.Ok: + return 100; + + case HitResult.Good: + return 200; + + case HitResult.Great: + return 300; + + case HitResult.Perfect: + return 315; + + case HitResult.SmallBonus: + return 10; + + case HitResult.LargeBonus: + return 50; + } + } } /// diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index cd1e81046d..27402d522c 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -11,16 +11,6 @@ namespace osu.Game.Rulesets.Judgements /// public class Judgement { - /// - /// The score awarded for a small bonus. - /// - public const int SMALL_BONUS_SCORE = 10; - - /// - /// The score awarded for a large bonus. - /// - public const int LARGE_BONUS_SCORE = 50; - /// /// The default health increase for a maximum judgement, as a proportion of total health. /// By default, each maximum judgement restores 5% of total health. @@ -91,23 +81,11 @@ namespace osu.Game.Rulesets.Judgements } } - /// - /// The numeric score representation for the maximum achievable result. - /// - public int MaxNumericResult => ToNumericResult(MaxResult); - /// /// The health increase for the maximum achievable result. /// public double MaxHealthIncrease => HealthIncreaseFor(MaxResult); - /// - /// Retrieves the numeric score representation of a . - /// - /// The to find the numeric score representation for. - /// The numeric score representation of . - public int NumericResultFor(JudgementResult result) => ToNumericResult(result.Type); - /// /// Retrieves the numeric health increase of a . /// @@ -165,41 +143,6 @@ namespace osu.Game.Rulesets.Judgements /// The numeric health increase of . public double HealthIncreaseFor(JudgementResult result) => HealthIncreaseFor(result.Type); - public override string ToString() => $"MaxResult:{MaxResult} MaxScore:{MaxNumericResult}"; - - public static int ToNumericResult(HitResult result) - { - switch (result) - { - default: - return 0; - - case HitResult.SmallTickHit: - return 10; - - case HitResult.LargeTickHit: - return 30; - - case HitResult.Meh: - return 50; - - case HitResult.Ok: - return 100; - - case HitResult.Good: - return 200; - - case HitResult.Great: - // Perfect doesn't actually give more score / accuracy directly. - case HitResult.Perfect: - return 300; - - case HitResult.SmallBonus: - return SMALL_BONUS_SCORE; - - case HitResult.LargeBonus: - return LARGE_BONUS_SCORE; - } - } + public override string ToString() => $"MaxResult:{MaxResult}"; } } diff --git a/osu.Game/Rulesets/Judgements/JudgementResult.cs b/osu.Game/Rulesets/Judgements/JudgementResult.cs index db621b4851..1b915d52b7 100644 --- a/osu.Game/Rulesets/Judgements/JudgementResult.cs +++ b/osu.Game/Rulesets/Judgements/JudgementResult.cs @@ -112,6 +112,6 @@ namespace osu.Game.Rulesets.Judgements RawTime = null; } - public override string ToString() => $"{Type} (Score:{Judgement.NumericResultFor(this)} HP:{Judgement.HealthIncreaseFor(this)} {Judgement})"; + public override string ToString() => $"{Type} ({Judgement})"; } } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index aa8905c0b6..a80a118363 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -227,12 +227,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore += GetMaxNumericResultFor(result); + currentMaximumBaseScore += GetRawAccuracyScore(result.Judgement.MaxResult); currentAccuracyJudgementCount++; } if (result.Type.AffectsAccuracy()) - currentBaseScore += GetNumericResultFor(result); + currentBaseScore += GetRawAccuracyScore(result.Type); if (result.Type.IsBonus()) currentBonusPortion += GetBonusScoreChange(result); @@ -276,12 +276,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore -= GetMaxNumericResultFor(result); + currentMaximumBaseScore -= GetRawAccuracyScore(result.Judgement.MaxResult); currentAccuracyJudgementCount--; } if (result.Type.AffectsAccuracy()) - currentBaseScore -= GetNumericResultFor(result); + currentBaseScore -= GetRawAccuracyScore(result.Type); if (result.Type.IsBonus()) currentBonusPortion -= GetBonusScoreChange(result); @@ -297,21 +297,100 @@ namespace osu.Game.Rulesets.Scoring updateScore(); } - protected virtual double GetBonusScoreChange(JudgementResult result) => GetNumericResultFor(result); - - protected virtual double GetComboScoreChange(JudgementResult result) => GetMaxNumericResultFor(result) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); + /// + /// Gets the final score change to be applied to the bonus portion of the score. + /// + /// The judgement result. + protected virtual double GetBonusScoreChange(JudgementResult result) => GetRawBonusScore(result.Type); /// - /// Retrieves the numeric score representation for a . + /// Gets the final score change to be applied to the combo portion of the score. /// - /// The . - protected virtual double GetNumericResultFor(JudgementResult result) => result.Judgement.NumericResultFor(result); + /// The judgement result. + protected virtual double GetComboScoreChange(JudgementResult result) => GetRawComboScore(result.Judgement.MaxResult) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); /// - /// Retrieves the maximum numeric score representation for a . + /// Retrieves the raw score value for a hit result, in order to be applied to the combo portion. /// - /// The . - protected virtual double GetMaxNumericResultFor(JudgementResult result) => result.Judgement.MaxNumericResult; + /// The hit result. + public virtual int GetRawComboScore(HitResult result) + { + switch (result) + { + default: + return 0; + + case HitResult.SmallTickHit: + return 10; + + case HitResult.LargeTickHit: + return 30; + + case HitResult.Meh: + return 50; + + case HitResult.Ok: + return 100; + + case HitResult.Good: + return 200; + + case HitResult.Great: + case HitResult.Perfect: // Perfect doesn't actually give more score / accuracy directly. + return 300; + } + } + + /// + /// Retrieves the raw score value for a hit result, in order to be applied to the accuracy portion. + /// + /// The hit result. + public virtual int GetRawAccuracyScore(HitResult result) + { + switch (result) + { + default: + return 0; + + case HitResult.SmallTickHit: + return 10; + + case HitResult.LargeTickHit: + return 30; + + case HitResult.Meh: + return 50; + + case HitResult.Ok: + return 100; + + case HitResult.Good: + return 200; + + case HitResult.Great: + case HitResult.Perfect: // Perfect doesn't actually give more score / accuracy directly. + return 300; + } + } + + /// + /// Retrieves the raw score value for a hit result, in order to be applied to the bonus portion. + /// + /// The hit result. + public virtual int GetRawBonusScore(HitResult result) + { + switch (result) + { + default: + return 0; + + case HitResult.SmallBonus: + return 10; + + case HitResult.LargeBonus: + return 50; + } + } protected virtual void ApplyScoreChange(JudgementResult result) { @@ -540,7 +619,7 @@ namespace osu.Game.Rulesets.Scoring /// /// /// Used to compute accuracy. - /// See: and . + /// See: and . /// [Key(0)] public double BaseScore { get; set; } diff --git a/osu.Game/Scoring/ScoreImporter.cs b/osu.Game/Scoring/ScoreImporter.cs index b216c0897e..b1cba3756b 100644 --- a/osu.Game/Scoring/ScoreImporter.cs +++ b/osu.Game/Scoring/ScoreImporter.cs @@ -17,7 +17,6 @@ using osu.Game.Scoring.Legacy; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using Realms; @@ -125,13 +124,14 @@ namespace osu.Game.Scoring var beatmap = score.BeatmapInfo!.Detach(); var ruleset = score.Ruleset.Detach(); var rulesetInstance = ruleset.CreateInstance(); + var scoreProcessor = rulesetInstance.CreateScoreProcessor(); Debug.Assert(rulesetInstance != null); // Populate the maximum statistics. HitResult maxBasicResult = rulesetInstance.GetHitResults() .Select(h => h.result) - .Where(h => h.IsBasic()).MaxBy(Judgement.ToNumericResult); + .Where(h => h.IsBasic()).MaxBy(scoreProcessor.GetRawAccuracyScore); foreach ((HitResult result, int count) in score.Statistics) { From 6b4b2a57fc7d9652dd4726b388656175cec1e09b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 21 Dec 2023 14:58:23 +0900 Subject: [PATCH 285/567] Expose only as one method --- .../Difficulty/CatchLegacyScoreSimulator.cs | 2 +- .../Scoring/CatchScoreProcessor.cs | 2 +- .../Scoring/ManiaScoreProcessor.cs | 16 +++-- .../TestSceneSpinnerRotation.cs | 2 +- .../Difficulty/OsuLegacyScoreSimulator.cs | 2 +- .../Objects/Drawables/DrawableSpinner.cs | 2 +- .../Difficulty/TaikoLegacyScoreSimulator.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 17 +---- .../Gameplay/TestSceneScoreProcessor.cs | 2 +- .../StandardisedScoreMigrationTools.cs | 4 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 65 +++---------------- osu.Game/Scoring/ScoreImporter.cs | 2 +- 12 files changed, 30 insertions(+), 88 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index 52605ec0cc..f65b6ef381 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -136,7 +136,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); + standardisedBonusScore += scoreProcessor.GetBaseScoreForResult(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 023369badc..4b3d378889 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.Scoring } protected override double GetComboScoreChange(JudgementResult result) - => GetRawComboScore(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); + => GetBaseScoreForResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); public override ScoreRank RankFromAccuracy(double accuracy) { diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index d059d99d9f..1947d86a97 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -31,7 +31,12 @@ namespace osu.Game.Rulesets.Mania.Scoring + bonusPortion; } - public override int GetRawAccuracyScore(HitResult result) + protected override double GetComboScoreChange(JudgementResult result) + { + return getBaseComboScoreForResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + } + + public override int GetBaseScoreForResult(HitResult result) { switch (result) { @@ -39,10 +44,10 @@ namespace osu.Game.Rulesets.Mania.Scoring return 305; } - return base.GetRawAccuracyScore(result); + return base.GetBaseScoreForResult(result); } - public override int GetRawComboScore(HitResult result) + private int getBaseComboScoreForResult(HitResult result) { switch (result) { @@ -50,12 +55,9 @@ namespace osu.Game.Rulesets.Mania.Scoring return 300; } - return base.GetRawComboScore(result); + return GetBaseScoreForResult(result); } - protected override double GetComboScoreChange(JudgementResult result) - => GetRawComboScore(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); - private class JudgementOrderComparer : IComparer { public static readonly JudgementOrderComparer DEFAULT = new JudgementOrderComparer(); diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs index fd445bc1ac..6706d20080 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinnerRotation.cs @@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Tests // multipled by 2 to nullify the score multiplier. (autoplay mod selected) long totalScore = scoreProcessor.TotalScore.Value * 2; - return totalScore == (int)(drawableSpinner.Result.TotalRotation / 360) * scoreProcessor.GetRawBonusScore(new SpinnerTick().CreateJudgement().MaxResult); + return totalScore == (int)(drawableSpinner.Result.TotalRotation / 360) * scoreProcessor.GetBaseScoreForResult(new SpinnerTick().CreateJudgement().MaxResult); }); addSeekStep(0); diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs index 6ac7c33275..a76054b42c 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs @@ -173,7 +173,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); + standardisedBonusScore += scoreProcessor.GetBaseScoreForResult(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 787d5e5937..f7c1437009 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -313,7 +313,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables updateBonusScore(); } - private static readonly int score_per_tick = new OsuScoreProcessor().GetRawBonusScore(new SpinnerBonusTick.OsuSpinnerBonusTickJudgement().MaxResult); + private static readonly int score_per_tick = new OsuScoreProcessor().GetBaseScoreForResult(new SpinnerBonusTick.OsuSpinnerBonusTickJudgement().MaxResult); private void updateBonusScore() { diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index 8b34c8c808..b20aa4f2b6 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -193,7 +193,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty if (isBonus) { legacyBonusScore += scoreIncrease; - standardisedBonusScore += scoreProcessor.GetRawBonusScore(bonusResult); + standardisedBonusScore += scoreProcessor.GetBaseScoreForResult(bonusResult); } else attributes.AccuracyScore += scoreIncrease; diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index e81ba324bd..2fd9f070ec 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -28,12 +28,12 @@ namespace osu.Game.Rulesets.Taiko.Scoring protected override double GetComboScoreChange(JudgementResult result) { - return GetRawComboScore(result.Type) + return GetBaseScoreForResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)) * strongScaleValue(result); } - public override int GetRawAccuracyScore(HitResult result) + public override int GetBaseScoreForResult(HitResult result) { switch (result) { @@ -41,18 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring return 150; } - return base.GetRawAccuracyScore(result); - } - - public override int GetRawComboScore(HitResult result) - { - switch (result) - { - case HitResult.Ok: - return 150; - } - - return base.GetRawComboScore(result); + return base.GetBaseScoreForResult(result); } private double strongScaleValue(JudgementResult result) diff --git a/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs b/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs index 5d2ad8b363..1a644ad600 100644 --- a/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs +++ b/osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs @@ -48,7 +48,7 @@ namespace osu.Game.Tests.Gameplay // Apply a judgement scoreProcessor.ApplyResult(new JudgementResult(new HitObject(), new TestJudgement(HitResult.LargeBonus)) { Type = HitResult.LargeBonus }); - Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(scoreProcessor.GetRawBonusScore(HitResult.LargeBonus))); + Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(scoreProcessor.GetBaseScoreForResult(HitResult.LargeBonus))); } [Test] diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 5324d2569e..8a25a44b80 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -57,14 +57,14 @@ namespace osu.Game.Database // We are constructing a "best possible" score from the statistics provided because it's the best we can do. List sortedHits = score.Statistics .Where(kvp => kvp.Key.AffectsCombo()) - .OrderByDescending(kvp => processor.GetRawComboScore(kvp.Key)) + .OrderByDescending(kvp => processor.GetBaseScoreForResult(kvp.Key)) .SelectMany(kvp => Enumerable.Repeat(kvp.Key, kvp.Value)) .ToList(); // Attempt to use maximum statistics from the database. var maximumJudgements = score.MaximumStatistics .Where(kvp => kvp.Key.AffectsCombo()) - .OrderByDescending(kvp => processor.GetRawComboScore(kvp.Key)) + .OrderByDescending(kvp => processor.GetBaseScoreForResult(kvp.Key)) .SelectMany(kvp => Enumerable.Repeat(new FakeJudgement(kvp.Key), kvp.Value)) .ToList(); diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index a80a118363..5123668e54 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -227,12 +227,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore += GetRawAccuracyScore(result.Judgement.MaxResult); + currentMaximumBaseScore += GetBaseScoreForResult(result.Judgement.MaxResult); currentAccuracyJudgementCount++; } if (result.Type.AffectsAccuracy()) - currentBaseScore += GetRawAccuracyScore(result.Type); + currentBaseScore += GetBaseScoreForResult(result.Type); if (result.Type.IsBonus()) currentBonusPortion += GetBonusScoreChange(result); @@ -276,12 +276,12 @@ namespace osu.Game.Rulesets.Scoring if (result.Judgement.MaxResult.AffectsAccuracy()) { - currentMaximumBaseScore -= GetRawAccuracyScore(result.Judgement.MaxResult); + currentMaximumBaseScore -= GetBaseScoreForResult(result.Judgement.MaxResult); currentAccuracyJudgementCount--; } if (result.Type.AffectsAccuracy()) - currentBaseScore -= GetRawAccuracyScore(result.Type); + currentBaseScore -= GetBaseScoreForResult(result.Type); if (result.Type.IsBonus()) currentBonusPortion -= GetBonusScoreChange(result); @@ -301,19 +301,15 @@ namespace osu.Game.Rulesets.Scoring /// Gets the final score change to be applied to the bonus portion of the score. /// /// The judgement result. - protected virtual double GetBonusScoreChange(JudgementResult result) => GetRawBonusScore(result.Type); + protected virtual double GetBonusScoreChange(JudgementResult result) => GetBaseScoreForResult(result.Type); /// /// Gets the final score change to be applied to the combo portion of the score. /// /// The judgement result. - protected virtual double GetComboScoreChange(JudgementResult result) => GetRawComboScore(result.Judgement.MaxResult) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); + protected virtual double GetComboScoreChange(JudgementResult result) => GetBaseScoreForResult(result.Judgement.MaxResult) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT); - /// - /// Retrieves the raw score value for a hit result, in order to be applied to the combo portion. - /// - /// The hit result. - public virtual int GetRawComboScore(HitResult result) + public virtual int GetBaseScoreForResult(HitResult result) { switch (result) { @@ -338,51 +334,6 @@ namespace osu.Game.Rulesets.Scoring case HitResult.Great: case HitResult.Perfect: // Perfect doesn't actually give more score / accuracy directly. return 300; - } - } - - /// - /// Retrieves the raw score value for a hit result, in order to be applied to the accuracy portion. - /// - /// The hit result. - public virtual int GetRawAccuracyScore(HitResult result) - { - switch (result) - { - default: - return 0; - - case HitResult.SmallTickHit: - return 10; - - case HitResult.LargeTickHit: - return 30; - - case HitResult.Meh: - return 50; - - case HitResult.Ok: - return 100; - - case HitResult.Good: - return 200; - - case HitResult.Great: - case HitResult.Perfect: // Perfect doesn't actually give more score / accuracy directly. - return 300; - } - } - - /// - /// Retrieves the raw score value for a hit result, in order to be applied to the bonus portion. - /// - /// The hit result. - public virtual int GetRawBonusScore(HitResult result) - { - switch (result) - { - default: - return 0; case HitResult.SmallBonus: return 10; @@ -619,7 +570,7 @@ namespace osu.Game.Rulesets.Scoring /// /// /// Used to compute accuracy. - /// See: and . + /// See: and . /// [Key(0)] public double BaseScore { get; set; } diff --git a/osu.Game/Scoring/ScoreImporter.cs b/osu.Game/Scoring/ScoreImporter.cs index b1cba3756b..3c7ee5c86b 100644 --- a/osu.Game/Scoring/ScoreImporter.cs +++ b/osu.Game/Scoring/ScoreImporter.cs @@ -131,7 +131,7 @@ namespace osu.Game.Scoring // Populate the maximum statistics. HitResult maxBasicResult = rulesetInstance.GetHitResults() .Select(h => h.result) - .Where(h => h.IsBasic()).MaxBy(scoreProcessor.GetRawAccuracyScore); + .Where(h => h.IsBasic()).MaxBy(scoreProcessor.GetBaseScoreForResult); foreach ((HitResult result, int count) in score.Statistics) { From eb072a1d242f0f1680183200310742fa4d850371 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 21 Dec 2023 15:08:10 +0900 Subject: [PATCH 286/567] Add accuracy conversion, fix usages --- osu.Game/BackgroundDataStoreProcessor.cs | 5 +-- .../StandardisedScoreMigrationTools.cs | 42 +++++++++++++++++-- osu.Game/Scoring/ScoreImporter.cs | 2 +- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 8f6dced350..a748a7422a 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -340,15 +340,12 @@ namespace osu.Game try { - var score = scoreManager.Query(s => s.ID == id); - long newTotalScore = StandardisedScoreMigrationTools.ConvertFromLegacyTotalScore(score, beatmapManager); - // Can't use async overload because we're not on the update thread. // ReSharper disable once MethodHasAsyncOverload realmAccess.Write(r => { ScoreInfo s = r.Find(id)!; - s.TotalScore = newTotalScore; + StandardisedScoreMigrationTools.UpdateFromLegacy(s, beatmapManager); s.TotalScoreVersion = LegacyScoreEncoder.LATEST_VERSION; }); diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 8a25a44b80..380bf63e63 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -231,13 +231,36 @@ namespace osu.Game.Database } } + /// + /// Updates a legacy to standardised scoring. + /// + /// The score to update. + /// A used for lookups. + public static void UpdateFromLegacy(ScoreInfo score, BeatmapManager beatmaps) + { + score.TotalScore = convertFromLegacyTotalScore(score, beatmaps); + score.Accuracy = ComputeAccuracy(score); + } + + /// + /// Updates a legacy to standardised scoring. + /// + /// The score to update. + /// The beatmap difficulty. + /// The legacy scoring attributes for the beatmap which the score was set on. + public static void UpdateFromLegacy(ScoreInfo score, LegacyBeatmapConversionDifficultyInfo difficulty, LegacyScoreAttributes attributes) + { + score.TotalScore = convertFromLegacyTotalScore(score, difficulty, attributes); + score.Accuracy = ComputeAccuracy(score); + } + /// /// Converts from to the new standardised scoring of . /// /// The score to convert the total score of. /// A used for lookups. /// The standardised total score. - public static long ConvertFromLegacyTotalScore(ScoreInfo score, BeatmapManager beatmaps) + private static long convertFromLegacyTotalScore(ScoreInfo score, BeatmapManager beatmaps) { if (!score.IsLegacyScore) return score.TotalScore; @@ -260,7 +283,7 @@ namespace osu.Game.Database ILegacyScoreSimulator sv1Simulator = legacyRuleset.CreateLegacyScoreSimulator(); LegacyScoreAttributes attributes = sv1Simulator.Simulate(beatmap, playableBeatmap); - return ConvertFromLegacyTotalScore(score, LegacyBeatmapConversionDifficultyInfo.FromBeatmap(beatmap.Beatmap), attributes); + return convertFromLegacyTotalScore(score, LegacyBeatmapConversionDifficultyInfo.FromBeatmap(beatmap.Beatmap), attributes); } /// @@ -270,7 +293,7 @@ namespace osu.Game.Database /// The beatmap difficulty. /// The legacy scoring attributes for the beatmap which the score was set on. /// The standardised total score. - public static long ConvertFromLegacyTotalScore(ScoreInfo score, LegacyBeatmapConversionDifficultyInfo difficulty, LegacyScoreAttributes attributes) + private static long convertFromLegacyTotalScore(ScoreInfo score, LegacyBeatmapConversionDifficultyInfo difficulty, LegacyScoreAttributes attributes) { if (!score.IsLegacyScore) return score.TotalScore; @@ -422,6 +445,19 @@ namespace osu.Game.Database } } + public static double ComputeAccuracy(ScoreInfo scoreInfo) + { + Ruleset ruleset = scoreInfo.Ruleset.CreateInstance(); + ScoreProcessor scoreProcessor = ruleset.CreateScoreProcessor(); + + int baseScore = scoreInfo.Statistics.Where(kvp => kvp.Key.AffectsAccuracy()) + .Sum(kvp => kvp.Value * scoreProcessor.GetBaseScoreForResult(kvp.Key)); + int maxBaseScore = scoreInfo.MaximumStatistics.Where(kvp => kvp.Key.AffectsAccuracy()) + .Sum(kvp => kvp.Value * scoreProcessor.GetBaseScoreForResult(kvp.Key)); + + return maxBaseScore == 0 ? 1 : baseScore / (double)maxBaseScore; + } + /// /// Used to populate the model using data parsed from its corresponding replay file. /// diff --git a/osu.Game/Scoring/ScoreImporter.cs b/osu.Game/Scoring/ScoreImporter.cs index 3c7ee5c86b..8e28707107 100644 --- a/osu.Game/Scoring/ScoreImporter.cs +++ b/osu.Game/Scoring/ScoreImporter.cs @@ -106,7 +106,7 @@ namespace osu.Game.Scoring else if (model.IsLegacyScore) { model.LegacyTotalScore = model.TotalScore; - model.TotalScore = StandardisedScoreMigrationTools.ConvertFromLegacyTotalScore(model, beatmaps()); + StandardisedScoreMigrationTools.UpdateFromLegacy(model, beatmaps()); } } From c3c1752a5a315ae2d72b8c4b6b6a9436d5e579eb Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 21 Dec 2023 15:32:34 +0900 Subject: [PATCH 287/567] Reconvert all legacy scores --- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index fa930d77d3..dbd9a106df 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -34,9 +34,10 @@ namespace osu.Game.Scoring.Legacy /// 30000005: Introduce combo exponent in the osu! gamemode. Reconvert all scores. /// 30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores. /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. + /// 30000008: Add accuracy conversion. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000007; + public const int LATEST_VERSION = 30000008; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From 0648201844a962429a99a2754a2c10e439882680 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2023 18:17:03 +0900 Subject: [PATCH 288/567] Cancel test more --- osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs index 218bf495e3..ce241f3676 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs @@ -420,7 +420,7 @@ namespace osu.Game.Tests.Visual.SongSelect } [Test] - [FlakyTest] // temporary while peppy investigates + [Ignore("temporary while peppy investigates. probably realm batching related.")] public void TestSelectionRetainedOnBeatmapUpdate() { createSongSelect(); From a4baa0a716f05e6415e907824ff0bd06b66e2dfb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2023 18:14:24 +0900 Subject: [PATCH 289/567] Add versioning of local scores For any potential future usage --- osu.Game.Tests/Scores/IO/ImportScoreTest.cs | 2 ++ .../Visual/Gameplay/TestScenePlayerLocalScoreImport.cs | 4 ++++ osu.Game/Database/RealmAccess.cs | 3 ++- osu.Game/Scoring/ScoreInfo.cs | 6 ++++++ osu.Game/Screens/Play/Player.cs | 9 ++++++++- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs index dd724d268e..85b4219792 100644 --- a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs +++ b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs @@ -196,6 +196,7 @@ namespace osu.Game.Tests.Scores.IO User = new APIUser { Username = "Test user" }, BeatmapInfo = beatmap.Beatmaps.First(), Ruleset = new OsuRuleset().RulesetInfo, + Version = "12345", Mods = new Mod[] { new OsuModHardRock(), new OsuModDoubleTime() }, }; @@ -203,6 +204,7 @@ namespace osu.Game.Tests.Scores.IO Assert.IsTrue(imported.Mods.Any(m => m is OsuModHardRock)); Assert.IsTrue(imported.Mods.Any(m => m is OsuModDoubleTime)); + Assert.That(imported.Version, Is.EqualTo(toImport.Version)); } finally { diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs index 0dd544bb30..f7a5ec7562 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs @@ -41,6 +41,9 @@ namespace osu.Game.Tests.Visual.Gameplay private BeatmapSetInfo? importedSet; + [Resolved] + private OsuGameBase osu { get; set; } = null!; + [BackgroundDependencyLoader] private void load(GameHost host, AudioManager audio) { @@ -153,6 +156,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddUntilStep("results displayed", () => Player.GetChildScreen() is ResultsScreen); AddUntilStep("score in database", () => Realm.Run(r => r.Find(Player.Score.ScoreInfo.ID) != null)); + AddUntilStep("score has correct version", () => Realm.Run(r => r.Find(Player.Score.ScoreInfo.ID)!.Version), () => Is.EqualTo(osu.Version)); } [Test] diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index ad61292c2e..4bd7f36cdd 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -90,8 +90,9 @@ namespace osu.Game.Database /// 36 2023-10-26 Add LegacyOnlineID to ScoreInfo. Move osu_scores_*_high IDs stored in OnlineID to LegacyOnlineID. Reset anomalous OnlineIDs. /// 38 2023-12-10 Add EndTimeObjectCount and TotalObjectCount to BeatmapInfo. /// 39 2023-12-19 Migrate any EndTimeObjectCount and TotalObjectCount values of 0 to -1 to better identify non-calculated values. + /// 40 2023-12-21 Add ScoreInfo.Version to keep track of which build scores were set on. /// - private const int schema_version = 39; + private const int schema_version = 40; /// /// Lock object which is held during sections, blocking realm retrieval during blocking periods. diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 5545ba552e..4c00c73341 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -46,6 +46,12 @@ namespace osu.Game.Scoring /// public BeatmapInfo? BeatmapInfo { get; set; } + /// + /// The version of the client this score was set using. + /// Sourced from at the point of score submission. + /// + public string Version { get; set; } = string.Empty; + /// /// The at the point in time when the score was set. /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index cc08079d88..a432242046 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -109,6 +109,9 @@ namespace osu.Game.Screens.Play [Resolved] private MusicController musicController { get; set; } + [Resolved] + private OsuGameBase game { get; set; } + public GameplayState GameplayState { get; private set; } private Ruleset ruleset; @@ -1155,7 +1158,11 @@ namespace osu.Game.Screens.Play /// The . protected virtual Score CreateScore(IBeatmap beatmap) => new Score { - ScoreInfo = new ScoreInfo { User = api.LocalUser.Value }, + ScoreInfo = new ScoreInfo + { + User = api.LocalUser.Value, + Version = game.Version, + }, }; /// From 81bbdccee788daac7c7865859673eed1521191e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 21 Dec 2023 12:56:19 +0100 Subject: [PATCH 290/567] Rename `ScoreInfo.{ -> Client}Version` --- osu.Game.Tests/Scores/IO/ImportScoreTest.cs | 4 ++-- .../Visual/Gameplay/TestScenePlayerLocalScoreImport.cs | 2 +- osu.Game/Scoring/ScoreInfo.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs index 85b4219792..ebbc329b9d 100644 --- a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs +++ b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs @@ -196,7 +196,7 @@ namespace osu.Game.Tests.Scores.IO User = new APIUser { Username = "Test user" }, BeatmapInfo = beatmap.Beatmaps.First(), Ruleset = new OsuRuleset().RulesetInfo, - Version = "12345", + ClientVersion = "12345", Mods = new Mod[] { new OsuModHardRock(), new OsuModDoubleTime() }, }; @@ -204,7 +204,7 @@ namespace osu.Game.Tests.Scores.IO Assert.IsTrue(imported.Mods.Any(m => m is OsuModHardRock)); Assert.IsTrue(imported.Mods.Any(m => m is OsuModDoubleTime)); - Assert.That(imported.Version, Is.EqualTo(toImport.Version)); + Assert.That(imported.ClientVersion, Is.EqualTo(toImport.ClientVersion)); } finally { diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs index f7a5ec7562..fafd1330cc 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs @@ -156,7 +156,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddUntilStep("results displayed", () => Player.GetChildScreen() is ResultsScreen); AddUntilStep("score in database", () => Realm.Run(r => r.Find(Player.Score.ScoreInfo.ID) != null)); - AddUntilStep("score has correct version", () => Realm.Run(r => r.Find(Player.Score.ScoreInfo.ID)!.Version), () => Is.EqualTo(osu.Version)); + AddUntilStep("score has correct version", () => Realm.Run(r => r.Find(Player.Score.ScoreInfo.ID)!.ClientVersion), () => Is.EqualTo(osu.Version)); } [Test] diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 4c00c73341..7071bd380e 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -50,7 +50,7 @@ namespace osu.Game.Scoring /// The version of the client this score was set using. /// Sourced from at the point of score submission. /// - public string Version { get; set; } = string.Empty; + public string ClientVersion { get; set; } = string.Empty; /// /// The at the point in time when the score was set. diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a432242046..c9251b0a78 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -1161,7 +1161,7 @@ namespace osu.Game.Screens.Play ScoreInfo = new ScoreInfo { User = api.LocalUser.Value, - Version = game.Version, + ClientVersion = game.Version, }, }; From 2baf579f7ce62429e83aa4781ec3d55320b92d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 21 Dec 2023 12:58:08 +0100 Subject: [PATCH 291/567] Serialise and deserialise `ClientVersion` to replays --- osu.Game/Scoring/Legacy/LegacyReplaySoloScoreInfo.cs | 4 ++++ osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/osu.Game/Scoring/Legacy/LegacyReplaySoloScoreInfo.cs b/osu.Game/Scoring/Legacy/LegacyReplaySoloScoreInfo.cs index d34edf7bdf..2c5b91f10f 100644 --- a/osu.Game/Scoring/Legacy/LegacyReplaySoloScoreInfo.cs +++ b/osu.Game/Scoring/Legacy/LegacyReplaySoloScoreInfo.cs @@ -35,12 +35,16 @@ namespace osu.Game.Scoring.Legacy [JsonProperty("maximum_statistics")] public Dictionary MaximumStatistics { get; set; } = new Dictionary(); + [JsonProperty("client_version")] + public string ClientVersion = string.Empty; + public static LegacyReplaySoloScoreInfo FromScore(ScoreInfo score) => new LegacyReplaySoloScoreInfo { OnlineID = score.OnlineID, Mods = score.APIMods, Statistics = score.Statistics.Where(kvp => kvp.Value != 0).ToDictionary(kvp => kvp.Key, kvp => kvp.Value), MaximumStatistics = score.MaximumStatistics.Where(kvp => kvp.Value != 0).ToDictionary(kvp => kvp.Key, kvp => kvp.Value), + ClientVersion = score.ClientVersion, }; } } diff --git a/osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs index c5e6e3bcce..ed11691674 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreDecoder.cs @@ -125,6 +125,7 @@ namespace osu.Game.Scoring.Legacy score.ScoreInfo.Statistics = readScore.Statistics; score.ScoreInfo.MaximumStatistics = readScore.MaximumStatistics; score.ScoreInfo.Mods = readScore.Mods.Select(m => m.ToMod(currentRuleset)).ToArray(); + score.ScoreInfo.ClientVersion = readScore.ClientVersion; }); } } From 5ff95db02c2af9ce6e7b1d707ee88440e3df9e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 21 Dec 2023 13:06:42 +0100 Subject: [PATCH 292/567] Add test coverage of `ClientVersion` serialisation --- osu.Game.Tests/Beatmaps/Formats/LegacyScoreDecoderTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyScoreDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyScoreDecoderTest.cs index ab88be1511..4e281cf28e 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyScoreDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyScoreDecoderTest.cs @@ -219,6 +219,8 @@ namespace osu.Game.Tests.Beatmaps.Formats { new OsuModDoubleTime { SpeedChange = { Value = 1.1 } } }; + scoreInfo.OnlineID = 123123; + scoreInfo.ClientVersion = "2023.1221.0"; var beatmap = new TestBeatmap(ruleset); var score = new Score @@ -237,9 +239,11 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.Multiple(() => { + Assert.That(decodedAfterEncode.ScoreInfo.OnlineID, Is.EqualTo(123123)); Assert.That(decodedAfterEncode.ScoreInfo.Statistics, Is.EqualTo(scoreInfo.Statistics)); Assert.That(decodedAfterEncode.ScoreInfo.MaximumStatistics, Is.EqualTo(scoreInfo.MaximumStatistics)); Assert.That(decodedAfterEncode.ScoreInfo.Mods, Is.EqualTo(scoreInfo.Mods)); + Assert.That(decodedAfterEncode.ScoreInfo.ClientVersion, Is.EqualTo("2023.1221.0")); }); } From d4731e0830867868eec1050e51e90587bcfb330b Mon Sep 17 00:00:00 2001 From: Daniel Power Date: Thu, 21 Dec 2023 08:56:39 -0330 Subject: [PATCH 293/567] Fix scale of skin element bounding box --- osu.Game/Overlays/SkinEditor/SkinBlueprint.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs index 01cd3d97e0..8f8d899fad 100644 --- a/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs +++ b/osu.Game/Overlays/SkinEditor/SkinBlueprint.cs @@ -136,9 +136,10 @@ namespace osu.Game.Overlays.SkinEditor { base.Update(); + Vector2 scale = drawable.DrawInfo.MatrixInverse.ExtractScale().Xy; drawableQuad = drawable.ToScreenSpace( drawable.DrawRectangle - .Inflate(SkinSelectionHandler.INFLATE_SIZE)); + .Inflate(SkinSelectionHandler.INFLATE_SIZE * scale)); var localSpaceQuad = ToLocalSpace(drawableQuad); From b4e71a0787df19714a5cbf0a166a81d139d7cd23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 21 Dec 2023 13:58:12 +0100 Subject: [PATCH 294/567] Fix slider tick / end misses displaying with full size on legacy skins with animated misses Resolves https://github.com/ppy/osu/issues/25987. Structure is a bit clumsy but I'm not sure how to do better... --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index ca2c8ce6bc..68274ffa2d 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -50,17 +50,16 @@ namespace osu.Game.Skinning // legacy judgements don't play any transforms if they are an animation.... UNLESS they are the temporary displayed judgement from new piece. if (animation?.FrameCount > 1 && !forceTransforms) + { + if (isMissedTick()) + applyMissedTickScaling(); return; + } if (result.IsMiss()) { - bool isTick = result != HitResult.Miss; - - if (isTick) - { - this.ScaleTo(0.6f); - this.ScaleTo(0.3f, 100, Easing.In); - } + if (isMissedTick()) + applyMissedTickScaling(); else { this.ScaleTo(1.6f); @@ -95,6 +94,14 @@ namespace osu.Game.Skinning } } + private bool isMissedTick() => result.IsMiss() && result != HitResult.Miss; + + private void applyMissedTickScaling() + { + this.ScaleTo(0.6f); + this.ScaleTo(0.3f, 100, Easing.In); + } + public Drawable GetAboveHitObjectsProxiedContent() => CreateProxy(); } } From 3f6dad5502d6aec67d9e7522fdb69d21299d5058 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 01:33:50 +0900 Subject: [PATCH 295/567] Use classic HP values for non-classic osu! HP drain --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 + .../Scoring/OsuHealthProcessor.cs | 68 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index e53f20277b..35cbfa3790 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -48,6 +48,8 @@ namespace osu.Game.Rulesets.Osu public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(); + public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new OsuHealthProcessor(drainStartTime); + public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap, this); public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap); diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs new file mode 100644 index 0000000000..784d3b934d --- /dev/null +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -0,0 +1,68 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Scoring +{ + public partial class OsuHealthProcessor : DrainingHealthProcessor + { + public OsuHealthProcessor(double drainStartTime, double drainLenience = 0) + : base(drainStartTime, drainLenience) + { + } + + protected override double GetHealthIncreaseFor(JudgementResult result) + { + switch (result.Type) + { + case HitResult.SmallTickMiss: + return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.02, -0.075, -0.14); + + case HitResult.LargeTickMiss: + return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.02, -0.075, -0.14); + + case HitResult.Miss: + return IBeatmapDifficultyInfo.DifficultyRange(Beatmap.Difficulty.DrainRate, -0.03, -0.125, -0.2); + + case HitResult.SmallTickHit: + // When classic slider mechanics are enabled, this result comes from the tail. + return 0.02; + + case HitResult.LargeTickHit: + switch (result.HitObject) + { + case SliderTick: + return 0.015; + + case SliderHeadCircle: + case SliderTailCircle: + case SliderRepeat: + return 0.02; + } + + break; + + case HitResult.Meh: + return 0.002; + + case HitResult.Ok: + return 0.011; + + case HitResult.Great: + return 0.03; + + case HitResult.SmallBonus: + return 0.0085; + + case HitResult.LargeBonus: + return 0.01; + } + + return base.GetHealthIncreaseFor(result); + } + } +} From b31b9e96d0cf016e4f7b892116fd6951977a7853 Mon Sep 17 00:00:00 2001 From: Simon G <45692977+jeenyuhs@users.noreply.github.com> Date: Fri, 22 Dec 2023 03:04:48 +0100 Subject: [PATCH 296/567] adjust beatmap length and drain based on rate changing mods --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 25 ++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 2613857998..c69cd6ead6 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -161,6 +161,7 @@ namespace osu.Game.Screens.Select private ILocalisedBindableString artistBinding; private FillFlowContainer infoLabelContainer; private Container bpmLabelContainer; + private Container lengthLabelContainer; private readonly WorkingBeatmap working; private readonly RulesetInfo ruleset; @@ -341,10 +342,10 @@ namespace osu.Game.Screens.Select { settingChangeTracker?.Dispose(); - refreshBPMLabel(); + refreshBPMAndLengthLabel(); settingChangeTracker = new ModSettingChangeTracker(m.NewValue); - settingChangeTracker.SettingChanged += _ => refreshBPMLabel(); + settingChangeTracker.SettingChanged += _ => refreshBPMAndLengthLabel(); }, true); } @@ -370,12 +371,10 @@ namespace osu.Game.Screens.Select infoLabelContainer.Children = new Drawable[] { - new InfoLabel(new BeatmapStatistic + lengthLabelContainer = new Container { - Name = BeatmapsetsStrings.ShowStatsTotalLength(playableBeatmap.CalculateDrainLength().ToFormattedDuration()), - CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Length), - Content = working.BeatmapInfo.Length.ToFormattedDuration().ToString(), - }), + AutoSizeAxes = Axes.Both, + }, bpmLabelContainer = new Container { AutoSizeAxes = Axes.Both, @@ -394,7 +393,7 @@ namespace osu.Game.Screens.Select } } - private void refreshBPMLabel() + private void refreshBPMAndLengthLabel() { var beatmap = working.Beatmap; @@ -420,6 +419,16 @@ namespace osu.Game.Screens.Select CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Bpm), Content = labelText }); + + double drainLength = Math.Round(beatmap.CalculateDrainLength() / rate); + double hitLength = Math.Round(beatmap.BeatmapInfo.Length / rate); + + lengthLabelContainer.Child = new InfoLabel(new BeatmapStatistic + { + Name = BeatmapsetsStrings.ShowStatsTotalLength(drainLength.ToFormattedDuration()), + CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Length), + Content = hitLength.ToFormattedDuration().ToString(), + }); } private Drawable getMapper(BeatmapMetadata metadata) From 9c35e250368ca3d777e1b2f4394310008839d3b3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 13:38:52 +0900 Subject: [PATCH 297/567] Add failing tests --- .../Mods/TestSceneManiaModPerfect.cs | 29 +++++++++++++++++++ .../Mods/TestSceneOsuModPerfect.cs | 29 +++++++++++++++++++ osu.Game/Tests/Visual/ModPerfectTestScene.cs | 8 ++--- osu.Game/Tests/Visual/ModTestScene.cs | 18 ++++++------ 4 files changed, 71 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs index 97a6ee28f4..a734979bf6 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs @@ -1,9 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; using NUnit.Framework; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Replays; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Replays; using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Mania.Tests.Mods @@ -24,5 +29,29 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods [TestCase(false)] [TestCase(true)] public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss); + + [Test] + public void TestBreakOnHoldNote() => CreateModTest(new ModTestData + { + Mod = new ManiaModPerfect(), + PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2, + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new HoldNote + { + StartTime = 1000, + EndTime = 3000, + }, + }, + }, + ReplayFrames = new List + { + new ManiaReplayFrame(1000, ManiaAction.Key1), + new ManiaReplayFrame(2000) + } + }); } } diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs index 26c4133bc4..7030061e0e 100644 --- a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs +++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs @@ -1,11 +1,15 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; using NUnit.Framework; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Replays; using osu.Game.Tests.Visual; using osuTK; @@ -50,5 +54,30 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods CreateHitObjectTest(new HitObjectTestData(spinner), shouldMiss); } + + [Test] + public void TestMissSliderTail() => CreateModTest(new ModTestData + { + Mod = new OsuModPerfect(), + PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(true), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Slider + { + Position = new Vector2(256, 192), + StartTime = 1000, + Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, new Vector2(100, 0), }) + }, + }, + }, + ReplayFrames = new List + { + new OsuReplayFrame(1000, new Vector2(256, 192), OsuAction.LeftButton), + new OsuReplayFrame(1001, new Vector2(256, 192)), + } + }); } } diff --git a/osu.Game/Tests/Visual/ModPerfectTestScene.cs b/osu.Game/Tests/Visual/ModPerfectTestScene.cs index 164faa16aa..c6f4a27ec4 100644 --- a/osu.Game/Tests/Visual/ModPerfectTestScene.cs +++ b/osu.Game/Tests/Visual/ModPerfectTestScene.cs @@ -29,12 +29,12 @@ namespace osu.Game.Tests.Visual PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss) }); - protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer(); + protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer(CurrentTestData, AllowFail); - private partial class PerfectModTestPlayer : TestPlayer + protected partial class PerfectModTestPlayer : ModTestPlayer { - public PerfectModTestPlayer() - : base(showResults: false) + public PerfectModTestPlayer(ModTestData data, bool allowFail) + : base(data, allowFail) { } diff --git a/osu.Game/Tests/Visual/ModTestScene.cs b/osu.Game/Tests/Visual/ModTestScene.cs index aa5b506343..c2ebcdefac 100644 --- a/osu.Game/Tests/Visual/ModTestScene.cs +++ b/osu.Game/Tests/Visual/ModTestScene.cs @@ -20,35 +20,35 @@ namespace osu.Game.Tests.Visual { protected sealed override bool HasCustomSteps => true; - private ModTestData currentTestData; + protected ModTestData CurrentTestData { get; private set; } protected void CreateModTest(ModTestData testData) => CreateTest(() => { - AddStep("set test data", () => currentTestData = testData); + AddStep("set test data", () => CurrentTestData = testData); }); public override void TearDownSteps() { AddUntilStep("test passed", () => { - if (currentTestData == null) + if (CurrentTestData == null) return true; - return currentTestData.PassCondition?.Invoke() ?? false; + return CurrentTestData.PassCondition?.Invoke() ?? false; }); base.TearDownSteps(); } - protected sealed override IBeatmap CreateBeatmap(RulesetInfo ruleset) => currentTestData?.Beatmap ?? base.CreateBeatmap(ruleset); + protected sealed override IBeatmap CreateBeatmap(RulesetInfo ruleset) => CurrentTestData?.Beatmap ?? base.CreateBeatmap(ruleset); protected sealed override TestPlayer CreatePlayer(Ruleset ruleset) { var mods = new List(SelectedMods.Value); - if (currentTestData.Mods != null) - mods.AddRange(currentTestData.Mods); - if (currentTestData.Autoplay) + if (CurrentTestData.Mods != null) + mods.AddRange(CurrentTestData.Mods); + if (CurrentTestData.Autoplay) mods.Add(ruleset.GetAutoplayMod()); SelectedMods.Value = mods; @@ -56,7 +56,7 @@ namespace osu.Game.Tests.Visual return CreateModPlayer(ruleset); } - protected virtual TestPlayer CreateModPlayer(Ruleset ruleset) => new ModTestPlayer(currentTestData, AllowFail); + protected virtual TestPlayer CreateModPlayer(Ruleset ruleset) => new ModTestPlayer(CurrentTestData, AllowFail); protected partial class ModTestPlayer : TestPlayer { From ea778c6e0aa6bf52ae5e12f287b0fb7f131348ca Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 13:39:41 +0900 Subject: [PATCH 298/567] Fix perfect/sudden death not working on slider tails --- osu.Game/Rulesets/Mods/ModPerfect.cs | 4 +++- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 6f0bb7ad3b..0ba40ba070 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -28,7 +28,9 @@ namespace osu.Game.Rulesets.Mods } protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) - => result.Type.AffectsAccuracy() + => (isRelevantResult(result.Judgement.MinResult) || isRelevantResult(result.Judgement.MaxResult) || isRelevantResult(result.Type)) && result.Type != result.Judgement.MaxResult; + + private bool isRelevantResult(HitResult result) => result.AffectsAccuracy() || result.AffectsCombo(); } } diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 4e4e8662e8..56420e5ff4 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray(); protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) - => result.Type.AffectsCombo() + => (result.Judgement.MinResult.AffectsCombo() || result.Judgement.MaxResult.AffectsCombo() || result.Type.AffectsCombo()) && !result.IsHit; } } From 93efa98d9b8c1ce647a5baca6770f3c0c3e39755 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 16:19:36 +0900 Subject: [PATCH 299/567] Fix mania "Great" hits failing with perfect mod --- .../Mods/TestSceneManiaModPerfect.cs | 23 +++++++++++++++++++ .../Mods/ManiaModPerfect.cs | 15 ++++++++++++ 2 files changed, 38 insertions(+) diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs index a734979bf6..73d6fe357d 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs @@ -30,6 +30,29 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods [TestCase(true)] public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss); + [Test] + public void TestGreatHit() => CreateModTest(new ModTestData + { + Mod = new ManiaModPerfect(), + PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(false), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Note + { + StartTime = 1000, + } + }, + }, + ReplayFrames = new List + { + new ManiaReplayFrame(1020, ManiaAction.Key1), + new ManiaReplayFrame(2000) + } + }); + [Test] public void TestBreakOnHoldNote() => CreateModTest(new ModTestData { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs index 2e22e23dbd..b02a18c9f4 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs @@ -1,11 +1,26 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Mania.Mods { public class ManiaModPerfect : ModPerfect { + protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) + { + if (!isRelevantResult(result.Judgement.MinResult) && !isRelevantResult(result.Judgement.MaxResult) && !isRelevantResult(result.Type)) + return false; + + // Mania allows imperfect "Great" hits without failing. + if (result.Judgement.MaxResult == HitResult.Perfect) + return result.Type < HitResult.Great; + + return result.Type != result.Judgement.MaxResult; + } + + private bool isRelevantResult(HitResult result) => result.AffectsAccuracy() || result.AffectsCombo(); } } From 88a5ba8167facffe4c7c401ca32ddf9f003bf4df Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 16:43:09 +0900 Subject: [PATCH 300/567] Add mania/osu sudden death mod tests --- .../Mods/TestSceneCatchModPerfect.cs | 2 +- .../Mods/TestSceneManiaModPerfect.cs | 6 +- .../Mods/TestSceneManiaModSuddenDeath.cs | 72 +++++++++++++++++ .../Mods/TestSceneOsuModPerfect.cs | 4 +- .../Mods/TestSceneOsuModSuddenDeath.cs | 77 +++++++++++++++++++ .../Mods/TestSceneTaikoModPerfect.cs | 2 +- ...tScene.cs => ModFailConditionTestScene.cs} | 14 ++-- 7 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModSuddenDeath.cs create mode 100644 osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModSuddenDeath.cs rename osu.Game/Tests/Visual/{ModPerfectTestScene.cs => ModFailConditionTestScene.cs} (74%) diff --git a/osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModPerfect.cs b/osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModPerfect.cs index 45e7d7aa28..7d539f91e4 100644 --- a/osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModPerfect.cs +++ b/osu.Game.Rulesets.Catch.Tests/Mods/TestSceneCatchModPerfect.cs @@ -11,7 +11,7 @@ using osuTK; namespace osu.Game.Rulesets.Catch.Tests.Mods { - public partial class TestSceneCatchModPerfect : ModPerfectTestScene + public partial class TestSceneCatchModPerfect : ModFailConditionTestScene { protected override Ruleset CreatePlayerRuleset() => new CatchRuleset(); diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs index 73d6fe357d..51730e2b43 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModPerfect.cs @@ -13,7 +13,7 @@ using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Mania.Tests.Mods { - public partial class TestSceneManiaModPerfect : ModPerfectTestScene + public partial class TestSceneManiaModPerfect : ModFailConditionTestScene { protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset(); @@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods public void TestGreatHit() => CreateModTest(new ModTestData { Mod = new ManiaModPerfect(), - PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(false), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false), Autoplay = false, Beatmap = new Beatmap { @@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods public void TestBreakOnHoldNote() => CreateModTest(new ModTestData { Mod = new ManiaModPerfect(), - PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2, + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2, Autoplay = false, Beatmap = new Beatmap { diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModSuddenDeath.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModSuddenDeath.cs new file mode 100644 index 0000000000..619816a815 --- /dev/null +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModSuddenDeath.cs @@ -0,0 +1,72 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Mods; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Replays; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Replays; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Mania.Tests.Mods +{ + public partial class TestSceneManiaModSuddenDeath : ModFailConditionTestScene + { + protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset(); + + public TestSceneManiaModSuddenDeath() + : base(new ManiaModSuddenDeath()) + { + } + + [Test] + public void TestGreatHit() => CreateModTest(new ModTestData + { + Mod = new ManiaModSuddenDeath(), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Note + { + StartTime = 1000, + } + }, + }, + ReplayFrames = new List + { + new ManiaReplayFrame(1020, ManiaAction.Key1), + new ManiaReplayFrame(2000) + } + }); + + [Test] + public void TestBreakOnHoldNote() => CreateModTest(new ModTestData + { + Mod = new ManiaModSuddenDeath(), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2, + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new HoldNote + { + StartTime = 1000, + EndTime = 3000, + }, + }, + }, + ReplayFrames = new List + { + new ManiaReplayFrame(1000, ManiaAction.Key1), + new ManiaReplayFrame(2000) + } + }); + } +} diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs index 7030061e0e..b01bbbfca1 100644 --- a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs +++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModPerfect.cs @@ -15,7 +15,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Tests.Mods { - public partial class TestSceneOsuModPerfect : ModPerfectTestScene + public partial class TestSceneOsuModPerfect : ModFailConditionTestScene { protected override Ruleset CreatePlayerRuleset() => new OsuRuleset(); @@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods public void TestMissSliderTail() => CreateModTest(new ModTestData { Mod = new OsuModPerfect(), - PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(true), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true), Autoplay = false, Beatmap = new Beatmap { diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModSuddenDeath.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModSuddenDeath.cs new file mode 100644 index 0000000000..ea048aaa6e --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModSuddenDeath.cs @@ -0,0 +1,77 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Replays; +using osu.Game.Tests.Visual; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests.Mods +{ + public partial class TestSceneOsuModSuddenDeath : ModFailConditionTestScene + { + protected override Ruleset CreatePlayerRuleset() => new OsuRuleset(); + + public TestSceneOsuModSuddenDeath() + : base(new OsuModSuddenDeath()) + { + } + + [Test] + public void TestMissTail() => CreateModTest(new ModTestData + { + Mod = new OsuModSuddenDeath(), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Slider + { + Position = new Vector2(256, 192), + StartTime = 1000, + Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, new Vector2(100, 0), }) + }, + }, + }, + ReplayFrames = new List + { + new OsuReplayFrame(1000, new Vector2(256, 192), OsuAction.LeftButton), + new OsuReplayFrame(1001, new Vector2(256, 192)), + } + }); + + [Test] + public void TestMissTick() => CreateModTest(new ModTestData + { + Mod = new OsuModSuddenDeath(), + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Slider + { + Position = new Vector2(256, 192), + StartTime = 1000, + Path = new SliderPath(PathType.LINEAR, new[] { Vector2.Zero, new Vector2(200, 0), }) + }, + }, + }, + ReplayFrames = new List + { + new OsuReplayFrame(1000, new Vector2(256, 192), OsuAction.LeftButton), + new OsuReplayFrame(1001, new Vector2(256, 192)), + } + }); + } +} diff --git a/osu.Game.Rulesets.Taiko.Tests/Mods/TestSceneTaikoModPerfect.cs b/osu.Game.Rulesets.Taiko.Tests/Mods/TestSceneTaikoModPerfect.cs index aed08f33e0..8a1157a7f8 100644 --- a/osu.Game.Rulesets.Taiko.Tests/Mods/TestSceneTaikoModPerfect.cs +++ b/osu.Game.Rulesets.Taiko.Tests/Mods/TestSceneTaikoModPerfect.cs @@ -10,7 +10,7 @@ using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Taiko.Tests.Mods { - public partial class TestSceneTaikoModPerfect : ModPerfectTestScene + public partial class TestSceneTaikoModPerfect : ModFailConditionTestScene { protected override Ruleset CreatePlayerRuleset() => new TestTaikoRuleset(); diff --git a/osu.Game/Tests/Visual/ModPerfectTestScene.cs b/osu.Game/Tests/Visual/ModFailConditionTestScene.cs similarity index 74% rename from osu.Game/Tests/Visual/ModPerfectTestScene.cs rename to osu.Game/Tests/Visual/ModFailConditionTestScene.cs index c6f4a27ec4..8f0dff055d 100644 --- a/osu.Game/Tests/Visual/ModPerfectTestScene.cs +++ b/osu.Game/Tests/Visual/ModFailConditionTestScene.cs @@ -8,11 +8,11 @@ using osu.Game.Rulesets.Objects; namespace osu.Game.Tests.Visual { - public abstract partial class ModPerfectTestScene : ModTestScene + public abstract partial class ModFailConditionTestScene : ModTestScene { - private readonly ModPerfect mod; + private readonly ModFailCondition mod; - protected ModPerfectTestScene(ModPerfect mod) + protected ModFailConditionTestScene(ModFailCondition mod) { this.mod = mod; } @@ -26,14 +26,14 @@ namespace osu.Game.Tests.Visual HitObjects = { testData.HitObject } }, Autoplay = !shouldMiss, - PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss) + PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss) }); - protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer(CurrentTestData, AllowFail); + protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new ModFailConditionTestPlayer(CurrentTestData, AllowFail); - protected partial class PerfectModTestPlayer : ModTestPlayer + protected partial class ModFailConditionTestPlayer : ModTestPlayer { - public PerfectModTestPlayer(ModTestData data, bool allowFail) + public ModFailConditionTestPlayer(ModTestData data, bool allowFail) : base(data, allowFail) { } From 5703546d715687d58b832c25082386d35abadb09 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 16:43:17 +0900 Subject: [PATCH 301/567] Revert change to ModSuddenDeath --- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 56420e5ff4..4e4e8662e8 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModPerfect)).ToArray(); protected override bool FailCondition(HealthProcessor healthProcessor, JudgementResult result) - => (result.Judgement.MinResult.AffectsCombo() || result.Judgement.MaxResult.AffectsCombo() || result.Type.AffectsCombo()) + => result.Type.AffectsCombo() && !result.IsHit; } } From a0185508b76af5f650534d575226d27fe3fc1f21 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 22 Dec 2023 17:55:06 +0900 Subject: [PATCH 302/567] Add basic consideration of density for HP drain --- .../Scoring/OsuHealthProcessor.cs | 4 ++ .../Scoring/DrainingHealthProcessor.cs | 55 +++++++++++++++++-- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 784d3b934d..5ae5766cda 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -3,6 +3,8 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Scoring; @@ -15,6 +17,8 @@ namespace osu.Game.Rulesets.Osu.Scoring { } + protected override int? GetDensityGroup(HitObject hitObject) => (hitObject as IHasComboInformation)?.ComboIndex; + protected override double GetHealthIncreaseFor(JudgementResult result) { switch (result.Type) diff --git a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs index a2fc23ac2e..4f6f8598fb 100644 --- a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs +++ b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs @@ -61,7 +61,9 @@ namespace osu.Game.Rulesets.Scoring /// protected readonly double DrainLenience; - private readonly List<(double time, double health)> healthIncreases = new List<(double, double)>(); + private readonly List healthIncreases = new List(); + private readonly Dictionary densityMultiplierByGroup = new Dictionary(); + private double gameplayEndTime; private double targetMinimumHealth; @@ -133,14 +135,33 @@ namespace osu.Game.Rulesets.Scoring { base.ApplyResultInternal(result); - if (!result.Type.IsBonus()) - healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result))); + if (IsSimulating && !result.Type.IsBonus()) + { + healthIncreases.Add(new HealthIncrease( + result.HitObject.GetEndTime() + result.TimeOffset, + GetHealthIncreaseFor(result), + GetDensityGroup(result.HitObject))); + } } + protected override double GetHealthIncreaseFor(JudgementResult result) => base.GetHealthIncreaseFor(result) * getDensityMultiplier(GetDensityGroup(result.HitObject)); + + private double getDensityMultiplier(int? group) + { + if (group == null) + return 1; + + return densityMultiplierByGroup.TryGetValue(group.Value, out double multiplier) ? multiplier : 1; + } + + protected virtual int? GetDensityGroup(HitObject hitObject) => null; + protected override void Reset(bool storeResults) { base.Reset(storeResults); + densityMultiplierByGroup.Clear(); + if (storeResults) DrainRate = ComputeDrainRate(); @@ -152,6 +173,24 @@ namespace osu.Game.Rulesets.Scoring if (healthIncreases.Count <= 1) return 0; + // Normalise the health gain during sections with higher densities. + (int group, double avgIncrease)[] avgIncreasesByGroup = healthIncreases + .Where(i => i.Group != null) + .GroupBy(i => i.Group) + .Select(g => ((int)g.Key!, g.Sum(i => i.Amount) / (g.Max(i => i.Time) - g.Min(i => i.Time) + 1))) + .ToArray(); + + if (avgIncreasesByGroup.Length > 1) + { + double overallAverageIncrease = avgIncreasesByGroup.Average(g => g.avgIncrease); + + foreach ((int group, double avgIncrease) in avgIncreasesByGroup) + { + // Reduce the health increase for groups that return more health than average. + densityMultiplierByGroup[group] = Math.Min(1, overallAverageIncrease / avgIncrease); + } + } + int adjustment = 1; double result = 1; @@ -165,8 +204,8 @@ namespace osu.Game.Rulesets.Scoring for (int i = 0; i < healthIncreases.Count; i++) { - double currentTime = healthIncreases[i].time; - double lastTime = i > 0 ? healthIncreases[i - 1].time : DrainStartTime; + double currentTime = healthIncreases[i].Time; + double lastTime = i > 0 ? healthIncreases[i - 1].Time : DrainStartTime; while (currentBreak < Beatmap.Breaks.Count && Beatmap.Breaks[currentBreak].EndTime <= currentTime) { @@ -177,10 +216,12 @@ namespace osu.Game.Rulesets.Scoring currentBreak++; } + double multiplier = getDensityMultiplier(healthIncreases[i].Group); + // Apply health adjustments currentHealth -= (currentTime - lastTime) * result; lowestHealth = Math.Min(lowestHealth, currentHealth); - currentHealth = Math.Min(1, currentHealth + healthIncreases[i].health); + currentHealth = Math.Min(1, currentHealth + healthIncreases[i].Amount * multiplier); // Common scenario for when the drain rate is definitely too harsh if (lowestHealth < 0) @@ -198,5 +239,7 @@ namespace osu.Game.Rulesets.Scoring return result; } + + private record struct HealthIncrease(double Time, double Amount, int? Group); } } From 7e557152fb430219ab484107d592311e983094f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 22 Dec 2023 12:40:24 +0100 Subject: [PATCH 303/567] Fix relax mod not considering full follow area radius when automatically holding sliders Closes https://github.com/ppy/osu/issues/25947. Regressed in https://github.com/ppy/osu/pull/25776 with the changes to `DrawableSliderBall`. I would have liked to include tests, but relax mod is a bit untestable, because it disengages completely in the presence of a replay: https://github.com/ppy/osu/blob/7e09164d7084265536570ac7036d7244934b651c/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs#L49-L58 Additionally, `RulesetInputManager` disengages completely from parent inputs when there is a replay active: https://github.com/ppy/osu/blob/7e09164d7084265536570ac7036d7244934b651c/osu.Game/Rulesets/UI/RulesetInputManager.cs#L116 which means there is really no easy way to control positional input while still having relax logic work. So I'm hoping the fix could be considered obvious enough to not require test coverage. --- osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs | 2 +- .../Objects/Drawables/SliderInputManager.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs index aaa7c70a8d..40fadfb77e 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Mods if (!slider.HeadCircle.IsHit) handleHitCircle(slider.HeadCircle); - requiresHold |= slider.Ball.IsHovered || h.IsHovered; + requiresHold |= slider.SliderInputManager.IsMouseInFollowArea(true); break; case DrawableSpinner spinner: diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs index 8aa982783e..95896c7c91 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/SliderInputManager.cs @@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void Update() { base.Update(); - updateTracking(isMouseInFollowArea(Tracking)); + updateTracking(IsMouseInFollowArea(Tracking)); } public void PostProcessHeadJudgement(DrawableSliderHead head) @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!head.Judged || !head.Result.IsHit) return; - if (!isMouseInFollowArea(true)) + if (!IsMouseInFollowArea(true)) return; Debug.Assert(screenSpaceMousePosition != null); @@ -129,7 +129,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables // If all ticks were hit so far, enable tracking the full extent. // If any ticks were missed, assume tracking would've broken at some point, and should only activate if the cursor is within the slider ball. // For the second case, this may be the last chance we have to enable tracking before other objects get judged, otherwise the same would normally happen via Update(). - updateTracking(allTicksInRange || isMouseInFollowArea(false)); + updateTracking(allTicksInRange || IsMouseInFollowArea(false)); } public void TryJudgeNestedObject(DrawableOsuHitObject nestedObject, double timeOffset) @@ -174,7 +174,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables /// Whether the mouse is currently in the follow area. /// /// Whether to test against the maximum area of the follow circle. - private bool isMouseInFollowArea(bool expanded) + public bool IsMouseInFollowArea(bool expanded) { if (screenSpaceMousePosition is not Vector2 pos) return false; From 6cb82310549a73ca2657efe65c9528da8367f1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 22 Dec 2023 13:22:26 +0100 Subject: [PATCH 304/567] Add test coverage for failure case --- .../Mods/TestSceneOsuModStrictTracking.cs | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs new file mode 100644 index 0000000000..726b415977 --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs @@ -0,0 +1,53 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Replays; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests.Mods +{ + public partial class TestSceneOsuModStrictTracking : OsuModTestScene + { + [Test] + public void TestSliderInput() => CreateModTest(new ModTestData + { + Mod = new OsuModStrictTracking(), + Autoplay = false, + Beatmap = new Beatmap + { + HitObjects = new List + { + new Slider + { + StartTime = 1000, + Path = new SliderPath + { + ControlPoints = + { + new PathControlPoint(), + new PathControlPoint(new Vector2(0, 100)) + } + } + } + } + }, + ReplayFrames = new List + { + new OsuReplayFrame(0, new Vector2(), OsuAction.LeftButton), + new OsuReplayFrame(500, new Vector2(200, 0), OsuAction.LeftButton), + new OsuReplayFrame(501, new Vector2(200, 0)), + new OsuReplayFrame(1000, new Vector2(), OsuAction.LeftButton), + new OsuReplayFrame(1750, new Vector2(0, 100), OsuAction.LeftButton), + new OsuReplayFrame(1751, new Vector2(0, 100)), + }, + PassCondition = () => Player.ScoreProcessor.Combo.Value == 2 + }); + } +} From 30553dc7b839600145ac57bd789b7e9992c34dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 22 Dec 2023 13:38:07 +0100 Subject: [PATCH 305/567] Fix strict tracking mod forcefully missing tail before slider start time Closes https://github.com/ppy/osu/issues/25816. Regressed in https://github.com/ppy/osu/pull/25748. The reason this broke is that allowing the state of `Tracking` to change before the slider's start time to support the early hit scenario causes strict tracking to consider loss of tracking before the slider's start time as an actual miss, and thus forcefully miss the tail (see test case in 6cb82310549a73ca2657efe65c9528da8367f1ab). --- osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs b/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs index c465ab8732..2c9292c58b 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs @@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Osu.Mods { if (e.NewValue || slider.Judged) return; + if (slider.Time.Current < slider.HitObject.StartTime) + return; + var tail = slider.NestedHitObjects.OfType().First(); if (!tail.Judged) From 01cf4ee15a8456ccc56381f138dfdf7f210de121 Mon Sep 17 00:00:00 2001 From: Simon G <45692977+jeenyuhs@users.noreply.github.com> Date: Fri, 22 Dec 2023 18:11:37 +0100 Subject: [PATCH 306/567] add test for length updates --- .../SongSelect/TestSceneBeatmapInfoWedge.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs index 7cd4f06bce..4e100a37dc 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs @@ -3,6 +3,7 @@ #nullable disable +using System; using System.Collections.Generic; using System.Linq; using JetBrains.Annotations; @@ -194,6 +195,36 @@ namespace osu.Game.Tests.Visual.SongSelect }); } + [TestCase] + public void TestLengthUpdates() + { + IBeatmap beatmap = createTestBeatmap(new OsuRuleset().RulesetInfo); + double drain = beatmap.CalculateDrainLength(); + beatmap.BeatmapInfo.Length = drain; + + OsuModDoubleTime doubleTime = null; + + selectBeatmap(beatmap); + checkDisplayedLength(drain); + + AddStep("select DT", () => SelectedMods.Value = new[] { doubleTime = new OsuModDoubleTime() }); + checkDisplayedLength(Math.Round(drain / 1.5f)); + + AddStep("change DT rate", () => doubleTime.SpeedChange.Value = 2); + checkDisplayedLength(Math.Round(drain / 2)); + } + + private void checkDisplayedLength(double drain) + { + var displayedLength = drain.ToFormattedDuration(); + + AddUntilStep($"check map drain ({displayedLength})", () => + { + var label = infoWedge.DisplayedContent.ChildrenOfType().Single(l => l.Statistic.Name == BeatmapsetsStrings.ShowStatsTotalLength(displayedLength)); + return label.Statistic.Content == displayedLength.ToString(); + }); + } + private void setRuleset(RulesetInfo rulesetInfo) { Container containerBefore = null; From c5893f245ce7a89d1900dbb620390823702481fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 14:03:45 +0900 Subject: [PATCH 307/567] Change legacy version checks to account for users specifying incorrect versions --- osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs | 2 +- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs index d8d86d1802..ef616ae964 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyMainCirclePiece.cs @@ -160,7 +160,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy { decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - if (legacyVersion >= 2.0m) + if (legacyVersion > 1.0m) // legacy skins of version 2.0 and newer only apply very short fade out to the number piece. hitCircleText.FadeOut(legacy_fade_duration / 4); else diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index 68274ffa2d..b8fe2f8d06 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -67,7 +67,7 @@ namespace osu.Game.Skinning decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; - if (legacyVersion >= 2.0m) + if (legacyVersion > 1.0m) { this.MoveTo(new Vector2(0, -5)); this.MoveToOffset(new Vector2(0, 80), fade_out_delay + fade_out_length, Easing.In); From 9f34dfa2baa7e649d43ad74a444fa32df7b172e3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 16:25:52 +0900 Subject: [PATCH 308/567] Add missing using statement --- osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs index 4e100a37dc..fd102da026 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs @@ -15,6 +15,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Extensions; using osu.Game.Graphics.Sprites; using osu.Game.Resources.Localisation.Web; using osu.Game.Rulesets; From 8349cb7bbe4f30777f73cbf7c18f071997bd185c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 17:03:57 +0900 Subject: [PATCH 309/567] Fix hard crash when attempting to change folder location during a large import Closes https://github.com/ppy/osu/issues/26067. --- osu.Game/OsuGameBase.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 2d8024a45a..48548dc1ef 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -527,14 +527,21 @@ namespace osu.Game { ManualResetEventSlim readyToRun = new ManualResetEventSlim(); + bool success = false; + Scheduler.Add(() => { - realmBlocker = realm.BlockAllOperations("migration"); + try + { + realmBlocker = realm.BlockAllOperations("migration"); + success = true; + } + catch { } readyToRun.Set(); }, false); - if (!readyToRun.Wait(30000)) + if (!readyToRun.Wait(30000) || !success) throw new TimeoutException("Attempting to block for migration took too long."); bool? cleanupSucceded = (Storage as OsuStorage)?.Migrate(Host.GetStorage(path)); From 27a9dcc5a1a375e7d0591c90880ccb09fd8c0042 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 19:55:05 +0900 Subject: [PATCH 310/567] Add basic hotkey offset adjust support (via existing offset control) --- .../Input/Bindings/GlobalActionContainer.cs | 8 ++ .../GlobalActionKeyBindingStrings.cs | 10 +++ .../PlayerSettings/BeatmapOffsetControl.cs | 73 +++++++++++++------ 3 files changed, 68 insertions(+), 23 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 947cd5f54f..5a39c02185 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -160,6 +160,8 @@ namespace osu.Game.Input.Bindings new KeyBinding(InputKey.Enter, GlobalAction.ToggleChatFocus), new KeyBinding(InputKey.F1, GlobalAction.SaveReplay), new KeyBinding(InputKey.F2, GlobalAction.ExportReplay), + new KeyBinding(InputKey.Plus, GlobalAction.IncreaseOffset), + new KeyBinding(InputKey.Minus, GlobalAction.DecreaseOffset), }; private static IEnumerable replayKeyBindings => new[] @@ -404,6 +406,12 @@ namespace osu.Game.Input.Bindings [LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.EditorToggleRotateControl))] EditorToggleRotateControl, + + [LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.IncreaseOffset))] + IncreaseOffset, + + [LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.DecreaseOffset))] + DecreaseOffset } public enum GlobalActionCategory diff --git a/osu.Game/Localisation/GlobalActionKeyBindingStrings.cs b/osu.Game/Localisation/GlobalActionKeyBindingStrings.cs index 8356c480dd..ca27d0ff95 100644 --- a/osu.Game/Localisation/GlobalActionKeyBindingStrings.cs +++ b/osu.Game/Localisation/GlobalActionKeyBindingStrings.cs @@ -344,6 +344,16 @@ namespace osu.Game.Localisation /// public static LocalisableString ExportReplay => new TranslatableString(getKey(@"export_replay"), @"Export replay"); + /// + /// "Increase offset" + /// + public static LocalisableString IncreaseOffset => new TranslatableString(getKey(@"increase_offset"), @"Increase offset"); + + /// + /// "Decrease offset" + /// + public static LocalisableString DecreaseOffset => new TranslatableString(getKey(@"decrease_offset"), @"Decrease offset"); + /// /// "Toggle rotate control" /// diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index 840077eb7f..b4bb35377d 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -9,6 +9,8 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Input.Bindings; +using osu.Framework.Input.Events; using osu.Framework.Localisation; using osu.Framework.Utils; using osu.Game.Beatmaps; @@ -16,6 +18,7 @@ using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Input.Bindings; using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; @@ -26,7 +29,7 @@ using osuTK; namespace osu.Game.Screens.Play.PlayerSettings { - public partial class BeatmapOffsetControl : CompositeDrawable + public partial class BeatmapOffsetControl : CompositeDrawable, IKeyBindingHandler { public Bindable ReferenceScore { get; } = new Bindable(); @@ -88,28 +91,6 @@ namespace osu.Game.Screens.Play.PlayerSettings }; } - public partial class OffsetSliderBar : PlayerSliderBar - { - protected override Drawable CreateControl() => new CustomSliderBar(); - - protected partial class CustomSliderBar : SliderBar - { - public override LocalisableString TooltipText => - Current.Value == 0 - ? LocalisableString.Interpolate($@"{base.TooltipText} ms") - : LocalisableString.Interpolate($@"{base.TooltipText} ms {getEarlyLateText(Current.Value)}"); - - private LocalisableString getEarlyLateText(double value) - { - Debug.Assert(value != 0); - - return value > 0 - ? BeatmapOffsetControlStrings.HitObjectsAppearEarlier - : BeatmapOffsetControlStrings.HitObjectsAppearLater; - } - } - } - protected override void LoadComplete() { base.LoadComplete(); @@ -243,5 +224,51 @@ namespace osu.Game.Screens.Play.PlayerSettings base.Dispose(isDisposing); beatmapOffsetSubscription?.Dispose(); } + + public bool OnPressed(KeyBindingPressEvent e) + { + double amount = e.AltPressed ? 1 : 5; + + switch (e.Action) + { + case GlobalAction.IncreaseOffset: + Current.Value += amount; + + return true; + + case GlobalAction.DecreaseOffset: + Current.Value -= amount; + + return true; + } + + return false; + } + + public void OnReleased(KeyBindingReleaseEvent e) + { + } + + public partial class OffsetSliderBar : PlayerSliderBar + { + protected override Drawable CreateControl() => new CustomSliderBar(); + + protected partial class CustomSliderBar : SliderBar + { + public override LocalisableString TooltipText => + Current.Value == 0 + ? LocalisableString.Interpolate($@"{base.TooltipText} ms") + : LocalisableString.Interpolate($@"{base.TooltipText} ms {getEarlyLateText(Current.Value)}"); + + private LocalisableString getEarlyLateText(double value) + { + Debug.Assert(value != 0); + + return value > 0 + ? BeatmapOffsetControlStrings.HitObjectsAppearEarlier + : BeatmapOffsetControlStrings.HitObjectsAppearLater; + } + } + } } } From 7e9522a722fd01ca872877e1e3b4bcfeb61c8a2b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 20:46:12 +0900 Subject: [PATCH 311/567] Allow external use of offset text explanation --- .../PlayerSettings/BeatmapOffsetControl.cs | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index b4bb35377d..80549343a5 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -233,12 +233,10 @@ namespace osu.Game.Screens.Play.PlayerSettings { case GlobalAction.IncreaseOffset: Current.Value += amount; - return true; case GlobalAction.DecreaseOffset: Current.Value -= amount; - return true; } @@ -249,25 +247,29 @@ namespace osu.Game.Screens.Play.PlayerSettings { } + public static LocalisableString GetOffsetExplanatoryText(double offset) + { + return offset == 0 + ? LocalisableString.Interpolate($@"{offset:0.0} ms") + : LocalisableString.Interpolate($@"{offset:0.0} ms {getEarlyLateText(offset)}"); + + LocalisableString getEarlyLateText(double value) + { + Debug.Assert(value != 0); + + return value > 0 + ? BeatmapOffsetControlStrings.HitObjectsAppearEarlier + : BeatmapOffsetControlStrings.HitObjectsAppearLater; + } + } + public partial class OffsetSliderBar : PlayerSliderBar { protected override Drawable CreateControl() => new CustomSliderBar(); protected partial class CustomSliderBar : SliderBar { - public override LocalisableString TooltipText => - Current.Value == 0 - ? LocalisableString.Interpolate($@"{base.TooltipText} ms") - : LocalisableString.Interpolate($@"{base.TooltipText} ms {getEarlyLateText(Current.Value)}"); - - private LocalisableString getEarlyLateText(double value) - { - Debug.Assert(value != 0); - - return value > 0 - ? BeatmapOffsetControlStrings.HitObjectsAppearEarlier - : BeatmapOffsetControlStrings.HitObjectsAppearLater; - } + public override LocalisableString TooltipText => GetOffsetExplanatoryText(Current.Value); } } } From 6f11885d4bedc303859964ab1415a2f1959e9bda Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 20:46:22 +0900 Subject: [PATCH 312/567] Add control to allow changing offset from gameplay --- .../Screens/Play/GameplayOffsetControl.cs | 104 ++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 6 + 2 files changed, 110 insertions(+) create mode 100644 osu.Game/Screens/Play/GameplayOffsetControl.cs diff --git a/osu.Game/Screens/Play/GameplayOffsetControl.cs b/osu.Game/Screens/Play/GameplayOffsetControl.cs new file mode 100644 index 0000000000..3f5a5bef2a --- /dev/null +++ b/osu.Game/Screens/Play/GameplayOffsetControl.cs @@ -0,0 +1,104 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Threading; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Overlays; +using osu.Game.Screens.Play.PlayerSettings; +using osuTK; +using osuTK.Graphics; + +namespace osu.Game.Screens.Play +{ + /// + /// This provides the ability to change the offset while in gameplay. + /// Eventually this should be replaced with all settings from PlayerLoader being accessible from the game. + /// + internal partial class GameplayOffsetControl : VisibilityContainer + { + protected override bool StartHidden => true; + + public override bool PropagateNonPositionalInputSubTree => true; + + private BeatmapOffsetControl offsetControl = null!; + + private OsuTextFlowContainer text = null!; + + private ScheduledDelegate? hideOp; + + public GameplayOffsetControl() + { + AutoSizeAxes = Axes.Y; + Width = SettingsToolboxGroup.CONTAINER_WIDTH; + + Masking = true; + CornerRadius = 5; + + // Allow BeatmapOffsetControl to handle keyboard input. + AlwaysPresent = true; + + Anchor = Anchor.CentreRight; + Origin = Anchor.CentreRight; + + X = 100; + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider? colourProvider) + { + InternalChildren = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.8f, + Colour = colourProvider?.Background4 ?? Color4.Black, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding(10), + Spacing = new Vector2(5), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + offsetControl = new BeatmapOffsetControl(), + text = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(weight: FontWeight.SemiBold)) + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + TextAnchor = Anchor.TopCentre, + } + } + }, + }; + + offsetControl.Current.BindValueChanged(val => + { + text.Text = BeatmapOffsetControl.GetOffsetExplanatoryText(val.NewValue); + Show(); + + hideOp?.Cancel(); + hideOp = Scheduler.AddDelayed(Hide, 500); + }); + } + + protected override void PopIn() + { + this.FadeIn(500, Easing.OutQuint) + .MoveToX(0, 500, Easing.OutQuint); + } + + protected override void PopOut() + { + this.FadeOut(500, Easing.InQuint) + .MoveToX(100, 500, Easing.InQuint); + } + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c9251b0a78..c960ac357f 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -461,6 +461,12 @@ namespace osu.Game.Screens.Play OnRetry = () => Restart(), OnQuit = () => PerformExit(true), }, + new GameplayOffsetControl + { + Margin = new MarginPadding(20), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + } }, }; From a2e5f624789d852a23d555e12b5dd962ad6f7712 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 21:07:17 +0900 Subject: [PATCH 313/567] Fix user profile cover showing 1px line when contracted Addresses https://github.com/ppy/osu/discussions/26068. --- osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs index 36bd8a5af5..c9e5068b2a 100644 --- a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs @@ -232,6 +232,14 @@ namespace osu.Game.Overlays.Profile.Header bool expanded = coverToggle.CoverExpanded.Value; cover.ResizeHeightTo(expanded ? 250 : 0, transition_duration, Easing.OutQuint); + + // Without this a very tiny slither of the cover will be visible even with a size of zero. + // Integer masking woes, no doubt. + if (expanded) + cover.FadeIn(transition_duration, Easing.OutQuint); + else + cover.FadeOut(transition_duration, Easing.InQuint); + avatar.ResizeTo(new Vector2(expanded ? 120 : content_height), transition_duration, Easing.OutQuint); avatar.TransformTo(nameof(avatar.CornerRadius), expanded ? 40f : 20f, transition_duration, Easing.OutQuint); flow.TransformTo(nameof(flow.Spacing), new Vector2(expanded ? 20f : 10f), transition_duration, Easing.OutQuint); From 007ea51e202d546e813725991221436066c3db74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Dec 2023 13:07:29 +0100 Subject: [PATCH 314/567] Add extra safety against returning negative total score in conversion operation --- .../StandardisedScoreMigrationTools.cs | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 380bf63e63..5cd2a2f29c 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -321,6 +321,8 @@ namespace osu.Game.Database double modMultiplier = score.Mods.Select(m => m.ScoreMultiplier).Aggregate(1.0, (c, n) => c * n); + long convertedTotalScore; + switch (score.Ruleset.OnlineID) { case 0: @@ -417,32 +419,42 @@ namespace osu.Game.Database double newComboScoreProportion = estimatedComboPortionInStandardisedScore / maximumAchievableComboPortionInStandardisedScore; - return (long)Math.Round(( + convertedTotalScore = (long)Math.Round(( 500000 * newComboScoreProportion * score.Accuracy + 500000 * Math.Pow(score.Accuracy, 5) + bonusProportion) * modMultiplier); + break; case 1: - return (long)Math.Round(( + convertedTotalScore = (long)Math.Round(( 250000 * comboProportion + 750000 * Math.Pow(score.Accuracy, 3.6) + bonusProportion) * modMultiplier); + break; case 2: - return (long)Math.Round(( + convertedTotalScore = (long)Math.Round(( 600000 * comboProportion + 400000 * score.Accuracy + bonusProportion) * modMultiplier); + break; case 3: - return (long)Math.Round(( + convertedTotalScore = (long)Math.Round(( 850000 * comboProportion + 150000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + bonusProportion) * modMultiplier); + break; default: - return score.TotalScore; + convertedTotalScore = score.TotalScore; + break; } + + if (convertedTotalScore < 0) + throw new InvalidOperationException($"Total score conversion operation returned invalid total of {convertedTotalScore}"); + + return convertedTotalScore; } public static double ComputeAccuracy(ScoreInfo scoreInfo) From 15a9740eb65f39dbc3e58c55ad146e3103d483a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 21:12:47 +0900 Subject: [PATCH 315/567] Change "cinema" mod to never fail Addresses https://github.com/ppy/osu/discussions/26032. --- osu.Game/Rulesets/Mods/ModCinema.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index ae661c5f25..a942bcc678 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Mods } } - public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer + public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer, IApplicableFailOverride { public override string Name => "Cinema"; public override string Acronym => "CN"; @@ -45,5 +45,9 @@ namespace osu.Game.Rulesets.Mods player.BreakOverlay.Hide(); } + + public bool PerformFail() => false; + + public bool RestartOnFail => false; } } From 644c9816739b2aadfcdb9b5e14d438a0cae81313 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 23 Dec 2023 21:21:34 +0900 Subject: [PATCH 316/567] Fix "spectate" button not always being clickable in online users list --- osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs index fe3151398f..37ea3f9c38 100644 --- a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs +++ b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions; @@ -218,6 +219,7 @@ namespace osu.Game.Overlays.Dashboard { panel.Anchor = Anchor.TopCentre; panel.Origin = Anchor.TopCentre; + panel.CanSpectate.Value = playingUsers.Contains(user.Id); }); public partial class OnlineUserPanel : CompositeDrawable, IFilterable From 3a2ed3677b75bbbf8ec1683be7ecd8eb6e0a3e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Dec 2023 13:25:20 +0100 Subject: [PATCH 317/567] Fix standardised score conversion failing for scores set with 0.0x mod mutliplier Closes https://github.com/ppy/osu/issues/26073. --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 8 ++++++-- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 5cd2a2f29c..66c816e796 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -312,8 +312,12 @@ namespace osu.Game.Database double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy; // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. - double comboProportion = - ((double)score.LegacyTotalScore - legacyAccScore) / (maximumLegacyComboScore + maximumLegacyBonusScore); + // Note that `maximumLegacyComboScore + maximumLegacyBonusScore` can actually be 0 + // when playing a beatmap with no bonus objects, with mods that have a 0.0x multiplier on stable (relax/autopilot). + // In such cases, just assume 0. + double comboProportion = maximumLegacyComboScore + maximumLegacyBonusScore > 0 + ? ((double)score.LegacyTotalScore - legacyAccScore) / (maximumLegacyComboScore + maximumLegacyBonusScore) + : 0; // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index dbd9a106df..cf0a7bd54f 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -35,9 +35,10 @@ namespace osu.Game.Scoring.Legacy /// 30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores. /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. /// 30000008: Add accuracy conversion. Reconvert all scores. + /// 30000009: Fix edge cases in conversion for scores which have 0.0x mod multiplier on stable. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000008; + public const int LATEST_VERSION = 30000009; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From 32d8ee2d0c30b4922ac96bb172959ea375cd2e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Dec 2023 13:42:19 +0100 Subject: [PATCH 318/567] Add test coverage --- .../Online/TestSceneCurrentlyOnlineDisplay.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osu.Game.Tests/Visual/Online/TestSceneCurrentlyOnlineDisplay.cs b/osu.Game.Tests/Visual/Online/TestSceneCurrentlyOnlineDisplay.cs index 7687cd195d..b696c5d8ca 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneCurrentlyOnlineDisplay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneCurrentlyOnlineDisplay.cs @@ -81,6 +81,21 @@ namespace osu.Game.Tests.Visual.Online AddStep("End watching user presence", () => metadataClient.EndWatchingUserPresence()); } + [Test] + public void TestUserWasPlayingBeforeWatchingUserPresence() + { + AddStep("User began playing", () => spectatorClient.SendStartPlay(streamingUser.Id, 0)); + AddStep("Begin watching user presence", () => metadataClient.BeginWatchingUserPresence()); + AddStep("Add online user", () => metadataClient.UserPresenceUpdated(streamingUser.Id, new UserPresence { Status = UserStatus.Online, Activity = new UserActivity.ChoosingBeatmap() })); + AddUntilStep("Panel loaded", () => currentlyOnline.ChildrenOfType().FirstOrDefault()?.User.Id == 2); + AddAssert("Spectate button enabled", () => currentlyOnline.ChildrenOfType().First().Enabled.Value, () => Is.True); + + AddStep("User finished playing", () => spectatorClient.SendEndPlay(streamingUser.Id)); + AddAssert("Spectate button disabled", () => currentlyOnline.ChildrenOfType().First().Enabled.Value, () => Is.False); + AddStep("Remove playing user", () => metadataClient.UserPresenceUpdated(streamingUser.Id, null)); + AddStep("End watching user presence", () => metadataClient.EndWatchingUserPresence()); + } + internal partial class TestUserLookupCache : UserLookupCache { private static readonly string[] usernames = From 0cbf594a8c151e3699ca15431e29d3dac96f2016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Dec 2023 15:10:31 +0100 Subject: [PATCH 319/567] Make cinema mod incompatible with no fail --- osu.Game/Rulesets/Mods/ModCinema.cs | 2 +- osu.Game/Rulesets/Mods/ModNoFail.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index a942bcc678..dbb37e0af6 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModCinema; public override LocalisableString Description => "Watch the video without visual distractions."; - public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModAutoplay)).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail) }).ToArray(); public void ApplyToHUD(HUDOverlay overlay) { diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index 0cf81bf4c9..cc451772b2 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyReduction; public override LocalisableString Description => "You can't fail, no matter what."; public override double ScoreMultiplier => 0.5; - public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition) }; + public override Type[] IncompatibleMods => new[] { typeof(ModFailCondition), typeof(ModCinema) }; private readonly Bindable showHealthBar = new Bindable(); From d1000b2e6c527f170e9fd1dd525d2ba296c31f17 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 23 Dec 2023 23:36:15 +0900 Subject: [PATCH 320/567] remove HP density --- .../Scoring/OsuHealthProcessor.cs | 2 - .../Scoring/DrainingHealthProcessor.cs | 42 ++----------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 5ae5766cda..7463bb565c 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Osu.Scoring { } - protected override int? GetDensityGroup(HitObject hitObject) => (hitObject as IHasComboInformation)?.ComboIndex; - protected override double GetHealthIncreaseFor(JudgementResult result) { switch (result.Type) diff --git a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs index 4f6f8598fb..629a84ea62 100644 --- a/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs +++ b/osu.Game/Rulesets/Scoring/DrainingHealthProcessor.cs @@ -62,7 +62,6 @@ namespace osu.Game.Rulesets.Scoring protected readonly double DrainLenience; private readonly List healthIncreases = new List(); - private readonly Dictionary densityMultiplierByGroup = new Dictionary(); private double gameplayEndTime; private double targetMinimumHealth; @@ -139,29 +138,14 @@ namespace osu.Game.Rulesets.Scoring { healthIncreases.Add(new HealthIncrease( result.HitObject.GetEndTime() + result.TimeOffset, - GetHealthIncreaseFor(result), - GetDensityGroup(result.HitObject))); + GetHealthIncreaseFor(result))); } } - protected override double GetHealthIncreaseFor(JudgementResult result) => base.GetHealthIncreaseFor(result) * getDensityMultiplier(GetDensityGroup(result.HitObject)); - - private double getDensityMultiplier(int? group) - { - if (group == null) - return 1; - - return densityMultiplierByGroup.TryGetValue(group.Value, out double multiplier) ? multiplier : 1; - } - - protected virtual int? GetDensityGroup(HitObject hitObject) => null; - protected override void Reset(bool storeResults) { base.Reset(storeResults); - densityMultiplierByGroup.Clear(); - if (storeResults) DrainRate = ComputeDrainRate(); @@ -173,24 +157,6 @@ namespace osu.Game.Rulesets.Scoring if (healthIncreases.Count <= 1) return 0; - // Normalise the health gain during sections with higher densities. - (int group, double avgIncrease)[] avgIncreasesByGroup = healthIncreases - .Where(i => i.Group != null) - .GroupBy(i => i.Group) - .Select(g => ((int)g.Key!, g.Sum(i => i.Amount) / (g.Max(i => i.Time) - g.Min(i => i.Time) + 1))) - .ToArray(); - - if (avgIncreasesByGroup.Length > 1) - { - double overallAverageIncrease = avgIncreasesByGroup.Average(g => g.avgIncrease); - - foreach ((int group, double avgIncrease) in avgIncreasesByGroup) - { - // Reduce the health increase for groups that return more health than average. - densityMultiplierByGroup[group] = Math.Min(1, overallAverageIncrease / avgIncrease); - } - } - int adjustment = 1; double result = 1; @@ -216,12 +182,10 @@ namespace osu.Game.Rulesets.Scoring currentBreak++; } - double multiplier = getDensityMultiplier(healthIncreases[i].Group); - // Apply health adjustments currentHealth -= (currentTime - lastTime) * result; lowestHealth = Math.Min(lowestHealth, currentHealth); - currentHealth = Math.Min(1, currentHealth + healthIncreases[i].Amount * multiplier); + currentHealth = Math.Min(1, currentHealth + healthIncreases[i].Amount); // Common scenario for when the drain rate is definitely too harsh if (lowestHealth < 0) @@ -240,6 +204,6 @@ namespace osu.Game.Rulesets.Scoring return result; } - private record struct HealthIncrease(double Time, double Amount, int? Group); + private record struct HealthIncrease(double Time, double Amount); } } From 00090bc527989b6caa094a40caf67023aeb352b3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 23 Dec 2023 23:36:24 +0900 Subject: [PATCH 321/567] Add combo end bonus to HP --- .../Scoring/OsuHealthProcessor.cs | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 7463bb565c..672a8c91ba 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -1,10 +1,12 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Scoring; @@ -12,12 +14,68 @@ namespace osu.Game.Rulesets.Osu.Scoring { public partial class OsuHealthProcessor : DrainingHealthProcessor { + private ComboResult currentComboResult = ComboResult.Perfect; + public OsuHealthProcessor(double drainStartTime, double drainLenience = 0) : base(drainStartTime, drainLenience) { } protected override double GetHealthIncreaseFor(JudgementResult result) + { + if (IsSimulating) + return getHealthIncreaseFor(result); + + if (result.HitObject is not IHasComboInformation combo) + return getHealthIncreaseFor(result); + + if (combo.NewCombo) + currentComboResult = ComboResult.Perfect; + + switch (result.Type) + { + case HitResult.LargeTickMiss: + case HitResult.Ok: + setComboResult(ComboResult.Good); + break; + + case HitResult.Meh: + case HitResult.Miss: + setComboResult(ComboResult.None); + break; + } + + // The tail has a special IgnoreMiss judgement + if (result.HitObject is SliderTailCircle && !result.IsHit) + setComboResult(ComboResult.Good); + + if (combo.LastInCombo && result.Type.IsHit()) + { + switch (currentComboResult) + { + case ComboResult.Perfect: + return getHealthIncreaseFor(result) + 0.07; + + case ComboResult.Good: + return getHealthIncreaseFor(result) + 0.05; + + default: + return getHealthIncreaseFor(result) + 0.03; + } + } + + return getHealthIncreaseFor(result); + + void setComboResult(ComboResult comboResult) => currentComboResult = (ComboResult)Math.Min((int)currentComboResult, (int)comboResult); + } + + protected override void Reset(bool storeResults) + { + base.Reset(storeResults); + currentComboResult = ComboResult.Perfect; + } + + private double getHealthIncreaseFor(JudgementResult result) { switch (result.Type) { From 8b11bcc6ea617bbb689b793443a90b977ae2d5e9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 24 Dec 2023 00:08:15 +0900 Subject: [PATCH 322/567] Remove unused using --- osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 672a8c91ba..bd6281a7d3 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -4,7 +4,6 @@ using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; From 7437d21f498cca28084c7ed70341e714392e0690 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 24 Dec 2023 00:45:22 +0900 Subject: [PATCH 323/567] Adjust comment regarding slider tail --- osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index bd6281a7d3..2eb257b3e6 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Scoring break; } - // The tail has a special IgnoreMiss judgement + // The slider tail has a special judgement that can't accurately be described above. if (result.HitObject is SliderTailCircle && !result.IsHit) setComboResult(ComboResult.Good); From 92b490f2e79d850980fa9e681f7c62c1ba1d5692 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 24 Dec 2023 01:59:48 +0900 Subject: [PATCH 324/567] Don't bother with alt support for now --- osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index 80549343a5..80003aeaba 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -227,7 +227,10 @@ namespace osu.Game.Screens.Play.PlayerSettings public bool OnPressed(KeyBindingPressEvent e) { - double amount = e.AltPressed ? 1 : 5; + // To match stable, this should adjust by 5 ms, or 1 ms when holding alt. + // But that is hard to make work with global actions due to the operating mode. + // Let's use the more precise as a default for now. + const double amount = 1; switch (e.Action) { From 72bec527fd06714bd0b88f56ff1d7538bbf37710 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 24 Dec 2023 02:36:27 +0900 Subject: [PATCH 325/567] Add conditions to match stable offset adjust limitations --- .../PlayerSettings/BeatmapOffsetControl.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index 80003aeaba..b0e7d08699 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -51,6 +51,12 @@ namespace osu.Game.Screens.Play.PlayerSettings [Resolved] private OsuColour colours { get; set; } = null!; + [Resolved] + private Player? player { get; set; } + + [Resolved] + private IGameplayClock? gameplayClock { get; set; } + private double lastPlayAverage; private double lastPlayBeatmapOffset; private HitEventTimingDistributionGraph? lastPlayGraph; @@ -227,6 +233,18 @@ namespace osu.Game.Screens.Play.PlayerSettings public bool OnPressed(KeyBindingPressEvent e) { + // General limitations to ensure players don't do anything too weird. + // These match stable for now. + if (player is SubmittingPlayer) + { + // TODO: the blocking conditions should probably display a message. + if (player?.IsBreakTime.Value == false && gameplayClock?.CurrentTime - gameplayClock?.StartTime > 10000) + return false; + + if (gameplayClock?.IsPaused.Value == true) + return false; + } + // To match stable, this should adjust by 5 ms, or 1 ms when holding alt. // But that is hard to make work with global actions due to the operating mode. // Let's use the more precise as a default for now. From 686b2a4394ac735ef309976910fed859f3f3b779 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 24 Dec 2023 03:00:51 +0900 Subject: [PATCH 326/567] Disable positional interaction for now --- osu.Game/Screens/Play/GameplayOffsetControl.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Play/GameplayOffsetControl.cs b/osu.Game/Screens/Play/GameplayOffsetControl.cs index 3f5a5bef2a..2f0cb821ec 100644 --- a/osu.Game/Screens/Play/GameplayOffsetControl.cs +++ b/osu.Game/Screens/Play/GameplayOffsetControl.cs @@ -25,6 +25,9 @@ namespace osu.Game.Screens.Play public override bool PropagateNonPositionalInputSubTree => true; + // Disable interaction for now to avoid any funny business with slider bar dragging. + public override bool PropagatePositionalInputSubTree => false; + private BeatmapOffsetControl offsetControl = null!; private OsuTextFlowContainer text = null!; From 5b03dc8d0bb1d189dc68103971fccf41bfc2a008 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 24 Dec 2023 03:20:42 +0900 Subject: [PATCH 327/567] Use a realm subscription to avoid overhead when hovering a toolbar button Addresses https://github.com/ppy/osu/discussions/26018. --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 08bcb6bd8a..344f7b2018 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -157,6 +157,15 @@ namespace osu.Game.Overlays.Toolbar }; } + [BackgroundDependencyLoader] + private void load() + { + if (Hotkey != null) + { + realm.SubscribeToPropertyChanged(r => r.All().FirstOrDefault(rkb => rkb.RulesetName == null && rkb.ActionInt == (int)Hotkey.Value), kb => kb.KeyCombinationString, updateKeyBindingTooltip); + } + } + protected override bool OnMouseDown(MouseDownEvent e) => false; protected override bool OnClick(ClickEvent e) @@ -168,8 +177,6 @@ namespace osu.Game.Overlays.Toolbar protected override bool OnHover(HoverEvent e) { - updateKeyBindingTooltip(); - HoverBackground.FadeIn(200); tooltipContainer.FadeIn(100); @@ -197,19 +204,12 @@ namespace osu.Game.Overlays.Toolbar { } - private void updateKeyBindingTooltip() + private void updateKeyBindingTooltip(string keyCombination) { - if (Hotkey == null) return; + string keyBindingString = keyCombinationProvider.GetReadableString(keyCombination); - var realmKeyBinding = realm.Realm.All().FirstOrDefault(rkb => rkb.RulesetName == null && rkb.ActionInt == (int)Hotkey.Value); - - if (realmKeyBinding != null) - { - string keyBindingString = keyCombinationProvider.GetReadableString(realmKeyBinding.KeyCombination); - - if (!string.IsNullOrEmpty(keyBindingString)) - keyBindingTooltip.Text = $" ({keyBindingString})"; - } + if (!string.IsNullOrEmpty(keyBindingString)) + keyBindingTooltip.Text = $" ({keyBindingString})"; } } From 68430d6ecdbf7810285a818e4f762c07477f6de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 23 Dec 2023 19:39:17 +0100 Subject: [PATCH 328/567] Fix toolbar keybinding hint not clearing after unbinding the keybinding --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 344f7b2018..81d2de5acb 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -208,8 +208,9 @@ namespace osu.Game.Overlays.Toolbar { string keyBindingString = keyCombinationProvider.GetReadableString(keyCombination); - if (!string.IsNullOrEmpty(keyBindingString)) - keyBindingTooltip.Text = $" ({keyBindingString})"; + keyBindingTooltip.Text = !string.IsNullOrEmpty(keyBindingString) + ? $" ({keyBindingString})" + : string.Empty; } } From 19d02364185b72e97c157b42f1d668c2fa794dd8 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sat, 23 Dec 2023 22:11:00 +0300 Subject: [PATCH 329/567] Change mod acronym --- osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs index f71acf95b8..b70d607ca1 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDepth.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModDepth : ModWithVisibilityAdjustment, IUpdatableByPlayfield, IApplicableToDrawableRuleset { public override string Name => "Depth"; - public override string Acronym => "DH"; + public override string Acronym => "DP"; public override IconUsage? Icon => FontAwesome.Solid.Cube; public override ModType Type => ModType.Fun; public override LocalisableString Description => "3D. Almost."; From b1d994b6ffb617f12a09aca20cf0482a3b5db2b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Dec 2023 17:17:23 +0900 Subject: [PATCH 330/567] Add classic skin sprites for slider tick and slider end misses --- osu.Game/Skinning/LegacyJudgementPieceOld.cs | 16 +++++++++++++--- osu.Game/Skinning/LegacySkin.cs | 13 ++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/osu.Game/Skinning/LegacyJudgementPieceOld.cs b/osu.Game/Skinning/LegacyJudgementPieceOld.cs index b8fe2f8d06..1834a17279 100644 --- a/osu.Game/Skinning/LegacyJudgementPieceOld.cs +++ b/osu.Game/Skinning/LegacyJudgementPieceOld.cs @@ -58,14 +58,24 @@ namespace osu.Game.Skinning if (result.IsMiss()) { + decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; + + // missed ticks / slider end don't get the normal animation. if (isMissedTick()) - applyMissedTickScaling(); - else { this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - decimal? legacyVersion = skin.GetConfig(SkinConfiguration.LegacySetting.Version)?.Value; + if (legacyVersion > 1.0m) + { + this.MoveTo(new Vector2(0, -2f)); + this.MoveToOffset(new Vector2(0, 10), fade_out_delay + fade_out_length, Easing.In); + } + } + else + { + this.ScaleTo(1.6f); + this.ScaleTo(1, 100, Easing.In); if (legacyVersion > 1.0m) { diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index a37a386889..270abe2849 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -453,11 +453,18 @@ namespace osu.Game.Skinning private Drawable? getJudgementAnimation(HitResult result) { - if (result.IsMiss()) - return this.GetAnimation("hit0", true, false); - switch (result) { + case HitResult.Miss: + return this.GetAnimation("hit0", true, false); + + case HitResult.LargeTickMiss: + return this.GetAnimation("slidertickmiss", true, false); + + case HitResult.ComboBreak: + case HitResult.IgnoreMiss: + return this.GetAnimation("sliderendmiss", true, false); + case HitResult.Meh: return this.GetAnimation("hit50", true, false); From 02c771f540489eedaf56719632f500981b20da6a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Dec 2023 17:27:15 +0900 Subject: [PATCH 331/567] Add warning for linux users about to report a non-bug as a bug --- .github/ISSUE_TEMPLATE/bug-issue.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index 00a873f9c8..dfdcf8d320 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -11,6 +11,10 @@ body: - Current open `priority:0` issues, filterable [here](https://github.com/ppy/osu/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Apriority%3A0). - And most importantly, search for your issue both in the [issue listing](https://github.com/ppy/osu/issues) and the [Q&A discussion listing](https://github.com/ppy/osu/discussions/categories/q-a). If you find that it already exists, respond with a reaction or add any further information that may be helpful. + # ATTENTION LINUX USERS + + If you are having an issue and it is hardware related, **please open a [q&a discussion](https://github.com/ppy/osu/discussions/categories/q-a)** instead of an issue. There's a high chance your issue is due to your system configuration, and not our software. + - type: dropdown attributes: label: Type From 8e6ea2dd9b098aa41f32d54a3c953218aee459fd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Dec 2023 17:32:30 +0900 Subject: [PATCH 332/567] Update argon and triangles to match display style --- .../Skinning/Argon/ArgonJudgementPiece.cs | 11 ++++++++++- .../Rulesets/Judgements/DefaultJudgementPiece.cs | 15 ++++++++++++++- osu.Game/Rulesets/Scoring/HitResult.cs | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs index edeece0293..bb61bd37c1 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonJudgementPiece.cs @@ -62,7 +62,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon /// public virtual void PlayAnimation() { - if (Result.IsMiss()) + if (Result == HitResult.IgnoreMiss || Result == HitResult.LargeTickMiss) + { + this.RotateTo(-45); + this.ScaleTo(1.8f); + this.ScaleTo(1.2f, 100, Easing.In); + + this.MoveTo(Vector2.Zero); + this.MoveToOffset(new Vector2(0, 10), 800, Easing.InQuint); + } + else if (Result.IsMiss()) { this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); diff --git a/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs b/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs index 3c5e37f91c..ada651b60e 100644 --- a/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs +++ b/osu.Game/Rulesets/Judgements/DefaultJudgementPiece.cs @@ -38,7 +38,20 @@ namespace osu.Game.Rulesets.Judgements /// public virtual void PlayAnimation() { - if (Result != HitResult.None && !Result.IsHit()) + // TODO: make these better. currently they are using a text `-` and it's not centered properly. + // Should be an explicit drawable. + // + // When this is done, remove the [Description] attributes from HitResults which were added for this purpose. + if (Result == HitResult.IgnoreMiss || Result == HitResult.LargeTickMiss) + { + this.RotateTo(-45); + this.ScaleTo(1.8f); + this.ScaleTo(1.2f, 100, Easing.In); + + this.MoveTo(Vector2.Zero); + this.MoveToOffset(new Vector2(0, 10), 800, Easing.InQuint); + } + else if (Result.IsMiss()) { this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index e174ebd00f..2d55f1a649 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Scoring /// Indicates a large tick miss. /// [EnumMember(Value = "large_tick_miss")] - [Description(@"x")] + [Description("-")] [Order(10)] LargeTickMiss, @@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Scoring /// Indicates a miss that should be ignored for scoring purposes. /// [EnumMember(Value = "ignore_miss")] - [Description("x")] + [Description("-")] [Order(13)] IgnoreMiss, From 8142a7cb7e82d7053004cd6e4b2f62e74254ed57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 25 Dec 2023 14:00:32 +0100 Subject: [PATCH 333/567] Remove incorrect spec --- osu.Game/Skinning/LegacySkin.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 270abe2849..8f0cd59b68 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -461,7 +461,6 @@ namespace osu.Game.Skinning case HitResult.LargeTickMiss: return this.GetAnimation("slidertickmiss", true, false); - case HitResult.ComboBreak: case HitResult.IgnoreMiss: return this.GetAnimation("sliderendmiss", true, false); From 4fa35d709cb163a1a93bc17c6772f2b034614e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 25 Dec 2023 14:56:40 +0100 Subject: [PATCH 334/567] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2ec954b3a5..fbcdb00cdb 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -37,7 +37,7 @@ - + From f84b07e71a3298a5093eab2806a74c0ef2066679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 25 Dec 2023 19:01:06 +0100 Subject: [PATCH 335/567] Do not attempt to stop preview tracks when arriving from a "track completed" sync This fixes an issue identified with the WASAPI implementation in https://github.com/ppy/osu-framework/pull/6088. It has no real effect on current `master`, but fixes a deadlock that occurs with the aforementioned framework branch when one lets a preview track play out to the end - at this point all audio will stop and an attempt to perform any synchronous BASS operation (playing another track, seeking) will result in a deadlock. It isn't terribly clear as to why this is happening precisely, but there does not appear to be any need to stop and seek at that point, so this feels like a decent workaround even if the actual issue is upstream (and will unblock pushing out WASAPI support to users). --- osu.Game/Audio/PreviewTrack.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Audio/PreviewTrack.cs b/osu.Game/Audio/PreviewTrack.cs index d625566ee7..6184ff85dd 100644 --- a/osu.Game/Audio/PreviewTrack.cs +++ b/osu.Game/Audio/PreviewTrack.cs @@ -96,10 +96,13 @@ namespace osu.Game.Audio hasStarted = false; - Track.Stop(); + if (!Track.HasCompleted) + { + Track.Stop(); - // Ensure the track is reset immediately on stopping, so the next time it is started it has a correct time value. - Track.Seek(0); + // Ensure the track is reset immediately on stopping, so the next time it is started it has a correct time value. + Track.Seek(0); + } Stopped?.Invoke(); } From 060bf8beff4f58060e9d60f41dce5850a20748ba Mon Sep 17 00:00:00 2001 From: Nathan Tran Date: Mon, 25 Dec 2023 15:09:39 -0800 Subject: [PATCH 336/567] Fix rewind backtracking --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 370b559897..89911c9a69 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -643,7 +643,7 @@ namespace osu.Game.Screens.Select while (randomSelectedBeatmaps.Any()) { var beatmap = randomSelectedBeatmaps[^1]; - randomSelectedBeatmaps.Remove(beatmap); + randomSelectedBeatmaps.RemoveAt(randomSelectedBeatmaps.Count - 1); if (!beatmap.Filtered.Value && beatmap.BeatmapInfo.BeatmapSet?.DeletePending != true) { From b18b5b99773bffbd5cea8f2b536db763ae983f80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 12:06:56 +0900 Subject: [PATCH 337/567] Add inline note about deadlock --- osu.Game/Audio/PreviewTrack.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Audio/PreviewTrack.cs b/osu.Game/Audio/PreviewTrack.cs index 6184ff85dd..961990a1bd 100644 --- a/osu.Game/Audio/PreviewTrack.cs +++ b/osu.Game/Audio/PreviewTrack.cs @@ -96,6 +96,7 @@ namespace osu.Game.Audio hasStarted = false; + // This pre-check is important, fixes a BASS deadlock in some scenarios. if (!Track.HasCompleted) { Track.Stop(); From 2ec6aa7fbb92aa286f1281c4043274f6d007e98b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 26 Dec 2023 12:46:21 +0900 Subject: [PATCH 338/567] Make mania scroll speed independent of hit position --- .../UI/DrawableManiaRuleset.cs | 20 ++++++++++++++++++- .../Skinning/LegacyManiaSkinConfiguration.cs | 4 +++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 9169599798..bea536e4af 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -19,12 +19,14 @@ using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Replays; +using osu.Game.Rulesets.Mania.Skinning; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Scoring; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Mania.UI { @@ -57,6 +59,9 @@ namespace osu.Game.Rulesets.Mania.UI // Stores the current speed adjustment active in gameplay. private readonly Track speedAdjustmentTrack = new TrackVirtual(0); + [Resolved] + private ISkinSource skin { get; set; } + public DrawableManiaRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList mods = null) : base(ruleset, beatmap, mods) { @@ -104,7 +109,20 @@ namespace osu.Game.Rulesets.Mania.UI updateTimeRange(); } - private void updateTimeRange() => TimeRange.Value = smoothTimeRange * speedAdjustmentTrack.AggregateTempo.Value * speedAdjustmentTrack.AggregateFrequency.Value; + private void updateTimeRange() + { + float hitPosition = skin.GetConfig( + new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HitPosition))?.Value + ?? Stage.HIT_TARGET_POSITION; + + const float length_to_default_hit_position = 768 - LegacyManiaSkinConfiguration.DEFAULT_HIT_POSITION; + float lengthToHitPosition = 768 - hitPosition; + + // This scaling factor preserves the scroll speed as the scroll length varies from changes to the hit position. + float scale = lengthToHitPosition / length_to_default_hit_position; + + TimeRange.Value = smoothTimeRange * speedAdjustmentTrack.AggregateTempo.Value * speedAdjustmentTrack.AggregateFrequency.Value * scale; + } /// /// Computes a scroll time (in milliseconds) from a scroll speed in the range of 1-40. diff --git a/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs b/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs index 9acb29a793..042836984a 100644 --- a/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs +++ b/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs @@ -21,6 +21,8 @@ namespace osu.Game.Skinning /// public const float DEFAULT_COLUMN_SIZE = 30 * POSITION_SCALE_FACTOR; + public const float DEFAULT_HIT_POSITION = (480 - 402) * POSITION_SCALE_FACTOR; + public readonly int Keys; public Dictionary CustomColours { get; } = new Dictionary(); @@ -35,7 +37,7 @@ namespace osu.Game.Skinning public readonly float[] ExplosionWidth; public readonly float[] HoldNoteLightWidth; - public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR; + public float HitPosition = DEFAULT_HIT_POSITION; public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR; public float ScorePosition = 300 * POSITION_SCALE_FACTOR; public bool ShowJudgementLine = true; From f9e47242db508d596fe92afef5e15ab5f6583c1a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 17:44:49 +0900 Subject: [PATCH 339/567] Add visual offset to better align editor waveforms with expectations --- .../Edit/Compose/Components/Timeline/Timeline.cs | 7 ++++++- osu.Game/Screens/Edit/Editor.cs | 13 +++++++++++++ .../Edit/Timing/WaveformComparisonDisplay.cs | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs index 75de15fe56..83d34ab61a 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs @@ -141,7 +141,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline waveformOpacity = config.GetBindable(OsuSetting.EditorWaveformOpacity); track.BindTo(editorClock.Track); - track.BindValueChanged(_ => waveform.Waveform = beatmap.Value.Waveform, true); + track.BindValueChanged(_ => + { + waveform.Waveform = beatmap.Value.Waveform; + waveform.RelativePositionAxes = Axes.X; + waveform.X = -(float)(Editor.WAVEFORM_VISUAL_OFFSET / beatmap.Value.Track.Length); + }, true); Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom); } diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index a6c18bdf0e..c1f6c02301 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -60,6 +60,19 @@ namespace osu.Game.Screens.Edit [Cached] public partial class Editor : ScreenWithBeatmapBackground, IKeyBindingHandler, IKeyBindingHandler, IBeatSnapProvider, ISamplePlaybackDisabler, IBeatSyncProvider { + /// + /// An offset applied to waveform visuals to align them with expectations. + /// + /// + /// Historically, osu! beatmaps have an assumption of full system latency baked in. + /// This comes from a culmination of stable's platform offset, average hardware playback + /// latency, and users having their universal offsets tweaked to previous beatmaps. + /// + /// Coming to this value involved running various tests with existing users / beatmaps. + /// This included both visual and audible comparisons. Ballpark confidence is ≈2 ms. + /// + public const float WAVEFORM_VISUAL_OFFSET = 20; + public override float BackgroundParallaxAmount => 0.1f; public override bool AllowBackButton => false; diff --git a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs index 856bc7c303..b5315feccb 100644 --- a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs +++ b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs @@ -219,7 +219,7 @@ namespace osu.Game.Screens.Edit.Timing // offset to the required beat index. double time = selectedGroupStartTime + index * timingPoint.BeatLength; - float offset = (float)(time - visible_width / 2) / trackLength * scale; + float offset = (float)(time - visible_width / 2 + Editor.WAVEFORM_VISUAL_OFFSET) / trackLength * scale; row.Alpha = time < selectedGroupStartTime || time > selectedGroupEndTime ? 0.2f : 1; row.WaveformOffsetTo(-offset, animated); From 4e3bdb2b56bd0d8430ffeeb988498d42412d72ee Mon Sep 17 00:00:00 2001 From: Nathan Tran Date: Tue, 26 Dec 2023 00:57:06 -0800 Subject: [PATCH 340/567] Add test coverage --- .../SongSelect/TestSceneBeatmapCarousel.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs index c509d40e07..41ea347ef3 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs @@ -454,6 +454,23 @@ namespace osu.Game.Tests.Visual.SongSelect AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false)); } + [Test] + public void TestRewind() + { + const int local_set_count = 3; + const int random_select_count = local_set_count * 3; + loadBeatmaps(setCount: local_set_count); + + for (int i = 0; i < random_select_count; i++) + nextRandom(); + + for (int i = 0; i < random_select_count; i++) + { + prevRandom(); + AddAssert("correct random last selected", () => selectedSets.Peek() == carousel.SelectedBeatmapSet); + } + } + [Test] public void TestRewindToDeletedBeatmap() { From 225528d519cf65420cf54055ff0602edc3c211d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 19:20:41 +0900 Subject: [PATCH 341/567] Bail from score submission if audio playback rate is too far from reality Closes https://github.com/ppy/osu/issues/23149. --- .../Play/MasterGameplayClockContainer.cs | 55 +++++++++++++++++++ osu.Game/Screens/Play/SubmittingPlayer.cs | 8 +++ 2 files changed, 63 insertions(+) diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 54ed7ba626..2844d84f31 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -8,6 +8,7 @@ using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Bindables; using osu.Framework.Graphics; +using osu.Framework.Logging; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; @@ -39,6 +40,14 @@ namespace osu.Game.Screens.Play Precision = 0.1, }; + /// + /// Whether the audio playback is within acceptable ranges. + /// Will become false if audio playback is not going as expected. + /// + public IBindable PlaybackRateValid => playbackRateValid; + + private readonly Bindable playbackRateValid = new Bindable(true); + private readonly WorkingBeatmap beatmap; private Track track; @@ -128,6 +137,7 @@ namespace osu.Game.Screens.Play { // Safety in case the clock is seeked while stopped. LastStopTime = null; + elapsedValidationTime = null; base.Seek(time); } @@ -197,6 +207,51 @@ namespace osu.Game.Screens.Play addAdjustmentsToTrack(); } + protected override void Update() + { + base.Update(); + checkPlaybackValidity(); + } + + #region Clock validation (ensure things are running correctly for local gameplay) + + private double elapsedGameplayClockTime; + private double? elapsedValidationTime; + private int playbackDiscrepancyCount; + + private const int allowed_playback_discrepancies = 5; + + private void checkPlaybackValidity() + { + if (GameplayClock.IsRunning) + { + elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime; + + elapsedValidationTime ??= elapsedGameplayClockTime; + elapsedValidationTime += GameplayClock.Rate * Time.Elapsed; + + if (Math.Abs(elapsedGameplayClockTime - elapsedValidationTime!.Value) > 300) + { + if (playbackDiscrepancyCount++ > allowed_playback_discrepancies) + { + if (playbackRateValid.Value) + { + playbackRateValid.Value = false; + Logger.Log("System audio playback is not working as expected. Some online functionality will not work.\n\nPlease check your audio drivers.", level: LogLevel.Important); + } + } + else + { + Logger.Log($"Playback discrepancy detected ({playbackDiscrepancyCount} of allowed {allowed_playback_discrepancies}): {elapsedGameplayClockTime:N1} vs {elapsedValidationTime:N1}"); + } + + elapsedValidationTime = null; + } + } + } + + #endregion + private bool speedAdjustmentsApplied; private void addAdjustmentsToTrack() diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index 785164178a..f88526b8f9 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -208,6 +208,14 @@ namespace osu.Game.Screens.Play private Task submitScore(Score score) { + var masterClock = GameplayClockContainer as MasterGameplayClockContainer; + + if (masterClock?.PlaybackRateValid.Value != true) + { + Logger.Log("Score submission cancelled due to audio playback rate discrepancy."); + return Task.CompletedTask; + } + // token may be null if the request failed but gameplay was still allowed (see HandleTokenRetrievalFailure). if (token == null) { From 30b5b36f1d72f9285971287d6d78c4628c3dde94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 26 Dec 2023 12:19:04 +0100 Subject: [PATCH 342/567] Fix code quality inspection --- osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs index 41ea347ef3..aa4c879468 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs @@ -467,7 +467,7 @@ namespace osu.Game.Tests.Visual.SongSelect for (int i = 0; i < random_select_count; i++) { prevRandom(); - AddAssert("correct random last selected", () => selectedSets.Peek() == carousel.SelectedBeatmapSet); + AddAssert("correct random last selected", () => selectedSets.Peek(), () => Is.EqualTo(carousel.SelectedBeatmapSet)); } } From f2c0e7cf2ecc04d5f3f01bd945623a61a8ab7f04 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 20:31:34 +0900 Subject: [PATCH 343/567] Fix editor's control point list refreshing multiple times for a single change --- osu.Game/Screens/Edit/Timing/ControlPointList.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/ControlPointList.cs b/osu.Game/Screens/Edit/Timing/ControlPointList.cs index 22e37b9efb..7cd1dbc630 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointList.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointList.cs @@ -109,8 +109,13 @@ namespace osu.Game.Screens.Edit.Timing controlPointGroups.BindTo(Beatmap.ControlPointInfo.Groups); controlPointGroups.BindCollectionChanged((_, _) => { - table.ControlGroups = controlPointGroups; - changeHandler?.SaveState(); + // This callback can happen many times in a change operation. It gets expensive. + // We really should be handling the `CollectionChanged` event properly. + Scheduler.AddOnce(() => + { + table.ControlGroups = controlPointGroups; + changeHandler?.SaveState(); + }); }, true); table.OnRowSelected += drawable => scroll.ScrollIntoView(drawable); From 1f2f749db68fe3a541150abb7acdae7e0aabf79e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 20:42:04 +0900 Subject: [PATCH 344/567] Fix selection not being retained in control point list when undoing / redoing --- osu.Game/Screens/Edit/EditorTable.cs | 30 ++++++++++++++++++- .../Screens/Edit/Timing/ControlPointTable.cs | 14 +++++---- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/EditorTable.cs b/osu.Game/Screens/Edit/EditorTable.cs index b79d71b42b..5ccb21cf59 100644 --- a/osu.Game/Screens/Edit/EditorTable.cs +++ b/osu.Game/Screens/Edit/EditorTable.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; @@ -46,15 +47,42 @@ namespace osu.Game.Screens.Edit }); } - protected void SetSelectedRow(object? item) + protected int GetIndexForObject(object? item) { + for (int i = 0; i < BackgroundFlow.Count; i++) + { + if (BackgroundFlow[i].Item == item) + return i; + } + + return -1; + } + + protected bool SetSelectedRow(object? item) + { + bool foundSelection = false; + foreach (var b in BackgroundFlow) { b.Selected = ReferenceEquals(b.Item, item); if (b.Selected) + { + Debug.Assert(!foundSelection); OnRowSelected?.Invoke(b); + foundSelection = true; + } } + + return foundSelection; + } + + protected object? GetObjectAtIndex(int index) + { + if (index < 0 || index > BackgroundFlow.Count - 1) + return null; + + return BackgroundFlow[index].Item; } protected override Drawable CreateHeader(int index, TableColumn? column) => new HeaderText(column?.Header ?? default); diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index b078e3fa44..335077c6f0 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -21,7 +21,7 @@ namespace osu.Game.Screens.Edit.Timing public partial class ControlPointTable : EditorTable { [Resolved] - private Bindable selectedGroup { get; set; } = null!; + private Bindable selectedGroup { get; set; } = null!; [Resolved] private EditorClock clock { get; set; } = null!; @@ -32,6 +32,8 @@ namespace osu.Game.Screens.Edit.Timing { set { + int selectedIndex = GetIndexForObject(selectedGroup.Value); + Content = null; BackgroundFlow.Clear(); @@ -53,7 +55,11 @@ namespace osu.Game.Screens.Edit.Timing Columns = createHeaders(); Content = value.Select(createContent).ToArray().ToRectangular(); - updateSelectedGroup(); + if (!SetSelectedRow(selectedGroup.Value)) + { + // Some operations completely obliterate references, so best-effort reselect based on index. + selectedGroup.Value = GetObjectAtIndex(selectedIndex) as ControlPointGroup; + } } } @@ -61,11 +67,9 @@ namespace osu.Game.Screens.Edit.Timing { base.LoadComplete(); - selectedGroup.BindValueChanged(_ => updateSelectedGroup(), true); + selectedGroup.BindValueChanged(_ => SetSelectedRow(selectedGroup.Value), true); } - private void updateSelectedGroup() => SetSelectedRow(selectedGroup.Value); - private TableColumn[] createHeaders() { var columns = new List From 03e2463b06b14b66529627fc76941d901231001c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 26 Dec 2023 21:20:18 +0900 Subject: [PATCH 345/567] Add test coverage and refactor to better handle equality edge case --- .../Visual/Editing/TestSceneTimingScreen.cs | 43 +++++++++++++++++++ osu.Game/Screens/Edit/EditorTable.cs | 2 +- .../Screens/Edit/Timing/ControlPointTable.cs | 29 ++++++++++--- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.cs b/osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.cs index 216c35de65..40aadc8164 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneTimingScreen.cs @@ -17,6 +17,7 @@ using osu.Game.Rulesets.Edit; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Timing; using osu.Game.Screens.Edit.Timing.RowAttributes; +using osuTK; using osuTK.Input; namespace osu.Game.Tests.Visual.Editing @@ -69,6 +70,48 @@ namespace osu.Game.Tests.Visual.Editing AddUntilStep("Wait for rows to load", () => Child.ChildrenOfType().Any()); } + [Test] + public void TestSelectedRetainedOverUndo() + { + AddStep("Select first timing point", () => + { + InputManager.MoveMouseTo(Child.ChildrenOfType().First()); + InputManager.Click(MouseButton.Left); + }); + + AddUntilStep("Selection changed", () => timingScreen.SelectedGroup.Value.Time == 2170); + AddUntilStep("Ensure seeked to correct time", () => EditorClock.CurrentTimeAccurate == 2170); + + AddStep("Adjust offset", () => + { + InputManager.MoveMouseTo(timingScreen.ChildrenOfType().First().ScreenSpaceDrawQuad.Centre + new Vector2(20, 0)); + InputManager.Click(MouseButton.Left); + }); + + AddUntilStep("wait for offset changed", () => + { + return timingScreen.SelectedGroup.Value.ControlPoints.Any(c => c is TimingControlPoint) && timingScreen.SelectedGroup.Value.Time > 2170; + }); + + AddStep("simulate undo", () => + { + var clone = editorBeatmap.ControlPointInfo.DeepClone(); + + editorBeatmap.ControlPointInfo.Clear(); + + foreach (var group in clone.Groups) + { + foreach (var cp in group.ControlPoints) + editorBeatmap.ControlPointInfo.Add(group.Time, cp); + } + }); + + AddUntilStep("selection retained", () => + { + return timingScreen.SelectedGroup.Value.ControlPoints.Any(c => c is TimingControlPoint) && timingScreen.SelectedGroup.Value.Time > 2170; + }); + } + [Test] public void TestTrackingCurrentTimeWhileRunning() { diff --git a/osu.Game/Screens/Edit/EditorTable.cs b/osu.Game/Screens/Edit/EditorTable.cs index 5ccb21cf59..e5dc540b06 100644 --- a/osu.Game/Screens/Edit/EditorTable.cs +++ b/osu.Game/Screens/Edit/EditorTable.cs @@ -58,7 +58,7 @@ namespace osu.Game.Screens.Edit return -1; } - protected bool SetSelectedRow(object? item) + protected virtual bool SetSelectedRow(object? item) { bool foundSelection = false; diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index 335077c6f0..7a27056da3 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -46,7 +46,7 @@ namespace osu.Game.Screens.Edit.Timing { Action = () => { - selectedGroup.Value = group; + SetSelectedRow(group); clock.SeekSmoothlyTo(group.Time); } }); @@ -55,11 +55,16 @@ namespace osu.Game.Screens.Edit.Timing Columns = createHeaders(); Content = value.Select(createContent).ToArray().ToRectangular(); - if (!SetSelectedRow(selectedGroup.Value)) - { - // Some operations completely obliterate references, so best-effort reselect based on index. - selectedGroup.Value = GetObjectAtIndex(selectedIndex) as ControlPointGroup; - } + // Attempt to retain selection. + if (SetSelectedRow(selectedGroup.Value)) + return; + + // Some operations completely obliterate references, so best-effort reselect based on index. + if (SetSelectedRow(GetObjectAtIndex(selectedIndex))) + return; + + // Selection could not be retained. + selectedGroup.Value = null; } } @@ -67,7 +72,17 @@ namespace osu.Game.Screens.Edit.Timing { base.LoadComplete(); - selectedGroup.BindValueChanged(_ => SetSelectedRow(selectedGroup.Value), true); + // Handle external selections. + selectedGroup.BindValueChanged(g => SetSelectedRow(g.NewValue), true); + } + + protected override bool SetSelectedRow(object? item) + { + if (!base.SetSelectedRow(item)) + return false; + + selectedGroup.Value = item as ControlPointGroup; + return true; } private TableColumn[] createHeaders() From d70fddb6fde18de0ef092c047509ee0a2efd2d16 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 00:11:22 +0900 Subject: [PATCH 346/567] Fix elapsed time being counted twice on first frame --- osu.Game/Screens/Play/MasterGameplayClockContainer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 2844d84f31..a475f4823f 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -227,8 +227,10 @@ namespace osu.Game.Screens.Play { elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime; - elapsedValidationTime ??= elapsedGameplayClockTime; - elapsedValidationTime += GameplayClock.Rate * Time.Elapsed; + if (elapsedValidationTime == null) + elapsedValidationTime = elapsedGameplayClockTime; + else + elapsedValidationTime += GameplayClock.Rate * Time.Elapsed; if (Math.Abs(elapsedGameplayClockTime - elapsedValidationTime!.Value) > 300) { From c55458e49c6b5747a1a84e00ac05787829c81a2e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:32:47 +0900 Subject: [PATCH 347/567] Remove pointless intermediary class --- .../Containers/ExpandingButtonContainer.cs | 21 ------------------- osu.Game/Overlays/Settings/SettingsSidebar.cs | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 osu.Game/Graphics/Containers/ExpandingButtonContainer.cs diff --git a/osu.Game/Graphics/Containers/ExpandingButtonContainer.cs b/osu.Game/Graphics/Containers/ExpandingButtonContainer.cs deleted file mode 100644 index 5abb4096ac..0000000000 --- a/osu.Game/Graphics/Containers/ExpandingButtonContainer.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Graphics.Containers -{ - /// - /// An with a long hover expansion delay. - /// - /// - /// Mostly used for buttons with explanatory labels, in which the label would display after a "long hover". - /// - public partial class ExpandingButtonContainer : ExpandingContainer - { - protected ExpandingButtonContainer(float contractedWidth, float expandedWidth) - : base(contractedWidth, expandedWidth) - { - } - - protected override double HoverExpansionDelay => 400; - } -} diff --git a/osu.Game/Overlays/Settings/SettingsSidebar.cs b/osu.Game/Overlays/Settings/SettingsSidebar.cs index 06bc2fd788..7baf9a58ff 100644 --- a/osu.Game/Overlays/Settings/SettingsSidebar.cs +++ b/osu.Game/Overlays/Settings/SettingsSidebar.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Settings { - public partial class SettingsSidebar : ExpandingButtonContainer + public partial class SettingsSidebar : ExpandingContainer { public const float DEFAULT_WIDTH = 70; public const int EXPANDED_WIDTH = 200; From 58476d5429985109a13240c481da362449489167 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:33:02 +0900 Subject: [PATCH 348/567] Allow `ExpandingContainer` to not auto expand on hover --- osu.Game/Graphics/Containers/ExpandingContainer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Containers/ExpandingContainer.cs b/osu.Game/Graphics/Containers/ExpandingContainer.cs index 60b9e6a167..2abdb508ae 100644 --- a/osu.Game/Graphics/Containers/ExpandingContainer.cs +++ b/osu.Game/Graphics/Containers/ExpandingContainer.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -26,6 +24,8 @@ namespace osu.Game.Graphics.Containers /// protected virtual double HoverExpansionDelay => 0; + protected virtual bool ExpandOnHover => true; + protected override Container Content => FillFlow; protected FillFlowContainer FillFlow { get; } @@ -53,7 +53,7 @@ namespace osu.Game.Graphics.Containers }; } - private ScheduledDelegate hoverExpandEvent; + private ScheduledDelegate? hoverExpandEvent; protected override void LoadComplete() { @@ -93,6 +93,9 @@ namespace osu.Game.Graphics.Containers private void updateHoverExpansion() { + if (!ExpandOnHover) + return; + hoverExpandEvent?.Cancel(); if (IsHovered && !Expanded.Value) From 9a1a97180d7938bbc1dced8d887cc226f28deb46 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:33:17 +0900 Subject: [PATCH 349/567] Change settings overlay to always show expanded buttons --- osu.Game/Overlays/Settings/SettingsSidebar.cs | 3 +++ osu.Game/Overlays/SettingsOverlay.cs | 7 +++++-- osu.Game/Overlays/SettingsPanel.cs | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsSidebar.cs b/osu.Game/Overlays/Settings/SettingsSidebar.cs index 7baf9a58ff..fc5c6b07bb 100644 --- a/osu.Game/Overlays/Settings/SettingsSidebar.cs +++ b/osu.Game/Overlays/Settings/SettingsSidebar.cs @@ -13,9 +13,12 @@ namespace osu.Game.Overlays.Settings public const float DEFAULT_WIDTH = 70; public const int EXPANDED_WIDTH = 200; + protected override bool ExpandOnHover => false; + public SettingsSidebar() : base(DEFAULT_WIDTH, EXPANDED_WIDTH) { + Expanded.Value = true; } [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 746d451343..a779c3c263 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -72,16 +72,19 @@ namespace osu.Game.Overlays switch (state.NewValue) { case Visibility.Visible: - Sidebar?.FadeColour(Color4.DarkGray, 300, Easing.OutQuint); + Sidebar.Expanded.Value = false; + Sidebar.FadeColour(Color4.DarkGray, 300, Easing.OutQuint); SectionsContainer.FadeOut(300, Easing.OutQuint); ContentContainer.MoveToX(-PANEL_WIDTH, 500, Easing.OutQuint); lastOpenedSubPanel = panel; + break; case Visibility.Hidden: - Sidebar?.FadeColour(Color4.White, 300, Easing.OutQuint); + Sidebar.Expanded.Value = true; + Sidebar.FadeColour(Color4.White, 300, Easing.OutQuint); SectionsContainer.FadeIn(500, Easing.OutQuint); ContentContainer.MoveToX(0, 500, Easing.OutQuint); diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index 3bac6c400f..339120fd84 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -285,7 +285,6 @@ namespace osu.Game.Overlays return; SectionsContainer.ScrollTo(section); - Sidebar.Expanded.Value = false; }, }; } From 5de8307918216ed5f18edb42bfc8eb28c6f310b5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:38:23 +0900 Subject: [PATCH 350/567] Reduce width of sidebar buttons --- osu.Game/Overlays/Settings/SettingsSidebar.cs | 2 +- osu.Game/Overlays/Settings/SidebarIconButton.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsSidebar.cs b/osu.Game/Overlays/Settings/SettingsSidebar.cs index fc5c6b07bb..c751f12003 100644 --- a/osu.Game/Overlays/Settings/SettingsSidebar.cs +++ b/osu.Game/Overlays/Settings/SettingsSidebar.cs @@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Settings public partial class SettingsSidebar : ExpandingContainer { public const float DEFAULT_WIDTH = 70; - public const int EXPANDED_WIDTH = 200; + public const int EXPANDED_WIDTH = 170; protected override bool ExpandOnHover => false; diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index 4e5b361460..bd9ac3cf97 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -69,18 +69,18 @@ namespace osu.Game.Overlays.Settings Colour = OsuColour.Gray(0.6f), Children = new Drawable[] { - headerText = new OsuSpriteText - { - Position = new Vector2(SettingsSidebar.DEFAULT_WIDTH + 10, 0), - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - }, iconContainer = new ConstrainedIconContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(20), }, + headerText = new OsuSpriteText + { + Position = new Vector2(60, 0), + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, } }, selectionIndicator = new CircularContainer From 5b1deb7c4b1139aa55543094dc652b6763ddfcd2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:40:50 +0900 Subject: [PATCH 351/567] Give buttons a touch of padding to make click effect feel better --- osu.Game/Overlays/Settings/SidebarIconButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index bd9ac3cf97..a8d27eb792 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -60,6 +60,8 @@ namespace osu.Game.Overlays.Settings RelativeSizeAxes = Axes.X; Height = 46; + Padding = new MarginPadding(5); + AddRange(new Drawable[] { textIconContent = new Container From 8e13f65c5d388ba0494367dfedcb2cccdc066b84 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:46:21 +0900 Subject: [PATCH 352/567] Adjust hover effect slightly --- osu.Game/Overlays/Settings/SidebarIconButton.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index a8d27eb792..041d19e8bf 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -111,10 +111,13 @@ namespace osu.Game.Overlays.Settings private void load() { selectionIndicator.Colour = ColourProvider.Highlight1; + Hover.Colour = ColourProvider.Light4; } protected override void UpdateState() { + Hover.FadeTo(IsHovered ? 0.1f : 0, FADE_DURATION, Easing.OutQuint); + if (Selected) { textIconContent.FadeColour(ColourProvider.Content1, FADE_DURATION, Easing.OutQuint); From 5d0b5247946e758fd28f8bad58ec16cf7c15ee18 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 02:54:24 +0900 Subject: [PATCH 353/567] Adjust back button to match style better --- osu.Game/Overlays/Settings/SidebarButton.cs | 7 ++++++- osu.Game/Overlays/Settings/SidebarIconButton.cs | 3 +-- osu.Game/Overlays/SettingsSubPanel.cs | 13 +++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index a63688762d..f58c2f41ef 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Framework.Input.Events; using osu.Game.Graphics.UserInterface; @@ -23,6 +24,7 @@ namespace osu.Game.Overlays.Settings private void load() { BackgroundColour = ColourProvider.Background5; + Hover.Colour = ColourProvider.Light4; } protected override void LoadComplete() @@ -40,6 +42,9 @@ namespace osu.Game.Overlays.Settings protected override void OnHoverLost(HoverLostEvent e) => UpdateState(); - protected abstract void UpdateState(); + protected virtual void UpdateState() + { + Hover.FadeTo(IsHovered ? 0.1f : 0, FADE_DURATION, Easing.OutQuint); + } } } diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index 041d19e8bf..1bb3aa2921 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -111,12 +111,11 @@ namespace osu.Game.Overlays.Settings private void load() { selectionIndicator.Colour = ColourProvider.Highlight1; - Hover.Colour = ColourProvider.Light4; } protected override void UpdateState() { - Hover.FadeTo(IsHovered ? 0.1f : 0, FADE_DURATION, Easing.OutQuint); + base.UpdateState(); if (Selected) { diff --git a/osu.Game/Overlays/SettingsSubPanel.cs b/osu.Game/Overlays/SettingsSubPanel.cs index 1651975a74..1b9edeebc2 100644 --- a/osu.Game/Overlays/SettingsSubPanel.cs +++ b/osu.Game/Overlays/SettingsSubPanel.cs @@ -47,7 +47,9 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load() { - Size = new Vector2(SettingsSidebar.DEFAULT_WIDTH); + Size = new Vector2(SettingsSidebar.EXPANDED_WIDTH); + + Padding = new MarginPadding(5); AddRange(new Drawable[] { @@ -61,7 +63,8 @@ namespace osu.Game.Overlays { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(15), + Y = -5, + Size = new Vector2(30), Shadow = true, Icon = FontAwesome.Solid.ChevronLeft }, @@ -69,8 +72,8 @@ namespace osu.Game.Overlays { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Y = 15, - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), + Y = 30, + Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular), Text = @"back", }, } @@ -80,6 +83,8 @@ namespace osu.Game.Overlays protected override void UpdateState() { + base.UpdateState(); + content.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, FADE_DURATION, Easing.OutQuint); } } From c087578e011c6ade4411dbccfcfce80da407dba3 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 26 Dec 2023 10:07:21 -0800 Subject: [PATCH 354/567] Force minimum cursor size for `OsuResumeOverlay` On cursor sizes below 0.3x it becomes exceedingly difficult to quickly locate and then accurately click the resume cursor on the pause overlay as it could as big as a handful of pixels. This clamps the minimum cursor size to 1x for the resume overlay, which is way more comfortable and more closely resembles stable. --- osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs | 10 +++++----- osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs index ba9fda25e4..18351c20ce 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursor.cs @@ -70,10 +70,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor }; userCursorScale = config.GetBindable(OsuSetting.GameplayCursorSize); - userCursorScale.ValueChanged += _ => calculateCursorScale(); + userCursorScale.ValueChanged += _ => cursorScale.Value = CalculateCursorScale(); autoCursorScale = config.GetBindable(OsuSetting.AutoCursorSize); - autoCursorScale.ValueChanged += _ => calculateCursorScale(); + autoCursorScale.ValueChanged += _ => cursorScale.Value = CalculateCursorScale(); cursorScale.BindValueChanged(e => cursorScaleContainer.Scale = new Vector2(e.NewValue), true); } @@ -81,10 +81,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override void LoadComplete() { base.LoadComplete(); - calculateCursorScale(); + cursorScale.Value = CalculateCursorScale(); } - private void calculateCursorScale() + protected virtual float CalculateCursorScale() { float scale = userCursorScale.Value; @@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor scale *= GetScaleForCircleSize(state.Beatmap.Difficulty.CircleSize); } - cursorScale.Value = scale; + return scale; } protected override void SkinChanged(ISkinSource skin) diff --git a/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs b/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs index ea49836772..f5e83f46f2 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuResumeOverlay.cs @@ -71,6 +71,12 @@ namespace osu.Game.Rulesets.Osu.UI RelativePositionAxes = Axes.Both; } + protected override float CalculateCursorScale() + { + // Force minimum cursor size so it's easily clickable + return Math.Max(1f, base.CalculateCursorScale()); + } + protected override bool OnHover(HoverEvent e) { updateColour(); From c107bfcd3112cc8b1589d84f4634be1688cc684d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 26 Dec 2023 20:09:34 +0100 Subject: [PATCH 355/567] Fix `TestSceneSideOverlays` test failure --- osu.Game/Overlays/Settings/SettingsSidebar.cs | 4 ++-- osu.Game/Overlays/Settings/SidebarIconButton.cs | 2 +- osu.Game/Overlays/SettingsPanel.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsSidebar.cs b/osu.Game/Overlays/Settings/SettingsSidebar.cs index c751f12003..302c52fbd2 100644 --- a/osu.Game/Overlays/Settings/SettingsSidebar.cs +++ b/osu.Game/Overlays/Settings/SettingsSidebar.cs @@ -10,13 +10,13 @@ namespace osu.Game.Overlays.Settings { public partial class SettingsSidebar : ExpandingContainer { - public const float DEFAULT_WIDTH = 70; + public const float CONTRACTED_WIDTH = 70; public const int EXPANDED_WIDTH = 170; protected override bool ExpandOnHover => false; public SettingsSidebar() - : base(DEFAULT_WIDTH, EXPANDED_WIDTH) + : base(CONTRACTED_WIDTH, EXPANDED_WIDTH) { Expanded.Value = true; } diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index 1bb3aa2921..e7ae4cc81d 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Settings { textIconContent = new Container { - Width = SettingsSidebar.DEFAULT_WIDTH, + Width = SettingsSidebar.CONTRACTED_WIDTH, RelativeSizeAxes = Axes.Y, Colour = OsuColour.Gray(0.6f), Children = new Drawable[] diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index 339120fd84..f4dfc7fa27 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays public const float TRANSITION_LENGTH = 600; - private const float sidebar_width = SettingsSidebar.DEFAULT_WIDTH; + private const float sidebar_width = SettingsSidebar.EXPANDED_WIDTH; /// /// The width of the settings panel content, excluding the sidebar. From 9ac79782d25f3625d79d1d9096cb3eecacbdad21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 26 Dec 2023 20:21:15 +0100 Subject: [PATCH 356/567] Add visibility toggle step to settings panel test scene --- osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs index 5d9c2f890c..8c4ca47fc3 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs @@ -41,6 +41,7 @@ namespace osu.Game.Tests.Visual.Settings public void TestBasic() { AddStep("do nothing", () => { }); + AddToggleStep("toggle visibility", visible => settings.State.Value = visible ? Visibility.Visible : Visibility.Hidden); } [Test] From af47f9fd701897a3096c785a5c2e31c2b87ee6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 26 Dec 2023 20:24:43 +0100 Subject: [PATCH 357/567] Fix sidebar button text becoming masked away during fadeout --- osu.Game/Overlays/Settings/SidebarIconButton.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Settings/SidebarIconButton.cs b/osu.Game/Overlays/Settings/SidebarIconButton.cs index e7ae4cc81d..f4b71207e3 100644 --- a/osu.Game/Overlays/Settings/SidebarIconButton.cs +++ b/osu.Game/Overlays/Settings/SidebarIconButton.cs @@ -66,16 +66,16 @@ namespace osu.Game.Overlays.Settings { textIconContent = new Container { - Width = SettingsSidebar.CONTRACTED_WIDTH, - RelativeSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.6f), Children = new Drawable[] { iconContainer = new ConstrainedIconContainer { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, Size = new Vector2(20), + Margin = new MarginPadding { Left = 25 } }, headerText = new OsuSpriteText { From 6f672b8cb302fb7aa5034b07a2b6f0f351df54aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 26 Dec 2023 20:36:12 +0100 Subject: [PATCH 358/567] Fix `TestSceneKeyBindingPanel` failures --- .../Visual/Settings/TestSceneKeyBindingPanel.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs b/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs index 1c4e89e1a2..57c9770c9a 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneKeyBindingPanel.cs @@ -13,7 +13,6 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Localisation; using osu.Game.Overlays; -using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings.Sections.Input; using osu.Game.Rulesets.Taiko; using osuTK.Input; @@ -152,7 +151,7 @@ namespace osu.Game.Tests.Visual.Settings AddStep("click first row with two bindings", () => { multiBindingRow = panel.ChildrenOfType().First(row => row.Defaults.Count() > 1); - InputManager.MoveMouseTo(multiBindingRow); + InputManager.MoveMouseTo(multiBindingRow.ChildrenOfType().First()); InputManager.Click(MouseButton.Left); }); @@ -256,7 +255,7 @@ namespace osu.Game.Tests.Visual.Settings AddStep("click first row with two bindings", () => { multiBindingRow = panel.ChildrenOfType().First(row => row.Defaults.Count() > 1); - InputManager.MoveMouseTo(multiBindingRow); + InputManager.MoveMouseTo(multiBindingRow.ChildrenOfType().First()); InputManager.Click(MouseButton.Left); }); @@ -305,7 +304,6 @@ namespace osu.Game.Tests.Visual.Settings section.ChildrenOfType().Single().TriggerClick(); }); AddStep("move mouse to centre", () => InputManager.MoveMouseTo(panel.ScreenSpaceDrawQuad.Centre)); - AddUntilStep("wait for collapsed", () => panel.ChildrenOfType().Single().Expanded.Value, () => Is.False); scrollToAndStartBinding("Left (rim)"); AddStep("attempt to bind M1 to two keys", () => InputManager.Click(MouseButton.Left)); @@ -325,7 +323,6 @@ namespace osu.Game.Tests.Visual.Settings section.ChildrenOfType().Single().TriggerClick(); }); AddStep("move mouse to centre", () => InputManager.MoveMouseTo(panel.ScreenSpaceDrawQuad.Centre)); - AddUntilStep("wait for collapsed", () => panel.ChildrenOfType().Single().Expanded.Value, () => Is.False); scrollToAndStartBinding("Left (rim)"); AddStep("attempt to bind M1 to two keys", () => InputManager.Click(MouseButton.Left)); @@ -345,7 +342,6 @@ namespace osu.Game.Tests.Visual.Settings section.ChildrenOfType().Single().TriggerClick(); }); AddStep("move mouse to centre", () => InputManager.MoveMouseTo(panel.ScreenSpaceDrawQuad.Centre)); - AddUntilStep("wait for collapsed", () => panel.ChildrenOfType().Single().Expanded.Value, () => Is.False); scrollToAndStartBinding("Left (centre)"); AddStep("clear binding", () => { @@ -377,7 +373,6 @@ namespace osu.Game.Tests.Visual.Settings section.ChildrenOfType().Single().TriggerClick(); }); AddStep("move mouse to centre", () => InputManager.MoveMouseTo(panel.ScreenSpaceDrawQuad.Centre)); - AddUntilStep("wait for collapsed", () => panel.ChildrenOfType().Single().Expanded.Value, () => Is.False); scrollToAndStartBinding("Left (centre)"); AddStep("clear binding", () => { From 8cd240fbecebf7bd37ba2cc504fe751c5afe727a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 13:20:19 +0900 Subject: [PATCH 359/567] Reduce size and fix alignment of back button --- osu.Game/Overlays/SettingsSubPanel.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/SettingsSubPanel.cs b/osu.Game/Overlays/SettingsSubPanel.cs index 1b9edeebc2..4d1f8f45cc 100644 --- a/osu.Game/Overlays/SettingsSubPanel.cs +++ b/osu.Game/Overlays/SettingsSubPanel.cs @@ -37,7 +37,7 @@ namespace osu.Game.Overlays public partial class BackButton : SidebarButton { - private Container content; + private Drawable content; public BackButton() : base(HoverSampleSet.Default) @@ -49,30 +49,31 @@ namespace osu.Game.Overlays { Size = new Vector2(SettingsSidebar.EXPANDED_WIDTH); - Padding = new MarginPadding(5); + Padding = new MarginPadding(40); AddRange(new Drawable[] { - content = new Container + content = new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(5), Children = new Drawable[] { new SpriteIcon { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Y = -5, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, Size = new Vector2(30), Shadow = true, Icon = FontAwesome.Solid.ChevronLeft }, new OsuSpriteText { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Y = 30, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular), Text = @"back", }, From 901674a1303a349185d5123f013a3d2e3d2d4fad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 13:39:13 +0900 Subject: [PATCH 360/567] Move back button inside sidebar to fix weird animation --- .../Visual/Settings/TestSceneSettingsPanel.cs | 2 +- osu.Game/Overlays/Settings/SettingsSidebar.cs | 79 ++++++++++++++++++- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/SettingsPanel.cs | 13 +-- osu.Game/Overlays/SettingsSubPanel.cs | 71 ----------------- 5 files changed, 87 insertions(+), 80 deletions(-) diff --git a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs index 8c4ca47fc3..df0fc8de57 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneSettingsPanel.cs @@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.Settings AddStep("Press back", () => settings .ChildrenOfType().FirstOrDefault()? - .ChildrenOfType().FirstOrDefault()?.TriggerClick()); + .ChildrenOfType().FirstOrDefault()?.TriggerClick()); AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType().FirstOrDefault()?.HasFocus == true); } diff --git a/osu.Game/Overlays/Settings/SettingsSidebar.cs b/osu.Game/Overlays/Settings/SettingsSidebar.cs index 302c52fbd2..ddbcd60ef6 100644 --- a/osu.Game/Overlays/Settings/SettingsSidebar.cs +++ b/osu.Game/Overlays/Settings/SettingsSidebar.cs @@ -1,10 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osuTK; namespace osu.Game.Overlays.Settings { @@ -13,11 +20,16 @@ namespace osu.Game.Overlays.Settings public const float CONTRACTED_WIDTH = 70; public const int EXPANDED_WIDTH = 170; + public Action? BackButtonAction; + protected override bool ExpandOnHover => false; - public SettingsSidebar() + private readonly bool showBackButton; + + public SettingsSidebar(bool showBackButton) : base(CONTRACTED_WIDTH, EXPANDED_WIDTH) { + this.showBackButton = showBackButton; Expanded.Value = true; } @@ -30,6 +42,71 @@ namespace osu.Game.Overlays.Settings RelativeSizeAxes = Axes.Both, Depth = float.MaxValue }); + + if (showBackButton) + { + AddInternal(new BackButton + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Action = () => BackButtonAction?.Invoke(), + }); + } + } + + public partial class BackButton : SidebarButton + { + private Drawable content = null!; + + public BackButton() + : base(HoverSampleSet.Default) + { + } + + [BackgroundDependencyLoader] + private void load() + { + Size = new Vector2(SettingsSidebar.EXPANDED_WIDTH); + + Padding = new MarginPadding(40); + + AddRange(new[] + { + content = new FillFlowContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(5), + Children = new Drawable[] + { + new SpriteIcon + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Size = new Vector2(30), + Shadow = true, + Icon = FontAwesome.Solid.ChevronLeft + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular), + Text = @"back", + }, + } + } + }); + } + + protected override void UpdateState() + { + base.UpdateState(); + + content.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, FADE_DURATION, Easing.OutQuint); + } } } } diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index a779c3c263..5735b1515a 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -49,7 +49,7 @@ namespace osu.Game.Overlays protected override Drawable CreateFooter() => new SettingsFooter(); public SettingsOverlay() - : base(true) + : base(false) { } diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index f4dfc7fa27..3861c5abc7 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -59,7 +59,7 @@ namespace osu.Game.Overlays protected override string PopInSampleName => "UI/settings-pop-in"; protected override double PopInOutSampleBalance => -OsuGameBase.SFX_STEREO_STRENGTH; - private readonly bool showSidebar; + private readonly bool showBackButton; private LoadingLayer loading; @@ -72,9 +72,9 @@ namespace osu.Game.Overlays [Cached] private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); - protected SettingsPanel(bool showSidebar) + protected SettingsPanel(bool showBackButton) { - this.showSidebar = showSidebar; + this.showBackButton = showBackButton; RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; } @@ -146,10 +146,11 @@ namespace osu.Game.Overlays } }); - if (showSidebar) + AddInternal(Sidebar = new SettingsSidebar(showBackButton) { - AddInternal(Sidebar = new SettingsSidebar { Width = sidebar_width }); - } + BackButtonAction = Hide, + Width = sidebar_width + }); CreateSections()?.ForEach(AddSection); } diff --git a/osu.Game/Overlays/SettingsSubPanel.cs b/osu.Game/Overlays/SettingsSubPanel.cs index 4d1f8f45cc..440639f06b 100644 --- a/osu.Game/Overlays/SettingsSubPanel.cs +++ b/osu.Game/Overlays/SettingsSubPanel.cs @@ -1,17 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Game.Overlays.Settings; -using osuTK; namespace osu.Game.Overlays { @@ -25,69 +15,8 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load() { - AddInternal(new BackButton - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - Action = Hide - }); } protected override bool DimMainContent => false; // dimming is handled by main overlay - - public partial class BackButton : SidebarButton - { - private Drawable content; - - public BackButton() - : base(HoverSampleSet.Default) - { - } - - [BackgroundDependencyLoader] - private void load() - { - Size = new Vector2(SettingsSidebar.EXPANDED_WIDTH); - - Padding = new MarginPadding(40); - - AddRange(new Drawable[] - { - content = new FillFlowContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Direction = FillDirection.Vertical, - AutoSizeAxes = Axes.Both, - Spacing = new Vector2(5), - Children = new Drawable[] - { - new SpriteIcon - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Size = new Vector2(30), - Shadow = true, - Icon = FontAwesome.Solid.ChevronLeft - }, - new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular), - Text = @"back", - }, - } - } - }); - } - - protected override void UpdateState() - { - base.UpdateState(); - - content.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, FADE_DURATION, Easing.OutQuint); - } - } } } From 81ba46216f0951e30329c3e2779a5380ee25e743 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 13:49:00 +0900 Subject: [PATCH 361/567] Speed up fades in transition to avoid ugliness --- osu.Game/Overlays/SettingsPanel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index 3861c5abc7..748673035b 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -181,7 +181,7 @@ namespace osu.Game.Overlays Scheduler.AddDelayed(loadSections, TRANSITION_LENGTH / 3); Sidebar?.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint); - this.FadeTo(1, TRANSITION_LENGTH, Easing.OutQuint); + this.FadeTo(1, TRANSITION_LENGTH / 2, Easing.OutQuint); searchTextBox.TakeFocus(); searchTextBox.HoldFocus = true; @@ -197,7 +197,7 @@ namespace osu.Game.Overlays ContentContainer.MoveToX(-WIDTH + ExpandedPosition, TRANSITION_LENGTH, Easing.OutQuint); Sidebar?.MoveToX(-sidebar_width, TRANSITION_LENGTH, Easing.OutQuint); - this.FadeTo(0, TRANSITION_LENGTH, Easing.OutQuint); + this.FadeTo(0, TRANSITION_LENGTH / 2, Easing.OutQuint); searchTextBox.HoldFocus = false; if (searchTextBox.HasFocus) From 768e10d55f5e3cc144856b47906b03187f162e13 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 13:50:47 +0900 Subject: [PATCH 362/567] Adjust `NotificationOverlay` fades to match --- osu.Game/Overlays/NotificationOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs index c3ddb228ea..f56d09f2b2 100644 --- a/osu.Game/Overlays/NotificationOverlay.cs +++ b/osu.Game/Overlays/NotificationOverlay.cs @@ -227,7 +227,7 @@ namespace osu.Game.Overlays protected override void PopIn() { this.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint); - mainContent.FadeTo(1, TRANSITION_LENGTH, Easing.OutQuint); + mainContent.FadeTo(1, TRANSITION_LENGTH / 2, Easing.OutQuint); mainContent.FadeEdgeEffectTo(WaveContainer.SHADOW_OPACITY, WaveContainer.APPEAR_DURATION, Easing.Out); toastTray.FlushAllToasts(); @@ -240,7 +240,7 @@ namespace osu.Game.Overlays markAllRead(); this.MoveToX(WIDTH, TRANSITION_LENGTH, Easing.OutQuint); - mainContent.FadeTo(0, TRANSITION_LENGTH, Easing.OutQuint); + mainContent.FadeTo(0, TRANSITION_LENGTH / 2, Easing.OutQuint); mainContent.FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.In); } From 8f7e0571f0693cfd8fefcc41f41a70239db1f21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 10:51:05 +0100 Subject: [PATCH 363/567] Add failing test coverage of handling out-of-bounds catch objects --- .../TestSceneOutOfBoundsObjects.cs | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 osu.Game.Rulesets.Catch.Tests/TestSceneOutOfBoundsObjects.cs diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneOutOfBoundsObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneOutOfBoundsObjects.cs new file mode 100644 index 0000000000..951f5d1ca1 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneOutOfBoundsObjects.cs @@ -0,0 +1,72 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using osu.Framework.Testing; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects.Drawables; +using osu.Game.Rulesets.Catch.UI; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osuTK; + +namespace osu.Game.Rulesets.Catch.Tests +{ + public partial class TestSceneOutOfBoundsObjects : TestSceneCatchPlayer + { + protected override bool Autoplay => true; + + [Test] + public void TestNoOutOfBoundsObjects() + { + bool anyObjectOutOfBounds = false; + + AddStep("reset flag", () => anyObjectOutOfBounds = false); + + AddUntilStep("check for out-of-bounds objects", + () => + { + anyObjectOutOfBounds |= Player.ChildrenOfType().Any(dho => dho.X < 0 || dho.X > CatchPlayfield.WIDTH); + return Player.ScoreProcessor.HasCompleted.Value; + }); + + AddAssert("no out of bound objects found", () => !anyObjectOutOfBounds); + } + + protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + Ruleset = ruleset, + }, + HitObjects = new List + { + new Fruit { StartTime = 1000, X = -50 }, + new Fruit { StartTime = 1200, X = CatchPlayfield.WIDTH + 50 }, + new JuiceStream + { + StartTime = 1500, + X = 10, + Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(-200, 0) + }) + }, + new JuiceStream + { + StartTime = 3000, + X = CatchPlayfield.WIDTH - 10, + Path = new SliderPath(PathType.LINEAR, new[] + { + Vector2.Zero, + new Vector2(200, 0) + }) + }, + } + }; + } +} From 2e8b49b93a7ec12ace3ea9e3f0713f8ba20545e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 10:55:29 +0100 Subject: [PATCH 364/567] Fix catch drawable objects not being clamped to playfield bounds --- .../Objects/Drawables/DrawablePalpableCatchHitObject.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawablePalpableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawablePalpableCatchHitObject.cs index 4a9661f108..ade00918ab 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawablePalpableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawablePalpableCatchHitObject.cs @@ -1,10 +1,12 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Catch.UI; using osuTK; using osuTK.Graphics; @@ -70,7 +72,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables private void updateXPosition(ValueChangedEvent _) { - X = OriginalXBindable.Value + XOffsetBindable.Value; + // same as `CatchHitObject.EffectiveX`. + // not using that property directly to support scenarios where `HitObject` may not necessarily be present + // for this pooled drawable. + X = Math.Clamp(OriginalXBindable.Value + XOffsetBindable.Value, 0, CatchPlayfield.WIDTH); } protected override void OnApply() From 1233533fb967390c2c433ea0f7feb0dadd682635 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 22:14:15 +0900 Subject: [PATCH 365/567] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index cf01f2f99b..b179b8b837 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index c7b9d02b26..7e03ab50e2 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From 14b37db3dd17d3be07a9dce5b088b59205d33815 Mon Sep 17 00:00:00 2001 From: Gabriel Del Nero <43073074+Gabixel@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:35:19 +0100 Subject: [PATCH 366/567] Make `ModDaycore` sequential for `ModHalfTime` --- osu.Game/Overlays/Mods/Input/ClassicModHotkeyHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/Input/ClassicModHotkeyHandler.cs b/osu.Game/Overlays/Mods/Input/ClassicModHotkeyHandler.cs index 59a631a7b5..bf58efc339 100644 --- a/osu.Game/Overlays/Mods/Input/ClassicModHotkeyHandler.cs +++ b/osu.Game/Overlays/Mods/Input/ClassicModHotkeyHandler.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Mods.Input { [Key.Q] = new[] { typeof(ModEasy) }, [Key.W] = new[] { typeof(ModNoFail) }, - [Key.E] = new[] { typeof(ModHalfTime) }, + [Key.E] = new[] { typeof(ModHalfTime), typeof(ModDaycore) }, [Key.A] = new[] { typeof(ModHardRock) }, [Key.S] = new[] { typeof(ModSuddenDeath), typeof(ModPerfect) }, [Key.D] = new[] { typeof(ModDoubleTime), typeof(ModNightcore) }, From 13333f75756e587572411971524a65cda09eedab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:02:19 +0100 Subject: [PATCH 367/567] Make room for `OsuIcon` to accept new icons --- osu.Game/Graphics/OsuIcon.cs | 132 ++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 64 deletions(-) diff --git a/osu.Game/Graphics/OsuIcon.cs b/osu.Game/Graphics/OsuIcon.cs index 15af8f000b..d1ad818300 100644 --- a/osu.Game/Graphics/OsuIcon.cs +++ b/osu.Game/Graphics/OsuIcon.cs @@ -7,90 +7,94 @@ namespace osu.Game.Graphics { public static class OsuIcon { - public static IconUsage Get(int icon) => new IconUsage((char)icon, "osuFont"); + #region Legacy spritesheet-based icons + + private static IconUsage get(int icon) => new IconUsage((char)icon, @"osuFont"); // ruleset icons in circles - public static IconUsage RulesetOsu => Get(0xe000); - public static IconUsage RulesetMania => Get(0xe001); - public static IconUsage RulesetCatch => Get(0xe002); - public static IconUsage RulesetTaiko => Get(0xe003); + public static IconUsage RulesetOsu => get(0xe000); + public static IconUsage RulesetMania => get(0xe001); + public static IconUsage RulesetCatch => get(0xe002); + public static IconUsage RulesetTaiko => get(0xe003); // ruleset icons without circles - public static IconUsage FilledCircle => Get(0xe004); - public static IconUsage CrossCircle => Get(0xe005); - public static IconUsage Logo => Get(0xe006); - public static IconUsage ChevronDownCircle => Get(0xe007); - public static IconUsage EditCircle => Get(0xe033); - public static IconUsage LeftCircle => Get(0xe034); - public static IconUsage RightCircle => Get(0xe035); - public static IconUsage Charts => Get(0xe036); - public static IconUsage Solo => Get(0xe037); - public static IconUsage Multi => Get(0xe038); - public static IconUsage Gear => Get(0xe039); + public static IconUsage FilledCircle => get(0xe004); + public static IconUsage CrossCircle => get(0xe005); + public static IconUsage Logo => get(0xe006); + public static IconUsage ChevronDownCircle => get(0xe007); + public static IconUsage EditCircle => get(0xe033); + public static IconUsage LeftCircle => get(0xe034); + public static IconUsage RightCircle => get(0xe035); + public static IconUsage Charts => get(0xe036); + public static IconUsage Solo => get(0xe037); + public static IconUsage Multi => get(0xe038); + public static IconUsage Gear => get(0xe039); // misc icons - public static IconUsage Bat => Get(0xe008); - public static IconUsage Bubble => Get(0xe009); - public static IconUsage BubblePop => Get(0xe02e); - public static IconUsage Dice => Get(0xe011); - public static IconUsage Heart => Get(0xe02f); - public static IconUsage HeartBreak => Get(0xe030); - public static IconUsage Hot => Get(0xe031); - public static IconUsage ListSearch => Get(0xe032); + public static IconUsage Bat => get(0xe008); + public static IconUsage Bubble => get(0xe009); + public static IconUsage BubblePop => get(0xe02e); + public static IconUsage Dice => get(0xe011); + public static IconUsage Heart => get(0xe02f); + public static IconUsage HeartBreak => get(0xe030); + public static IconUsage Hot => get(0xe031); + public static IconUsage ListSearch => get(0xe032); //osu! playstyles - public static IconUsage PlayStyleTablet => Get(0xe02a); - public static IconUsage PlayStyleMouse => Get(0xe029); - public static IconUsage PlayStyleKeyboard => Get(0xe02b); - public static IconUsage PlayStyleTouch => Get(0xe02c); + public static IconUsage PlayStyleTablet => get(0xe02a); + public static IconUsage PlayStyleMouse => get(0xe029); + public static IconUsage PlayStyleKeyboard => get(0xe02b); + public static IconUsage PlayStyleTouch => get(0xe02c); // osu! difficulties - public static IconUsage EasyOsu => Get(0xe015); - public static IconUsage NormalOsu => Get(0xe016); - public static IconUsage HardOsu => Get(0xe017); - public static IconUsage InsaneOsu => Get(0xe018); - public static IconUsage ExpertOsu => Get(0xe019); + public static IconUsage EasyOsu => get(0xe015); + public static IconUsage NormalOsu => get(0xe016); + public static IconUsage HardOsu => get(0xe017); + public static IconUsage InsaneOsu => get(0xe018); + public static IconUsage ExpertOsu => get(0xe019); // taiko difficulties - public static IconUsage EasyTaiko => Get(0xe01a); - public static IconUsage NormalTaiko => Get(0xe01b); - public static IconUsage HardTaiko => Get(0xe01c); - public static IconUsage InsaneTaiko => Get(0xe01d); - public static IconUsage ExpertTaiko => Get(0xe01e); + public static IconUsage EasyTaiko => get(0xe01a); + public static IconUsage NormalTaiko => get(0xe01b); + public static IconUsage HardTaiko => get(0xe01c); + public static IconUsage InsaneTaiko => get(0xe01d); + public static IconUsage ExpertTaiko => get(0xe01e); // fruits difficulties - public static IconUsage EasyFruits => Get(0xe01f); - public static IconUsage NormalFruits => Get(0xe020); - public static IconUsage HardFruits => Get(0xe021); - public static IconUsage InsaneFruits => Get(0xe022); - public static IconUsage ExpertFruits => Get(0xe023); + public static IconUsage EasyFruits => get(0xe01f); + public static IconUsage NormalFruits => get(0xe020); + public static IconUsage HardFruits => get(0xe021); + public static IconUsage InsaneFruits => get(0xe022); + public static IconUsage ExpertFruits => get(0xe023); // mania difficulties - public static IconUsage EasyMania => Get(0xe024); - public static IconUsage NormalMania => Get(0xe025); - public static IconUsage HardMania => Get(0xe026); - public static IconUsage InsaneMania => Get(0xe027); - public static IconUsage ExpertMania => Get(0xe028); + public static IconUsage EasyMania => get(0xe024); + public static IconUsage NormalMania => get(0xe025); + public static IconUsage HardMania => get(0xe026); + public static IconUsage InsaneMania => get(0xe027); + public static IconUsage ExpertMania => get(0xe028); // mod icons - public static IconUsage ModPerfect => Get(0xe049); - public static IconUsage ModAutopilot => Get(0xe03a); - public static IconUsage ModAuto => Get(0xe03b); - public static IconUsage ModCinema => Get(0xe03c); - public static IconUsage ModDoubleTime => Get(0xe03d); - public static IconUsage ModEasy => Get(0xe03e); - public static IconUsage ModFlashlight => Get(0xe03f); - public static IconUsage ModHalftime => Get(0xe040); - public static IconUsage ModHardRock => Get(0xe041); - public static IconUsage ModHidden => Get(0xe042); - public static IconUsage ModNightcore => Get(0xe043); - public static IconUsage ModNoFail => Get(0xe044); - public static IconUsage ModRelax => Get(0xe045); - public static IconUsage ModSpunOut => Get(0xe046); - public static IconUsage ModSuddenDeath => Get(0xe047); - public static IconUsage ModTarget => Get(0xe048); + public static IconUsage ModPerfect => get(0xe049); + public static IconUsage ModAutopilot => get(0xe03a); + public static IconUsage ModAuto => get(0xe03b); + public static IconUsage ModCinema => get(0xe03c); + public static IconUsage ModDoubleTime => get(0xe03d); + public static IconUsage ModEasy => get(0xe03e); + public static IconUsage ModFlashlight => get(0xe03f); + public static IconUsage ModHalftime => get(0xe040); + public static IconUsage ModHardRock => get(0xe041); + public static IconUsage ModHidden => get(0xe042); + public static IconUsage ModNightcore => get(0xe043); + public static IconUsage ModNoFail => get(0xe044); + public static IconUsage ModRelax => get(0xe045); + public static IconUsage ModSpunOut => get(0xe046); + public static IconUsage ModSuddenDeath => get(0xe047); + public static IconUsage ModTarget => get(0xe048); // Use "Icons/BeatmapDetails/mod-icon" instead // public static IconUsage ModBg => Get(0xe04a); + + #endregion } } From 45143a6c17e4574aab8a910a7be27e568f91c34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:17:39 +0100 Subject: [PATCH 368/567] Implement new icon store --- osu.Game/Graphics/OsuIcon.cs | 348 ++++++++++++++++++++++++++++++++++- osu.Game/OsuGameBase.cs | 1 + 2 files changed, 347 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/OsuIcon.cs b/osu.Game/Graphics/OsuIcon.cs index d1ad818300..3cd10b1315 100644 --- a/osu.Game/Graphics/OsuIcon.cs +++ b/osu.Game/Graphics/OsuIcon.cs @@ -1,7 +1,16 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using osu.Framework.Extensions; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.Text; namespace osu.Game.Graphics { @@ -19,7 +28,6 @@ namespace osu.Game.Graphics // ruleset icons without circles public static IconUsage FilledCircle => get(0xe004); - public static IconUsage CrossCircle => get(0xe005); public static IconUsage Logo => get(0xe006); public static IconUsage ChevronDownCircle => get(0xe007); public static IconUsage EditCircle => get(0xe033); @@ -35,7 +43,6 @@ namespace osu.Game.Graphics public static IconUsage Bubble => get(0xe009); public static IconUsage BubblePop => get(0xe02e); public static IconUsage Dice => get(0xe011); - public static IconUsage Heart => get(0xe02f); public static IconUsage HeartBreak => get(0xe030); public static IconUsage Hot => get(0xe031); public static IconUsage ListSearch => get(0xe032); @@ -96,5 +103,342 @@ namespace osu.Game.Graphics // public static IconUsage ModBg => Get(0xe04a); #endregion + + #region New single-file-based icons + + public const string FONT_NAME = @"Icons"; + + public static IconUsage Audio => get(OsuIconMapping.Audio); + public static IconUsage Beatmap => get(OsuIconMapping.Beatmap); + public static IconUsage Calendar => get(OsuIconMapping.Calendar); + public static IconUsage ChangelogA => get(OsuIconMapping.ChangelogA); + public static IconUsage ChangelogB => get(OsuIconMapping.ChangelogB); + public static IconUsage Chat => get(OsuIconMapping.Chat); + public static IconUsage CheckCircle => get(OsuIconMapping.CheckCircle); + public static IconUsage CollapseA => get(OsuIconMapping.CollapseA); + public static IconUsage Collections => get(OsuIconMapping.Collections); + public static IconUsage Cross => get(OsuIconMapping.Cross); + public static IconUsage CrossCircle => get(OsuIconMapping.CrossCircle); + public static IconUsage Crown => get(OsuIconMapping.Crown); + public static IconUsage Debug => get(OsuIconMapping.Debug); + public static IconUsage Delete => get(OsuIconMapping.Delete); + public static IconUsage Details => get(OsuIconMapping.Details); + public static IconUsage Discord => get(OsuIconMapping.Discord); + public static IconUsage EllipsisHorizontal => get(OsuIconMapping.EllipsisHorizontal); + public static IconUsage EllipsisVertical => get(OsuIconMapping.EllipsisVertical); + public static IconUsage ExpandA => get(OsuIconMapping.ExpandA); + public static IconUsage ExpandB => get(OsuIconMapping.ExpandB); + public static IconUsage FeaturedArtist => get(OsuIconMapping.FeaturedArtist); + public static IconUsage FeaturedArtistCircle => get(OsuIconMapping.FeaturedArtistCircle); + public static IconUsage GameplayA => get(OsuIconMapping.GameplayA); + public static IconUsage GameplayB => get(OsuIconMapping.GameplayB); + public static IconUsage GameplayC => get(OsuIconMapping.GameplayC); + public static IconUsage Global => get(OsuIconMapping.Global); + public static IconUsage Graphics => get(OsuIconMapping.Graphics); + public static IconUsage Heart => get(OsuIconMapping.Heart); + public static IconUsage Home => get(OsuIconMapping.Home); + public static IconUsage Input => get(OsuIconMapping.Input); + public static IconUsage Maintenance => get(OsuIconMapping.Maintenance); + public static IconUsage Megaphone => get(OsuIconMapping.Megaphone); + public static IconUsage Music => get(OsuIconMapping.Music); + public static IconUsage News => get(OsuIconMapping.News); + public static IconUsage Next => get(OsuIconMapping.Next); + public static IconUsage NextCircle => get(OsuIconMapping.NextCircle); + public static IconUsage Notification => get(OsuIconMapping.Notification); + public static IconUsage Online => get(OsuIconMapping.Online); + public static IconUsage Play => get(OsuIconMapping.Play); + public static IconUsage Player => get(OsuIconMapping.Player); + public static IconUsage PlayerFollow => get(OsuIconMapping.PlayerFollow); + public static IconUsage Prev => get(OsuIconMapping.Prev); + public static IconUsage PrevCircle => get(OsuIconMapping.PrevCircle); + public static IconUsage Ranking => get(OsuIconMapping.Ranking); + public static IconUsage Rulesets => get(OsuIconMapping.Rulesets); + public static IconUsage Search => get(OsuIconMapping.Search); + public static IconUsage Settings => get(OsuIconMapping.Settings); + public static IconUsage SkinA => get(OsuIconMapping.SkinA); + public static IconUsage SkinB => get(OsuIconMapping.SkinB); + public static IconUsage Star => get(OsuIconMapping.Star); + public static IconUsage Storyboard => get(OsuIconMapping.Storyboard); + public static IconUsage Team => get(OsuIconMapping.Team); + public static IconUsage ThumbsUp => get(OsuIconMapping.ThumbsUp); + public static IconUsage Tournament => get(OsuIconMapping.Tournament); + public static IconUsage Twitter => get(OsuIconMapping.Twitter); + public static IconUsage UserInterface => get(OsuIconMapping.UserInterface); + public static IconUsage Wiki => get(OsuIconMapping.Wiki); + public static IconUsage EditorAddControlPoint => get(OsuIconMapping.EditorAddControlPoint); + public static IconUsage EditorConvertToStream => get(OsuIconMapping.EditorConvertToStream); + public static IconUsage EditorDistanceSnap => get(OsuIconMapping.EditorDistanceSnap); + public static IconUsage EditorFinish => get(OsuIconMapping.EditorFinish); + public static IconUsage EditorGridSnap => get(OsuIconMapping.EditorGridSnap); + public static IconUsage EditorNewComboA => get(OsuIconMapping.EditorNewComboA); + public static IconUsage EditorNewComboB => get(OsuIconMapping.EditorNewComboB); + public static IconUsage EditorSelect => get(OsuIconMapping.EditorSelect); + public static IconUsage EditorSound => get(OsuIconMapping.EditorSound); + public static IconUsage EditorWhistle => get(OsuIconMapping.EditorWhistle); + + private static IconUsage get(OsuIconMapping glyph) => new IconUsage((char)glyph, FONT_NAME); + + private enum OsuIconMapping + { + [Description(@"audio")] + Audio, + + [Description(@"beatmap")] + Beatmap, + + [Description(@"calendar")] + Calendar, + + [Description(@"changelog-a")] + ChangelogA, + + [Description(@"changelog-b")] + ChangelogB, + + [Description(@"chat")] + Chat, + + [Description(@"check-circle")] + CheckCircle, + + [Description(@"collapse-a")] + CollapseA, + + [Description(@"collections")] + Collections, + + [Description(@"cross")] + Cross, + + [Description(@"cross-circle")] + CrossCircle, + + [Description(@"crown")] + Crown, + + [Description(@"debug")] + Debug, + + [Description(@"delete")] + Delete, + + [Description(@"details")] + Details, + + [Description(@"discord")] + Discord, + + [Description(@"ellipsis-horizontal")] + EllipsisHorizontal, + + [Description(@"ellipsis-vertical")] + EllipsisVertical, + + [Description(@"expand-a")] + ExpandA, + + [Description(@"expand-b")] + ExpandB, + + [Description(@"featured-artist")] + FeaturedArtist, + + [Description(@"featured-artist-circle")] + FeaturedArtistCircle, + + [Description(@"gameplay-a")] + GameplayA, + + [Description(@"gameplay-b")] + GameplayB, + + [Description(@"gameplay-c")] + GameplayC, + + [Description(@"global")] + Global, + + [Description(@"graphics")] + Graphics, + + [Description(@"heart")] + Heart, + + [Description(@"home")] + Home, + + [Description(@"input")] + Input, + + [Description(@"maintenance")] + Maintenance, + + [Description(@"megaphone")] + Megaphone, + + [Description(@"music")] + Music, + + [Description(@"news")] + News, + + [Description(@"next")] + Next, + + [Description(@"next-circle")] + NextCircle, + + [Description(@"notification")] + Notification, + + [Description(@"online")] + Online, + + [Description(@"play")] + Play, + + [Description(@"player")] + Player, + + [Description(@"player-follow")] + PlayerFollow, + + [Description(@"prev")] + Prev, + + [Description(@"prev-circle")] + PrevCircle, + + [Description(@"ranking")] + Ranking, + + [Description(@"rulesets")] + Rulesets, + + [Description(@"search")] + Search, + + [Description(@"settings")] + Settings, + + [Description(@"skin-a")] + SkinA, + + [Description(@"skin-b")] + SkinB, + + [Description(@"star")] + Star, + + [Description(@"storyboard")] + Storyboard, + + [Description(@"team")] + Team, + + [Description(@"thumbs-up")] + ThumbsUp, + + [Description(@"tournament")] + Tournament, + + [Description(@"twitter")] + Twitter, + + [Description(@"user-interface")] + UserInterface, + + [Description(@"wiki")] + Wiki, + + [Description(@"Editor/add-control-point")] + EditorAddControlPoint = 1000, + + [Description(@"Editor/convert-to-stream")] + EditorConvertToStream, + + [Description(@"Editor/distance-snap")] + EditorDistanceSnap, + + [Description(@"Editor/finish")] + EditorFinish, + + [Description(@"Editor/grid-snap")] + EditorGridSnap, + + [Description(@"Editor/new-combo-a")] + EditorNewComboA, + + [Description(@"Editor/new-combo-b")] + EditorNewComboB, + + [Description(@"Editor/select")] + EditorSelect, + + [Description(@"Editor/sound")] + EditorSound, + + [Description(@"Editor/whistle")] + EditorWhistle, + } + + public class OsuIconStore : ITextureStore, ITexturedGlyphLookupStore + { + private readonly TextureStore textures; + + public OsuIconStore(TextureStore textures) + { + this.textures = textures; + } + + public ITexturedCharacterGlyph? Get(string? fontName, char character) + { + if (fontName == FONT_NAME) + return new Glyph(textures.Get($@"{fontName}/{((OsuIconMapping)character).GetDescription()}")); + + return null; + } + + public Task GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); + + public Texture? Get(string name, WrapMode wrapModeS, WrapMode wrapModeT) => null; + + public Texture Get(string name) => throw new NotImplementedException(); + + public Task GetAsync(string name, CancellationToken cancellationToken = default) => throw new NotImplementedException(); + + public Stream GetStream(string name) => throw new NotImplementedException(); + + public IEnumerable GetAvailableResources() => throw new NotImplementedException(); + + public Task GetAsync(string name, WrapMode wrapModeS, WrapMode wrapModeT, CancellationToken cancellationToken = default) => throw new NotImplementedException(); + + public class Glyph : ITexturedCharacterGlyph + { + public float XOffset => default; + public float YOffset => default; + public float XAdvance => default; + public float Baseline => default; + public char Character => default; + + public float GetKerning(T lastGlyph) where T : ICharacterGlyph => throw new NotImplementedException(); + + public Texture Texture { get; } + public float Width => Texture.Width; + public float Height => Texture.Height; + + public Glyph(Texture texture) + { + Texture = texture; + } + } + + public void Dispose() + { + textures.Dispose(); + } + } + + #endregion } } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 48548dc1ef..b4ad21f045 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -479,6 +479,7 @@ namespace osu.Game AddFont(Resources, @"Fonts/Venera/Venera-Black"); Fonts.AddStore(new HexaconsIcons.HexaconsStore(Textures)); + Fonts.AddStore(new OsuIcon.OsuIconStore(Textures)); } protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => From 69baabee627f55d87f6ba61f361e1b370bbfdd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:35:03 +0100 Subject: [PATCH 369/567] Replace hexacons in toolbar with new icons --- osu.Game/Overlays/BeatmapListing/BeatmapListingHeader.cs | 2 +- osu.Game/Overlays/Changelog/ChangelogHeader.cs | 2 +- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/Dashboard/DashboardOverlayHeader.cs | 2 +- osu.Game/Overlays/News/NewsHeader.cs | 2 +- osu.Game/Overlays/NotificationOverlay.cs | 2 +- osu.Game/Overlays/NowPlayingOverlay.cs | 2 +- osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs | 2 +- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs | 2 +- osu.Game/Overlays/Wiki/WikiHeader.cs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapListingHeader.cs b/osu.Game/Overlays/BeatmapListing/BeatmapListingHeader.cs index 27fab82bf3..075dfd02b0 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapListingHeader.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapListingHeader.cs @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.BeatmapListing { Title = PageTitleStrings.MainBeatmapsetsControllerIndex; Description = NamedOverlayComponentStrings.BeatmapListingDescription; - Icon = HexaconsIcons.Beatmap; + Icon = OsuIcon.Beatmap; } } } diff --git a/osu.Game/Overlays/Changelog/ChangelogHeader.cs b/osu.Game/Overlays/Changelog/ChangelogHeader.cs index 61ea9dc4db..f738d70370 100644 --- a/osu.Game/Overlays/Changelog/ChangelogHeader.cs +++ b/osu.Game/Overlays/Changelog/ChangelogHeader.cs @@ -124,7 +124,7 @@ namespace osu.Game.Overlays.Changelog { Title = PageTitleStrings.MainChangelogControllerDefault; Description = NamedOverlayComponentStrings.ChangelogDescription; - Icon = HexaconsIcons.Devtools; + Icon = OsuIcon.ChangelogB; } } } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 4aa4c59471..8f3b7031c2 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays { public partial class ChatOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent, IKeyBindingHandler { - public IconUsage Icon => HexaconsIcons.Messaging; + public IconUsage Icon => OsuIcon.Chat; public LocalisableString Title => ChatStrings.HeaderTitle; public LocalisableString Description => ChatStrings.HeaderDescription; diff --git a/osu.Game/Overlays/Dashboard/DashboardOverlayHeader.cs b/osu.Game/Overlays/Dashboard/DashboardOverlayHeader.cs index 104f0943dc..8fd8f6b332 100644 --- a/osu.Game/Overlays/Dashboard/DashboardOverlayHeader.cs +++ b/osu.Game/Overlays/Dashboard/DashboardOverlayHeader.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Dashboard { Title = PageTitleStrings.MainHomeControllerIndex; Description = NamedOverlayComponentStrings.DashboardDescription; - Icon = HexaconsIcons.Social; + Icon = OsuIcon.Global; } } } diff --git a/osu.Game/Overlays/News/NewsHeader.cs b/osu.Game/Overlays/News/NewsHeader.cs index f237ed66f2..92d71a21ef 100644 --- a/osu.Game/Overlays/News/NewsHeader.cs +++ b/osu.Game/Overlays/News/NewsHeader.cs @@ -69,7 +69,7 @@ namespace osu.Game.Overlays.News { Title = PageTitleStrings.MainNewsControllerDefault; Description = NamedOverlayComponentStrings.NewsDescription; - Icon = HexaconsIcons.News; + Icon = OsuIcon.News; } } } diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs index f56d09f2b2..18a487a312 100644 --- a/osu.Game/Overlays/NotificationOverlay.cs +++ b/osu.Game/Overlays/NotificationOverlay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays { public partial class NotificationOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent, INotificationOverlay { - public IconUsage Icon => HexaconsIcons.Notification; + public IconUsage Icon => OsuIcon.Notification; public LocalisableString Title => NotificationsStrings.HeaderTitle; public LocalisableString Description => NotificationsStrings.HeaderDescription; diff --git a/osu.Game/Overlays/NowPlayingOverlay.cs b/osu.Game/Overlays/NowPlayingOverlay.cs index 425ff0935d..7ec52364d4 100644 --- a/osu.Game/Overlays/NowPlayingOverlay.cs +++ b/osu.Game/Overlays/NowPlayingOverlay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays { public partial class NowPlayingOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent { - public IconUsage Icon => HexaconsIcons.Music; + public IconUsage Icon => OsuIcon.Music; public LocalisableString Title => NowPlayingStrings.HeaderTitle; public LocalisableString Description => NowPlayingStrings.HeaderDescription; diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index 63128fb73d..a23ec18afe 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -36,7 +36,7 @@ namespace osu.Game.Overlays.Rankings { Title = PageTitleStrings.MainRankingControllerDefault; Description = NamedOverlayComponentStrings.RankingsDescription; - Icon = HexaconsIcons.Rankings; + Icon = OsuIcon.Ranking; } } } diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 5735b1515a..9efd848035 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays { public partial class SettingsOverlay : SettingsPanel, INamedOverlayComponent { - public IconUsage Icon => HexaconsIcons.Settings; + public IconUsage Icon => OsuIcon.Settings; public LocalisableString Title => SettingsStrings.HeaderTitle; public LocalisableString Description => SettingsStrings.HeaderDescription; diff --git a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs index ded0229d67..70675c1b92 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Toolbar { TooltipMain = ToolbarStrings.HomeHeaderTitle; TooltipSub = ToolbarStrings.HomeHeaderDescription; - SetIcon(HexaconsIcons.Home); + SetIcon(OsuIcon.Home); } } } diff --git a/osu.Game/Overlays/Wiki/WikiHeader.cs b/osu.Game/Overlays/Wiki/WikiHeader.cs index 9e9e565684..24eddeb0c2 100644 --- a/osu.Game/Overlays/Wiki/WikiHeader.cs +++ b/osu.Game/Overlays/Wiki/WikiHeader.cs @@ -82,7 +82,7 @@ namespace osu.Game.Overlays.Wiki { Title = PageTitleStrings.MainWikiControllerDefault; Description = NamedOverlayComponentStrings.WikiDescription; - Icon = HexaconsIcons.Wiki; + Icon = OsuIcon.Wiki; } } } From 28d9145a4c182ecb66029e0b1e52f24f7cc16acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:47:29 +0100 Subject: [PATCH 370/567] Add more spacing to toolbar icons --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 81d2de5acb..a547fda814 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -113,7 +113,7 @@ namespace osu.Game.Overlays.Toolbar { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Size = new Vector2(26), + Size = new Vector2(20), Alpha = 0, }, DrawableText = new OsuSpriteText From c45477bd1fff8447755f7afd54bf5156e1352833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:40:48 +0100 Subject: [PATCH 371/567] Use new icons in main menu wherever feasible --- osu.Game/Screens/Menu/ButtonSystem.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index ca5bef985e..b2b3fbd626 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -13,7 +13,6 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; using osu.Framework.Logging; @@ -103,8 +102,8 @@ namespace osu.Game.Screens.Menu buttonArea.AddRange(new Drawable[] { - new MainMenuButton(ButtonSystemStrings.Settings, string.Empty, FontAwesome.Solid.Cog, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), - backButton = new MainMenuButton(ButtonSystemStrings.Back, @"back-to-top", OsuIcon.LeftCircle, new Color4(51, 58, 94, 255), () => State = ButtonSystemState.TopLevel, + new MainMenuButton(ButtonSystemStrings.Settings, string.Empty, OsuIcon.Settings, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), + backButton = new MainMenuButton(ButtonSystemStrings.Back, @"back-to-top", OsuIcon.PrevCircle, new Color4(51, 58, 94, 255), () => State = ButtonSystemState.TopLevel, -WEDGE_WIDTH) { VisibleStateMin = ButtonSystemState.Play, @@ -128,18 +127,18 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(AudioManager audio, IdleTracker? idleTracker, GameHost host) { - buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Solo, @"button-default-select", FontAwesome.Solid.User, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); - buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Multi, @"button-default-select", FontAwesome.Solid.Users, new Color4(94, 63, 186, 255), onMultiplayer, 0, Key.M)); - buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Playlists, @"button-default-select", OsuIcon.Charts, new Color4(94, 63, 186, 255), onPlaylists, 0, Key.L)); + buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Solo, @"button-default-select", OsuIcon.Player, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); + buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Multi, @"button-default-select", OsuIcon.Online, new Color4(94, 63, 186, 255), onMultiplayer, 0, Key.M)); + buttonsPlay.Add(new MainMenuButton(ButtonSystemStrings.Playlists, @"button-default-select", OsuIcon.Tournament, new Color4(94, 63, 186, 255), onPlaylists, 0, Key.L)); buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play); - buttonsEdit.Add(new MainMenuButton(EditorStrings.BeatmapEditor.ToLower(), @"button-default-select", HexaconsIcons.Beatmap, new Color4(238, 170, 0, 255), () => OnEditBeatmap?.Invoke(), WEDGE_WIDTH, Key.B)); - buttonsEdit.Add(new MainMenuButton(SkinEditorStrings.SkinEditor.ToLower(), @"button-default-select", HexaconsIcons.Editor, new Color4(220, 160, 0, 255), () => OnEditSkin?.Invoke(), 0, Key.S)); + buttonsEdit.Add(new MainMenuButton(EditorStrings.BeatmapEditor.ToLower(), @"button-default-select", OsuIcon.Beatmap, new Color4(238, 170, 0, 255), () => OnEditBeatmap?.Invoke(), WEDGE_WIDTH, Key.B)); + buttonsEdit.Add(new MainMenuButton(SkinEditorStrings.SkinEditor.ToLower(), @"button-default-select", OsuIcon.SkinB, new Color4(220, 160, 0, 255), () => OnEditSkin?.Invoke(), 0, Key.S)); buttonsEdit.ForEach(b => b.VisibleState = ButtonSystemState.Edit); buttonsTopLevel.Add(new MainMenuButton(ButtonSystemStrings.Play, @"button-play-select", OsuIcon.Logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P)); buttonsTopLevel.Add(new MainMenuButton(ButtonSystemStrings.Edit, @"button-play-select", OsuIcon.EditCircle, new Color4(238, 170, 0, 255), () => State = ButtonSystemState.Edit, 0, Key.E)); - buttonsTopLevel.Add(new MainMenuButton(ButtonSystemStrings.Browse, @"button-default-select", OsuIcon.ChevronDownCircle, new Color4(165, 204, 0, 255), () => OnBeatmapListing?.Invoke(), 0, Key.B, Key.D)); + buttonsTopLevel.Add(new MainMenuButton(ButtonSystemStrings.Browse, @"button-default-select", OsuIcon.Beatmap, new Color4(165, 204, 0, 255), () => OnBeatmapListing?.Invoke(), 0, Key.B, Key.D)); if (host.CanExit) buttonsTopLevel.Add(new MainMenuButton(ButtonSystemStrings.Exit, string.Empty, OsuIcon.CrossCircle, new Color4(238, 51, 153, 255), () => OnExit?.Invoke(), 0, Key.Q)); From 2857322a8bc3257ae26ea35567b8f1741b7a45ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:53:01 +0100 Subject: [PATCH 372/567] Use new icons in settings --- osu.Game/Overlays/Settings/Sections/AudioSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/DebugSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/GameplaySection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/GeneralSection.cs | 2 +- osu.Game/Overlays/Settings/Sections/GraphicsSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/InputSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/OnlineSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/RulesetSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 3 ++- osu.Game/Overlays/Settings/Sections/UserInterfaceSection.cs | 3 ++- 11 files changed, 21 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/AudioSection.cs b/osu.Game/Overlays/Settings/Sections/AudioSection.cs index fb3d486776..1ab0d6c886 100644 --- a/osu.Game/Overlays/Settings/Sections/AudioSection.cs +++ b/osu.Game/Overlays/Settings/Sections/AudioSection.cs @@ -6,6 +6,7 @@ using System.Linq; using osu.Framework.Localisation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Audio; @@ -17,7 +18,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.VolumeUp + Icon = OsuIcon.Audio }; public override IEnumerable FilterTerms => base.FilterTerms.Concat(new LocalisableString[] { "sound" }); diff --git a/osu.Game/Overlays/Settings/Sections/DebugSection.cs b/osu.Game/Overlays/Settings/Sections/DebugSection.cs index 33a6f4c673..b84c441057 100644 --- a/osu.Game/Overlays/Settings/Sections/DebugSection.cs +++ b/osu.Game/Overlays/Settings/Sections/DebugSection.cs @@ -5,6 +5,7 @@ using osu.Framework.Development; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.DebugSettings; @@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Bug + Icon = OsuIcon.Debug }; public DebugSection() diff --git a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs index b60689b611..463b3d1d09 100644 --- a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Gameplay; @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Regular.DotCircle + Icon = OsuIcon.GameplayC }; public GameplaySection() diff --git a/osu.Game/Overlays/Settings/Sections/GeneralSection.cs b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs index 2b043d40bc..2aa1008b1d 100644 --- a/osu.Game/Overlays/Settings/Sections/GeneralSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Cog + Icon = OsuIcon.Settings }; [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs index 98f6908512..e1fa1eef9c 100644 --- a/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Graphics; @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Laptop + Icon = OsuIcon.Graphics }; public GraphicsSection() diff --git a/osu.Game/Overlays/Settings/Sections/InputSection.cs b/osu.Game/Overlays/Settings/Sections/InputSection.cs index a8f19cc91d..0204aa5e64 100644 --- a/osu.Game/Overlays/Settings/Sections/InputSection.cs +++ b/osu.Game/Overlays/Settings/Sections/InputSection.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Handlers; using osu.Framework.Localisation; using osu.Framework.Platform; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Input; @@ -20,7 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Keyboard + Icon = OsuIcon.Input }; public InputSection(KeyBindingPanel keyConfig) diff --git a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs index bb0a952164..bd90e4c35d 100644 --- a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs +++ b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Maintenance; @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Wrench + Icon = OsuIcon.Maintenance }; public MaintenanceSection() diff --git a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs index c8faa3b697..1484f2c756 100644 --- a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs +++ b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.Online; @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.GlobeAsia + Icon = OsuIcon.Online }; public OnlineSection() diff --git a/osu.Game/Overlays/Settings/Sections/RulesetSection.cs b/osu.Game/Overlays/Settings/Sections/RulesetSection.cs index aaad1ec4e2..626264151f 100644 --- a/osu.Game/Overlays/Settings/Sections/RulesetSection.cs +++ b/osu.Game/Overlays/Settings/Sections/RulesetSection.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Framework.Logging; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Rulesets; @@ -18,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.Chess + Icon = OsuIcon.Rulesets }; [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 1d057f42c0..9b04f208a7 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Framework.Logging; using osu.Game.Database; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; using osu.Game.Overlays.SkinEditor; @@ -31,7 +32,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.PaintBrush + Icon = OsuIcon.SkinB }; private static readonly Live random_skin_info = new SkinInfo diff --git a/osu.Game/Overlays/Settings/Sections/UserInterfaceSection.cs b/osu.Game/Overlays/Settings/Sections/UserInterfaceSection.cs index 2ec9e32ea9..953ede25e1 100644 --- a/osu.Game/Overlays/Settings/Sections/UserInterfaceSection.cs +++ b/osu.Game/Overlays/Settings/Sections/UserInterfaceSection.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Localisation; using osu.Game.Overlays.Settings.Sections.UserInterface; @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections public override Drawable CreateIcon() => new SpriteIcon { - Icon = FontAwesome.Solid.LayerGroup + Icon = OsuIcon.UserInterface }; public UserInterfaceSection() From 288ac930e44bd8dc5b5ab8d5f5f342228625fc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 16:03:57 +0100 Subject: [PATCH 373/567] Use new icons in editor Some that exist on figma are purposefully not used due to an editorial request from @peppy. --- osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs | 3 ++- osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs | 3 ++- osu.Game/Rulesets/Edit/Tools/SelectTool.cs | 3 ++- .../Edit/Compose/Components/ComposeBlueprintContainer.cs | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs index 8382317d70..448cfaf84c 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs @@ -17,6 +17,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit.Tools; @@ -54,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Edit .Concat(DistanceSnapProvider.CreateTernaryButtons()) .Concat(new[] { - new TernaryButton(rectangularGridSnapToggle, "Grid Snap", () => new SpriteIcon { Icon = FontAwesome.Solid.Th }) + new TernaryButton(rectangularGridSnapToggle, "Grid Snap", () => new SpriteIcon { Icon = OsuIcon.EditorGridSnap }) }); private BindableList selectedHitObjects; diff --git a/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs b/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs index ddf539771d..b3ca59a5b0 100644 --- a/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs +++ b/osu.Game/Rulesets/Edit/ComposerDistanceSnapProvider.cs @@ -16,6 +16,7 @@ using osu.Framework.Input.Events; using osu.Framework.Localisation; using osu.Framework.Utils; using osu.Game.Configuration; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Input.Bindings; using osu.Game.Overlays; @@ -169,7 +170,7 @@ namespace osu.Game.Rulesets.Edit public IEnumerable CreateTernaryButtons() => new[] { - new TernaryButton(DistanceSnapToggle, "Distance Snap", () => new SpriteIcon { Icon = FontAwesome.Solid.Ruler }) + new TernaryButton(DistanceSnapToggle, "Distance Snap", () => new SpriteIcon { Icon = OsuIcon.EditorDistanceSnap }) }; protected override bool OnKeyDown(KeyDownEvent e) diff --git a/osu.Game/Rulesets/Edit/Tools/SelectTool.cs b/osu.Game/Rulesets/Edit/Tools/SelectTool.cs index 9640830a09..a272e9f480 100644 --- a/osu.Game/Rulesets/Edit/Tools/SelectTool.cs +++ b/osu.Game/Rulesets/Edit/Tools/SelectTool.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; namespace osu.Game.Rulesets.Edit.Tools { @@ -15,7 +16,7 @@ namespace osu.Game.Rulesets.Edit.Tools { } - public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.MousePointer }; + public override Drawable CreateIcon() => new SpriteIcon { Icon = OsuIcon.EditorSelect }; public override PlacementBlueprint CreatePlacementBlueprint() => null; } diff --git a/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs b/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs index c7c7c4aa83..4fba798a26 100644 --- a/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs @@ -225,7 +225,7 @@ namespace osu.Game.Screens.Edit.Compose.Components protected virtual IEnumerable CreateTernaryButtons() { //TODO: this should only be enabled (visible?) for rulesets that provide combo-supporting HitObjects. - yield return new TernaryButton(NewCombo, "New combo", () => new SpriteIcon { Icon = FontAwesome.Regular.DotCircle }); + yield return new TernaryButton(NewCombo, "New combo", () => new SpriteIcon { Icon = OsuIcon.EditorNewComboA }); foreach (var kvp in SelectionHandler.SelectionSampleStates) yield return new TernaryButton(kvp.Value, kvp.Key.Replace("hit", string.Empty).Titleize(), () => getIconForSample(kvp.Key)); @@ -272,10 +272,10 @@ namespace osu.Game.Screens.Edit.Compose.Components return new SpriteIcon { Icon = FontAwesome.Solid.Hands }; case HitSampleInfo.HIT_WHISTLE: - return new SpriteIcon { Icon = FontAwesome.Solid.Bullhorn }; + return new SpriteIcon { Icon = OsuIcon.EditorWhistle }; case HitSampleInfo.HIT_FINISH: - return new SpriteIcon { Icon = FontAwesome.Solid.DrumSteelpan }; + return new SpriteIcon { Icon = OsuIcon.EditorFinish }; } return null; From 53766285ce6cd5b227e933fe45da8f32bc2f6cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:55:19 +0100 Subject: [PATCH 374/567] Remove remaining hexacons usages --- osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeader.cs | 2 +- osu.Game/Overlays/BeatmapSet/BeatmapSetHeader.cs | 2 +- osu.Game/Overlays/Chat/ChatOverlayTopBar.cs | 2 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 2 +- osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs | 2 +- osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeader.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeader.cs index 55a04b129c..5db7223bdf 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeader.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOverlayHeader.cs @@ -154,7 +154,7 @@ namespace osu.Game.Tests.Visual.UserInterface public TestTitle() { Title = "title"; - Icon = HexaconsIcons.Devtools; + Icon = OsuIcon.ChangelogB; } } } diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeader.cs b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeader.cs index eced27f35e..1df246ae77 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapSetHeader.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapSetHeader.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet public BeatmapHeaderTitle() { Title = PageTitleStrings.MainBeatmapsetsControllerShow; - Icon = HexaconsIcons.Beatmap; + Icon = OsuIcon.Beatmap; } } } diff --git a/osu.Game/Overlays/Chat/ChatOverlayTopBar.cs b/osu.Game/Overlays/Chat/ChatOverlayTopBar.cs index 4fc9fbb6d5..3ecdb09976 100644 --- a/osu.Game/Overlays/Chat/ChatOverlayTopBar.cs +++ b/osu.Game/Overlays/Chat/ChatOverlayTopBar.cs @@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Chat { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Icon = HexaconsIcons.Messaging, + Icon = OsuIcon.Chat, Size = new Vector2(24), }, // Placeholder text diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 78343d08f1..42bec50022 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -87,7 +87,7 @@ namespace osu.Game.Overlays.Profile public ProfileHeaderTitle() { Title = PageTitleStrings.MainUsersControllerDefault; - Icon = HexaconsIcons.Profile; + Icon = OsuIcon.Player; } } } diff --git a/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs index 5c77672d90..0e125d0ec0 100644 --- a/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Components/Menus/EditorMenuBar.cs @@ -51,7 +51,7 @@ namespace osu.Game.Screens.Edit.Components.Menus Size = new Vector2(26), Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Icon = HexaconsIcons.Editor, + Icon = OsuIcon.EditCircle, }, text = new TextFlowContainer { diff --git a/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs b/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs index 93448c4394..022da36abc 100644 --- a/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs +++ b/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs @@ -80,7 +80,7 @@ namespace osu.Game.Screens.Edit.Setup { Title = EditorSetupStrings.BeatmapSetup.ToLower(); Description = EditorSetupStrings.BeatmapSetupDescription; - Icon = HexaconsIcons.Social; + Icon = OsuIcon.Beatmap; } } From 89e2b6358a2937ee46246f3b05b4122c7528ae95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 15:55:37 +0100 Subject: [PATCH 375/567] Remove hexacons --- osu.Game/Graphics/HexaconsIcons.cs | 131 ----------------------------- osu.Game/OsuGameBase.cs | 1 - 2 files changed, 132 deletions(-) delete mode 100644 osu.Game/Graphics/HexaconsIcons.cs diff --git a/osu.Game/Graphics/HexaconsIcons.cs b/osu.Game/Graphics/HexaconsIcons.cs deleted file mode 100644 index 3eee5d7197..0000000000 --- a/osu.Game/Graphics/HexaconsIcons.cs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; -using osu.Framework.Text; - -namespace osu.Game.Graphics -{ - public static class HexaconsIcons - { - public const string FONT_NAME = "Icons/Hexacons"; - - public static IconUsage BeatmapPacks => get(HexaconsMapping.beatmap_packs); - public static IconUsage Beatmap => get(HexaconsMapping.beatmap); - public static IconUsage Calendar => get(HexaconsMapping.calendar); - public static IconUsage Chart => get(HexaconsMapping.chart); - public static IconUsage Community => get(HexaconsMapping.community); - public static IconUsage Contests => get(HexaconsMapping.contests); - public static IconUsage Devtools => get(HexaconsMapping.devtools); - public static IconUsage Download => get(HexaconsMapping.download); - public static IconUsage Editor => get(HexaconsMapping.editor); - public static IconUsage FeaturedArtist => get(HexaconsMapping.featured_artist); - public static IconUsage Home => get(HexaconsMapping.home); - public static IconUsage Messaging => get(HexaconsMapping.messaging); - public static IconUsage Music => get(HexaconsMapping.music); - public static IconUsage News => get(HexaconsMapping.news); - public static IconUsage Notification => get(HexaconsMapping.notification); - public static IconUsage Profile => get(HexaconsMapping.profile); - public static IconUsage Rankings => get(HexaconsMapping.rankings); - public static IconUsage Search => get(HexaconsMapping.search); - public static IconUsage Settings => get(HexaconsMapping.settings); - public static IconUsage Social => get(HexaconsMapping.social); - public static IconUsage Store => get(HexaconsMapping.store); - public static IconUsage Tournament => get(HexaconsMapping.tournament); - public static IconUsage Wiki => get(HexaconsMapping.wiki); - - private static IconUsage get(HexaconsMapping icon) => new IconUsage((char)icon, FONT_NAME); - - // Basically just converting to something we can use in a `char` lookup for FontStore/GlyphStore compatibility. - // Names should match filenames in resources. - private enum HexaconsMapping - { - beatmap_packs, - beatmap, - calendar, - chart, - community, - contests, - devtools, - download, - editor, - featured_artist, - home, - messaging, - music, - news, - notification, - profile, - rankings, - search, - settings, - social, - store, - tournament, - wiki, - } - - public class HexaconsStore : ITextureStore, ITexturedGlyphLookupStore - { - private readonly TextureStore textures; - - public HexaconsStore(TextureStore textures) - { - this.textures = textures; - } - - public void Dispose() - { - textures.Dispose(); - } - - public ITexturedCharacterGlyph? Get(string? fontName, char character) - { - if (fontName == FONT_NAME) - return new Glyph(textures.Get($"{fontName}/{((HexaconsMapping)character).ToString().Replace("_", "-")}")); - - return null; - } - - public Task GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); - - public Texture? Get(string name, WrapMode wrapModeS, WrapMode wrapModeT) => null; - - public Texture Get(string name) => throw new NotImplementedException(); - - public Task GetAsync(string name, CancellationToken cancellationToken = default) => throw new NotImplementedException(); - - public Stream GetStream(string name) => throw new NotImplementedException(); - - public IEnumerable GetAvailableResources() => throw new NotImplementedException(); - - public Task GetAsync(string name, WrapMode wrapModeS, WrapMode wrapModeT, CancellationToken cancellationToken = default) => throw new NotImplementedException(); - - public class Glyph : ITexturedCharacterGlyph - { - public float XOffset => default; - public float YOffset => default; - public float XAdvance => default; - public float Baseline => default; - public char Character => default; - - public float GetKerning(T lastGlyph) where T : ICharacterGlyph => throw new NotImplementedException(); - - public Texture Texture { get; } - public float Width => Texture.Width; - public float Height => Texture.Height; - - public Glyph(Texture texture) - { - Texture = texture; - } - } - } - } -} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index b4ad21f045..5b17dc13c2 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -478,7 +478,6 @@ namespace osu.Game AddFont(Resources, @"Fonts/Venera/Venera-Bold"); AddFont(Resources, @"Fonts/Venera/Venera-Black"); - Fonts.AddStore(new HexaconsIcons.HexaconsStore(Textures)); Fonts.AddStore(new OsuIcon.OsuIconStore(Textures)); } From 655528a5370fe83b05452e220d22103824bfecc0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 03:04:13 +0900 Subject: [PATCH 376/567] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index dd2393ff21..c7e0cc3808 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -37,7 +37,7 @@ - + From 5f7f1f771d2404e05a7d152d73e893e3d1c54cc0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 03:09:20 +0900 Subject: [PATCH 377/567] Reword tooltip text for dashboard --- osu.Game/Localisation/NamedOverlayComponentStrings.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Localisation/NamedOverlayComponentStrings.cs b/osu.Game/Localisation/NamedOverlayComponentStrings.cs index 475bea2a4a..72e63d699a 100644 --- a/osu.Game/Localisation/NamedOverlayComponentStrings.cs +++ b/osu.Game/Localisation/NamedOverlayComponentStrings.cs @@ -20,12 +20,12 @@ namespace osu.Game.Localisation public static LocalisableString ChangelogDescription => new TranslatableString(getKey(@"changelog_description"), @"track recent dev updates in the osu! ecosystem"); /// - /// "view your friends and other information" + /// "view your friends and spectate other players" /// - public static LocalisableString DashboardDescription => new TranslatableString(getKey(@"dashboard_description"), @"view your friends and other information"); + public static LocalisableString DashboardDescription => new TranslatableString(getKey(@"dashboard_description"), @"view your friends and spectate other players"); /// - /// "find out who's the best right now" + /// "find out who's the best right now" /// public static LocalisableString RankingsDescription => new TranslatableString(getKey(@"rankings_description"), @"find out who's the best right now"); @@ -39,6 +39,6 @@ namespace osu.Game.Localisation /// public static LocalisableString WikiDescription => new TranslatableString(getKey(@"wiki_description"), @"knowledge base"); - private static string getKey(string key) => $"{prefix}:{key}"; + private static string getKey(string key) => $@"{prefix}:{key}"; } } From 1f55ef211eda02b867327746313a32d599645d17 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 03:11:27 +0900 Subject: [PATCH 378/567] Rearrange buttons --- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 93294a9d30..ec1238ad1f 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -164,11 +164,11 @@ namespace osu.Game.Overlays.Toolbar { new ToolbarNewsButton(), new ToolbarChangelogButton(), + new ToolbarWikiButton(), new ToolbarRankingsButton(), new ToolbarBeatmapListingButton(), new ToolbarChatButton(), new ToolbarSocialButton(), - new ToolbarWikiButton(), new ToolbarMusicButton(), //new ToolbarButton //{ From d4423d493364065baa7984acda63884e26e8a98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 18:38:29 +0100 Subject: [PATCH 379/567] Store last set score to a `SessionStatic` --- osu.Game/Configuration/SessionStatics.cs | 7 +++++++ osu.Game/Scoring/ScoreInfo.cs | 1 + osu.Game/Screens/Play/SubmittingPlayer.cs | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/osu.Game/Configuration/SessionStatics.cs b/osu.Game/Configuration/SessionStatics.cs index 8f0a60b23d..1548b781a7 100644 --- a/osu.Game/Configuration/SessionStatics.cs +++ b/osu.Game/Configuration/SessionStatics.cs @@ -9,6 +9,7 @@ using osu.Game.Input; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; using osu.Game.Overlays.Mods; +using osu.Game.Scoring; namespace osu.Game.Configuration { @@ -27,6 +28,7 @@ namespace osu.Game.Configuration SetDefault(Static.LastModSelectPanelSamplePlaybackTime, (double?)null); SetDefault(Static.SeasonalBackgrounds, null); SetDefault(Static.TouchInputActive, RuntimeInfo.IsMobile); + SetDefault(Static.LastLocalUserScore, null); } /// @@ -73,5 +75,10 @@ namespace osu.Game.Configuration /// Used in touchscreen detection scenarios (). /// TouchInputActive, + + /// + /// Stores the local user's last score (can be completed or aborted). + /// + LastLocalUserScore, } } diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 7071bd380e..44795c6fa7 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -207,6 +207,7 @@ namespace osu.Game.Scoring clone.Statistics = new Dictionary(clone.Statistics); clone.MaximumStatistics = new Dictionary(clone.MaximumStatistics); + clone.HitEvents = new List(clone.HitEvents); // Ensure we have fresh mods to avoid any references (ie. after gameplay). clone.clearAllMods(); diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index f88526b8f9..ff2c57bf35 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -11,6 +11,7 @@ using osu.Framework.Allocation; using osu.Framework.Logging; using osu.Framework.Screens; using osu.Game.Beatmaps; +using osu.Game.Configuration; using osu.Game.Database; using osu.Game.Online.API; using osu.Game.Online.Multiplayer; @@ -37,6 +38,9 @@ namespace osu.Game.Screens.Play [Resolved] private SpectatorClient spectatorClient { get; set; } + [Resolved] + private SessionStatics statics { get; set; } + private TaskCompletionSource scoreSubmissionSource; protected SubmittingPlayer(PlayerConfiguration configuration = null) @@ -176,6 +180,7 @@ namespace osu.Game.Screens.Play { bool exiting = base.OnExiting(e); submitFromFailOrQuit(); + statics.SetValue(Static.LastLocalUserScore, Score.ScoreInfo.DeepClone()); return exiting; } From 1b7af989ec68e06b10c1a014e37c4a56f47cd1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 19:14:17 +0100 Subject: [PATCH 380/567] Migrate `BeatmapOffsetControl` to use session static directly --- .../Gameplay/TestSceneBeatmapOffsetControl.cs | 28 ++++++++++++++++--- osu.Game/Screens/Play/PlayerLoader.cs | 4 --- .../Play/PlayerSettings/AudioSettings.cs | 7 +++-- .../PlayerSettings/BeatmapOffsetControl.cs | 4 +++ 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs index f3701b664c..83fc5c2013 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs @@ -12,6 +12,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Scoring; using osu.Game.Screens.Play.PlayerSettings; +using osu.Game.Tests.Resources; using osu.Game.Tests.Visual.Ranking; namespace osu.Game.Tests.Visual.Gameplay @@ -44,7 +45,23 @@ namespace osu.Game.Tests.Visual.Gameplay { offsetControl.ReferenceScore.Value = new ScoreInfo { - HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(0, 2) + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(0, 2), + BeatmapInfo = Beatmap.Value.BeatmapInfo, + }; + }); + + AddAssert("No calibration button", () => !offsetControl.ChildrenOfType().Any()); + } + + [Test] + public void TestScoreFromDifferentBeatmap() + { + AddStep("Set short reference score", () => + { + offsetControl.ReferenceScore.Value = new ScoreInfo + { + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(10), + BeatmapInfo = TestResources.CreateTestBeatmapSetInfo().Beatmaps.First(), }; }); @@ -59,7 +76,8 @@ namespace osu.Game.Tests.Visual.Gameplay offsetControl.ReferenceScore.Value = new ScoreInfo { HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(10), - Mods = new Mod[] { new OsuModRelax() } + Mods = new Mod[] { new OsuModRelax() }, + BeatmapInfo = Beatmap.Value.BeatmapInfo, }; }); @@ -77,7 +95,8 @@ namespace osu.Game.Tests.Visual.Gameplay { offsetControl.ReferenceScore.Value = new ScoreInfo { - HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(average_error) + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(average_error), + BeatmapInfo = Beatmap.Value.BeatmapInfo, }; }); @@ -105,7 +124,8 @@ namespace osu.Game.Tests.Visual.Gameplay { offsetControl.ReferenceScore.Value = new ScoreInfo { - HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(average_error) + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(average_error), + BeatmapInfo = Beatmap.Value.BeatmapInfo, }; }); diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 681189d184..232de53ac3 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -263,10 +263,6 @@ namespace osu.Game.Screens.Play Debug.Assert(CurrentPlayer != null); - var lastScore = CurrentPlayer.Score; - - AudioSettings.ReferenceScore.Value = lastScore?.ScoreInfo; - // prepare for a retry. CurrentPlayer = null; playerConsumed = false; diff --git a/osu.Game/Screens/Play/PlayerSettings/AudioSettings.cs b/osu.Game/Screens/Play/PlayerSettings/AudioSettings.cs index 010d8115fa..3c79721590 100644 --- a/osu.Game/Screens/Play/PlayerSettings/AudioSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/AudioSettings.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { public partial class AudioSettings : PlayerSettingsGroup { - public Bindable ReferenceScore { get; } = new Bindable(); + private Bindable referenceScore { get; } = new Bindable(); private readonly PlayerCheckbox beatmapHitsoundsToggle; @@ -26,15 +26,16 @@ namespace osu.Game.Screens.Play.PlayerSettings beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapHitsounds }, new BeatmapOffsetControl { - ReferenceScore = { BindTarget = ReferenceScore }, + ReferenceScore = { BindTarget = referenceScore }, }, }; } [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(OsuConfigManager config, SessionStatics statics) { beatmapHitsoundsToggle.Current = config.GetBindable(OsuSetting.BeatmapHitsounds); + statics.BindWith(Static.LastLocalUserScore, referenceScore); } } } diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index b0e7d08699..3f0f0fd1df 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; @@ -174,6 +175,9 @@ namespace osu.Game.Screens.Play.PlayerSettings if (score.NewValue == null) return; + if (!score.NewValue.BeatmapInfo.AsNonNull().Equals(beatmap.Value.BeatmapInfo)) + return; + if (score.NewValue.Mods.Any(m => !m.UserPlayable || m is IHasNoTimedInputs)) return; From 70aa067eb166477f29b31495da6b1a8121a0bf8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 03:23:04 +0900 Subject: [PATCH 381/567] Adjust gradient visibility and transition --- osu.Game/Overlays/Toolbar/Toolbar.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index ec1238ad1f..52fad2ba3b 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -224,9 +224,9 @@ namespace osu.Game.Overlays.Toolbar RelativeSizeAxes = Axes.X, Anchor = Anchor.BottomLeft, Alpha = 0, - Height = 100, + Height = 80, Colour = ColourInfo.GradientVertical( - OsuColour.Gray(0).Opacity(0.9f), OsuColour.Gray(0).Opacity(0)), + OsuColour.Gray(0f).Opacity(0.7f), OsuColour.Gray(0).Opacity(0)), }, }; } @@ -241,9 +241,9 @@ namespace osu.Game.Overlays.Toolbar private void updateState() { if (ShowGradient.Value) - gradientBackground.FadeIn(transition_time, Easing.OutQuint); + gradientBackground.FadeIn(2500, Easing.OutQuint); else - gradientBackground.FadeOut(transition_time, Easing.OutQuint); + gradientBackground.FadeOut(200, Easing.OutQuint); } } From 92c4c20a51e544a27b745932334e6442d5d5d994 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 03:43:38 +0900 Subject: [PATCH 382/567] Adjust paddings and fills of toolbar buttons --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 45 ++++++++++--------- osu.Game/Overlays/Toolbar/ToolbarClock.cs | 34 +++++++++----- .../Toolbar/ToolbarOverlayToggleButton.cs | 2 +- .../Toolbar/ToolbarRulesetSelector.cs | 1 + .../Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 5 files changed, 51 insertions(+), 33 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index a547fda814..bd5faf1588 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; @@ -74,6 +73,8 @@ namespace osu.Game.Overlays.Toolbar private readonly SpriteText keyBindingTooltip; protected FillFlowContainer Flow; + protected readonly Container BackgroundContent; + [Resolved] private RealmAccess realm { get; set; } = null!; @@ -82,21 +83,33 @@ namespace osu.Game.Overlays.Toolbar Width = Toolbar.HEIGHT; RelativeSizeAxes = Axes.Y; + Padding = new MarginPadding(3); + Children = new Drawable[] { - HoverBackground = new Box + BackgroundContent = new Container { RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(80).Opacity(180), - Blending = BlendingParameters.Additive, - Alpha = 0, - }, - flashBackground = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - Colour = Color4.White.Opacity(100), - Blending = BlendingParameters.Additive, + Masking = true, + CornerRadius = 6, + CornerExponent = 3f, + Children = new Drawable[] + { + HoverBackground = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(80).Opacity(180), + Blending = BlendingParameters.Additive, + Alpha = 0, + }, + flashBackground = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + Colour = Color4.White.Opacity(100), + Blending = BlendingParameters.Additive, + }, + } }, Flow = new FillFlowContainer { @@ -219,14 +232,6 @@ namespace osu.Game.Overlays.Toolbar public OpaqueBackground() { RelativeSizeAxes = Axes.Both; - Masking = true; - MaskingSmoothness = 0; - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(40), - Radius = 5, - }; Children = new Drawable[] { diff --git a/osu.Game/Overlays/Toolbar/ToolbarClock.cs b/osu.Game/Overlays/Toolbar/ToolbarClock.cs index f1310d8535..67688155ae 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarClock.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarClock.cs @@ -42,21 +42,33 @@ namespace osu.Game.Overlays.Toolbar clockDisplayMode = config.GetBindable(OsuSetting.ToolbarClockDisplayMode); prefer24HourTime = config.GetBindable(OsuSetting.Prefer24HourTime); + Padding = new MarginPadding(3); + Children = new Drawable[] { - hoverBackground = new Box + new Container { RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(80).Opacity(180), - Blending = BlendingParameters.Additive, - Alpha = 0, - }, - flashBackground = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - Colour = Color4.White.Opacity(100), - Blending = BlendingParameters.Additive, + Masking = true, + CornerRadius = 6, + CornerExponent = 3f, + Children = new Drawable[] + { + hoverBackground = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(80).Opacity(180), + Blending = BlendingParameters.Additive, + Alpha = 0, + }, + flashBackground = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + Colour = Color4.White.Opacity(100), + Blending = BlendingParameters.Additive, + }, + } }, new FillFlowContainer { diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 78c976111b..37038161e1 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Toolbar public ToolbarOverlayToggleButton() { - Add(stateBackground = new Box + BackgroundContent.Add(stateBackground = new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(150).Opacity(180), diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index 715076b368..63d11c1b9e 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -41,6 +41,7 @@ namespace osu.Game.Overlays.Toolbar new OpaqueBackground { Depth = 1, + Masking = true, }, ModeButtonLine = new Container { diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 028decea1e..7d1b6c7404 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Toolbar [BackgroundDependencyLoader] private void load(OsuColour colours, IAPIProvider api, LoginOverlay? login) { - Add(new OpaqueBackground { Depth = 1 }); + BackgroundContent.Add(new OpaqueBackground { Depth = 1 }); Flow.Add(new Container { From cf5e3e886386737385fe75cf1642e75279c7ff16 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 04:06:29 +0900 Subject: [PATCH 383/567] Breathe some colour and life into the toolbar --- .../Toolbar/ToolbarOverlayToggleButton.cs | 8 ++-- .../Toolbar/ToolbarRulesetSelector.cs | 43 +++++++++---------- .../Toolbar/ToolbarRulesetTabButton.cs | 30 +++++++------ 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 37038161e1..09b8df14a6 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -3,6 +3,7 @@ #nullable disable +using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; @@ -14,7 +15,7 @@ namespace osu.Game.Overlays.Toolbar { public partial class ToolbarOverlayToggleButton : ToolbarButton { - private readonly Box stateBackground; + private Box stateBackground; private OverlayContainer stateContainer; @@ -44,12 +45,13 @@ namespace osu.Game.Overlays.Toolbar } } - public ToolbarOverlayToggleButton() + [BackgroundDependencyLoader] + private void load(OsuColour colours) { BackgroundContent.Add(stateBackground = new Box { RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(150).Opacity(180), + Colour = colours.Carmine.Opacity(180), Blending = BlendingParameters.Additive, Depth = 2, Alpha = 0, diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index 63d11c1b9e..723c24597a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -4,20 +4,19 @@ #nullable disable using System.Collections.Generic; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Effects; -using osuTK; -using osuTK.Graphics; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets; -using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input.Events; -using osuTK.Input; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input.Events; +using osu.Game.Rulesets; +using osuTK; +using osuTK.Graphics; +using osuTK.Input; namespace osu.Game.Overlays.Toolbar { @@ -47,20 +46,18 @@ namespace osu.Game.Overlays.Toolbar { Size = new Vector2(Toolbar.HEIGHT, 3), Anchor = Anchor.BottomLeft, - Origin = Anchor.TopLeft, - Masking = true, - EdgeEffect = new EdgeEffectParameters + Origin = Anchor.BottomLeft, + Y = -1, + Children = new Drawable[] { - Type = EdgeEffectType.Glow, - Colour = new Color4(255, 194, 224, 100), - Radius = 15, - Roundness = 15, - }, - Child = new Box - { - RelativeSizeAxes = Axes.Both, + new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(18, 3), + } } - } + }, }); foreach (var ruleset in Rulesets.AvailableRulesets) @@ -90,7 +87,7 @@ namespace osu.Game.Overlays.Toolbar { if (SelectedTab != null) { - ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint); + ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 500, Easing.OutElasticQuarter); if (hasInitialPosition) selectionSamples[SelectedTab.Value.ShortName]?.Play(); diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs index 74f76c7c89..5500f1c879 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetTabButton.cs @@ -1,14 +1,16 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; using osu.Game.Rulesets; -using osuTK.Graphics; namespace osu.Game.Overlays.Toolbar { @@ -41,27 +43,31 @@ namespace osu.Game.Overlays.Toolbar { protected override HoverSounds CreateHoverSounds(HoverSampleSet sampleSet) => new HoverSounds(); + [Resolved] + private OsuColour colours { get; set; } = null!; + + public RulesetButton() + { + Padding = new MarginPadding(3) + { + Bottom = 5 + }; + } + public bool Active { - set + set => Scheduler.AddOnce(() => { if (value) { - IconContainer.Colour = Color4.White; - IconContainer.EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Colour = new Color4(255, 194, 224, 100), - Radius = 15, - Roundness = 15, - }; + IconContainer.Colour = Color4Extensions.FromHex("#00FFAA"); } else { - IconContainer.Colour = new Color4(255, 194, 224, 255); + IconContainer.Colour = colours.GrayF; IconContainer.EdgeEffect = new EdgeEffectParameters(); } - } + }); } protected override bool OnClick(ClickEvent e) From f51b5f5487e770b783cc12513865eb1d5a3462d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 19:43:14 +0100 Subject: [PATCH 384/567] Add components to track average hit errors across session --- osu.Game/OsuGameBase.cs | 2 + .../Audio/AudioOffsetAdjustControl.cs | 23 ++++++++ .../Audio/SessionAverageHitErrorTracker.cs | 55 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs create mode 100644 osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 48548dc1ef..64f15efb15 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -55,6 +55,7 @@ using osu.Game.Online.Spectator; using osu.Game.Overlays; using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings.Sections; +using osu.Game.Overlays.Settings.Sections.Audio; using osu.Game.Overlays.Settings.Sections.Input; using osu.Game.Resources; using osu.Game.Rulesets; @@ -349,6 +350,7 @@ namespace osu.Game dependencies.CacheAs(powerStatus); dependencies.Cache(SessionStatics = new SessionStatics()); + dependencies.Cache(new SessionAverageHitErrorTracker()); dependencies.Cache(Colours = new OsuColour()); RegisterImportHandler(BeatmapManager); diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs new file mode 100644 index 0000000000..045cd24fc0 --- /dev/null +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -0,0 +1,23 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Overlays.Settings.Sections.Audio +{ + public partial class AudioOffsetAdjustControl : SettingsItem + { + [BackgroundDependencyLoader] + private void load() + { + } + + protected override Drawable CreateControl() => new AudioOffsetPreview(); + + private partial class AudioOffsetPreview : CompositeDrawable + { + } + } +} diff --git a/osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs b/osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs new file mode 100644 index 0000000000..b714d49b89 --- /dev/null +++ b/osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs @@ -0,0 +1,55 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Scoring; + +namespace osu.Game.Overlays.Settings.Sections.Audio +{ + /// + /// Tracks the local user's average hit error during the ongoing play session. + /// + [Cached] + public partial class SessionAverageHitErrorTracker : Component + { + public IBindableList AverageHitErrorHistory => averageHitErrorHistory; + private readonly BindableList averageHitErrorHistory = new BindableList(); + + private readonly Bindable latestScore = new Bindable(); + + [BackgroundDependencyLoader] + private void load(SessionStatics statics) + { + statics.BindWith(Static.LastLocalUserScore, latestScore); + latestScore.BindValueChanged(score => calculateAverageHitError(score.NewValue), true); + } + + private void calculateAverageHitError(ScoreInfo? newScore) + { + if (newScore == null) + return; + + if (newScore.Mods.Any(m => !m.UserPlayable || m is IHasNoTimedInputs)) + return; + + if (newScore.HitEvents.Count < 10) + return; + + if (newScore.HitEvents.CalculateAverageHitError() is not double averageError) + return; + + // keep a sane maximum number of entries. + if (averageHitErrorHistory.Count >= 50) + averageHitErrorHistory.RemoveAt(0); + averageHitErrorHistory.Add(averageError); + } + + public void ClearHistory() => averageHitErrorHistory.Clear(); + } +} From 160342ceed4824a3214157c049ff981e2710568f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 21:14:37 +0100 Subject: [PATCH 385/567] Implement automatic suggestion of audio offset based on last plays --- .../TestSceneAudioOffsetAdjustControl.cs | 63 ++++++++ osu.Game/OsuGameBase.cs | 5 +- .../Audio/AudioOffsetAdjustControl.cs | 138 +++++++++++++++++- .../Settings/Sections/Audio/OffsetSettings.cs | 5 +- 4 files changed, 205 insertions(+), 6 deletions(-) create mode 100644 osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs diff --git a/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs b/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs new file mode 100644 index 0000000000..efb65bb0a8 --- /dev/null +++ b/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs @@ -0,0 +1,63 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Utils; +using osu.Game.Configuration; +using osu.Game.Overlays.Settings.Sections.Audio; +using osu.Game.Scoring; +using osu.Game.Tests.Visual.Ranking; + +namespace osu.Game.Tests.Visual.Settings +{ + public partial class TestSceneAudioOffsetAdjustControl : OsuTestScene + { + [Resolved] + private SessionStatics statics { get; set; } = null!; + + [Cached] + private SessionAverageHitErrorTracker tracker = new SessionAverageHitErrorTracker(); + + private Container content = null!; + protected override Container Content => content; + + [BackgroundDependencyLoader] + private void load() + { + base.Content.AddRange(new Drawable[] + { + tracker, + content = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Width = 400, + AutoSizeAxes = Axes.Y + } + }); + } + + [Test] + public void TestBehaviour() + { + AddStep("create control", () => Child = new AudioOffsetAdjustControl + { + Current = new BindableDouble + { + MinValue = -500, + MaxValue = 500 + } + }); + AddStep("set new score", () => statics.SetValue(Static.LastLocalUserScore, new ScoreInfo + { + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(RNG.NextDouble(-100, 100)), + BeatmapInfo = Beatmap.Value.BeatmapInfo, + })); + AddStep("clear history", () => tracker.ClearHistory()); + } + } +} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 64f15efb15..0d8a2fbb97 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -201,6 +201,8 @@ namespace osu.Game private RulesetConfigCache rulesetConfigCache; + private SessionAverageHitErrorTracker hitErrorTracker; + protected SpectatorClient SpectatorClient { get; private set; } protected MultiplayerClient MultiplayerClient { get; private set; } @@ -350,7 +352,7 @@ namespace osu.Game dependencies.CacheAs(powerStatus); dependencies.Cache(SessionStatics = new SessionStatics()); - dependencies.Cache(new SessionAverageHitErrorTracker()); + dependencies.Cache(hitErrorTracker = new SessionAverageHitErrorTracker()); dependencies.Cache(Colours = new OsuColour()); RegisterImportHandler(BeatmapManager); @@ -410,6 +412,7 @@ namespace osu.Game }); base.Content.Add(new TouchInputInterceptor()); + base.Content.Add(hitErrorTracker); KeyBindingStore = new RealmKeyBindingStore(realm, keyCombinationProvider); KeyBindingStore.Register(globalBindings, RulesetStore.AvailableRulesets); diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index 045cd24fc0..0023c60c61 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -1,9 +1,23 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Collections.Specialized; +using System.Diagnostics; +using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; +using osu.Game.Graphics.UserInterfaceV2; +using osu.Game.Localisation; +using osuTK; namespace osu.Game.Overlays.Settings.Sections.Audio { @@ -12,12 +26,134 @@ namespace osu.Game.Overlays.Settings.Sections.Audio [BackgroundDependencyLoader] private void load() { + LabelText = AudioSettingsStrings.AudioOffset; } protected override Drawable CreateControl() => new AudioOffsetPreview(); - private partial class AudioOffsetPreview : CompositeDrawable + private partial class AudioOffsetPreview : CompositeDrawable, IHasCurrentValue { + public Bindable Current + { + get => current.Current; + set => current.Current = value; + } + + private readonly BindableNumberWithCurrent current = new BindableNumberWithCurrent(); + + private readonly IBindableList averageHitErrorHistory = new BindableList(); + + private readonly Bindable suggestedOffset = new Bindable(); + + private Container notchContainer = null!; + private TextFlowContainer hintText = null!; + private RoundedButton applySuggestion = null!; + + [BackgroundDependencyLoader] + private void load(SessionAverageHitErrorTracker hitErrorTracker) + { + averageHitErrorHistory.BindTo(hitErrorTracker.AverageHitErrorHistory); + + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + InternalChild = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(10), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new TimeSlider + { + RelativeSizeAxes = Axes.X, + Current = { BindTarget = Current }, + KeyboardStep = 1, + }, + notchContainer = new Container + { + RelativeSizeAxes = Axes.X, + Height = 10, + Padding = new MarginPadding { Horizontal = Nub.DEFAULT_EXPANDED_SIZE / 2 }, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + hintText = new OsuTextFlowContainer(t => t.Font = OsuFont.Default.With(size: 16)) + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + applySuggestion = new RoundedButton + { + RelativeSizeAxes = Axes.X, + Text = "Apply suggested offset", + Action = () => + { + if (suggestedOffset.Value.HasValue) + current.Value = suggestedOffset.Value.Value; + hitErrorTracker.ClearHistory(); + } + } + } + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + averageHitErrorHistory.BindCollectionChanged(updateDisplay, true); + suggestedOffset.BindValueChanged(_ => updateHintText(), true); + } + + private void updateDisplay(object? _, NotifyCollectionChangedEventArgs e) + { + switch (e.Action) + { + case NotifyCollectionChangedAction.Add: + foreach (double average in e.NewItems!) + { + notchContainer.ForEach(n => n.Alpha *= 0.95f); + notchContainer.Add(new Box + { + RelativeSizeAxes = Axes.Y, + Width = 2, + RelativePositionAxes = Axes.X, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + X = getXPositionForAverage(average) + }); + } + + break; + + case NotifyCollectionChangedAction.Remove: + foreach (double average in e.OldItems!) + { + var notch = notchContainer.FirstOrDefault(n => n.X == getXPositionForAverage(average)); + Debug.Assert(notch != null); + notchContainer.Remove(notch, true); + } + + break; + + case NotifyCollectionChangedAction.Reset: + notchContainer.Clear(); + break; + } + + suggestedOffset.Value = averageHitErrorHistory.Count < 3 ? null : -averageHitErrorHistory.Average(); + } + + private float getXPositionForAverage(double average) => (float)(Math.Clamp(-average, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); + + private void updateHintText() + { + hintText.Text = suggestedOffset.Value == null + ? @"Play a few beatmaps to receive a suggested offset!" + : $@"Based on the last {averageHitErrorHistory.Count} plays, the suggested offset is {suggestedOffset.Value:N0} ms."; + applySuggestion.Enabled.Value = suggestedOffset.Value != null; + } } } } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index 6b5c769853..af15d310fc 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -7,7 +7,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Configuration; -using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; namespace osu.Game.Overlays.Settings.Sections.Audio @@ -23,11 +22,9 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { Children = new Drawable[] { - new SettingsSlider + new AudioOffsetAdjustControl { - LabelText = AudioSettingsStrings.AudioOffset, Current = config.GetBindable(OsuSetting.AudioOffset), - KeyboardStep = 1f }, new SettingsButton { From cf39bb7a18877055a58324d542b9c4feb83d1611 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:55:20 -0800 Subject: [PATCH 386/567] Fix spinner max bonus not respecting ISamplePlaybackDisabler The spinner max bonus was loaded through SkinnableSound instead of PausableSkinnableSound, leading to it not respecting the case where sample playback is globally disabled through ISamplePlaybackDisabler, and can be easily heard in situations like during the catchup period after seeking using the ArgonSongProgressBar with song volume at 0 --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index f7c1437009..bf4b07eaab 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private const float spinning_sample_initial_frequency = 1.0f; private const float spinning_sample_modulated_base_frequency = 0.5f; - private SkinnableSound maxBonusSample; + private PausableSkinnableSound maxBonusSample; /// /// The amount of bonus score gained from spinning after the required number of spins, for display purposes. @@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Looping = true, Frequency = { Value = spinning_sample_initial_frequency } }, - maxBonusSample = new SkinnableSound + maxBonusSample = new PausableSkinnableSound { MinimumSampleVolume = MINIMUM_SAMPLE_VOLUME, } From d9299a8a55bff6757358db2d46b38806817f974a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 23:07:17 +0100 Subject: [PATCH 387/567] Implement visual appearance of "system title" message in main menu --- .../Visual/Menus/TestSceneMainMenu.cs | 30 ++++++ .../API/Requests/Responses/APISystemTitle.cs | 16 +++ osu.Game/OsuGame.cs | 5 +- osu.Game/Screens/Menu/MainMenu.cs | 15 +++ osu.Game/Screens/Menu/SystemTitle.cs | 101 ++++++++++++++++++ 5 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs create mode 100644 osu.Game/Online/API/Requests/Responses/APISystemTitle.cs create mode 100644 osu.Game/Screens/Menu/SystemTitle.cs diff --git a/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs new file mode 100644 index 0000000000..85aa14f33e --- /dev/null +++ b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs @@ -0,0 +1,30 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Linq; +using NUnit.Framework; +using osu.Framework.Testing; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual.Menus +{ + public partial class TestSceneMainMenu : OsuGameTestScene + { + [Test] + public void TestSystemTitle() + { + AddStep("set system title", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + { + Image = @"https://assets.ppy.sh/main-menu/project-loved-2@2x.png", + Url = @"https://osu.ppy.sh/home/news/2023-12-21-project-loved-december-2023", + }); + AddStep("set another title", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + { + Image = @"https://assets.ppy.sh/main-menu/wf2023-vote@2x.png", + Url = @"https://osu.ppy.sh/community/contests/189", + }); + AddStep("unset system title", () => Game.ChildrenOfType().Single().Current.Value = null); + } + } +} diff --git a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs new file mode 100644 index 0000000000..3a2342cc4c --- /dev/null +++ b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs @@ -0,0 +1,16 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using Newtonsoft.Json; + +namespace osu.Game.Online.API.Requests.Responses +{ + public class APISystemTitle + { + [JsonProperty(@"image")] + public string Image { get; set; } = string.Empty; + + [JsonProperty(@"url")] + public string Url { get; set; } = string.Empty; + } +} diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e7ff99ef01..37996e8832 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -995,7 +995,10 @@ namespace osu.Game }, topMostOverlayContent.Add); if (!args?.Any(a => a == @"--no-version-overlay") ?? true) - loadComponentSingleFile(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add); + { + dependencies.Cache(versionManager = new VersionManager { Depth = int.MinValue }); + loadComponentSingleFile(versionManager, ScreenContainer.Add); + } loadComponentSingleFile(osuLogo, _ => { diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index c25e62d69e..0739689daa 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -76,6 +76,9 @@ namespace osu.Game.Screens.Menu [Resolved(canBeNull: true)] private IDialogOverlay dialogOverlay { get; set; } + [Resolved(canBeNull: true)] + private VersionManager versionManager { get; set; } + protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); protected override bool PlayExitSound => false; @@ -91,6 +94,7 @@ namespace osu.Game.Screens.Menu private ParallaxContainer buttonsContainer; private SongTicker songTicker; private Container logoTarget; + private SystemTitle systemTitle; private Sample reappearSampleSwoosh; @@ -153,6 +157,7 @@ namespace osu.Game.Screens.Menu Margin = new MarginPadding { Right = 15, Top = 5 } }, new KiaiMenuFountains(), + systemTitle = new SystemTitle(), holdToExitGameOverlay?.CreateProxy() ?? Empty() }); @@ -263,6 +268,16 @@ namespace osu.Game.Screens.Menu } } + protected override void Update() + { + base.Update(); + + systemTitle.Margin = new MarginPadding + { + Bottom = (versionManager?.DrawHeight + 5) ?? 0 + }; + } + protected override void LogoSuspending(OsuLogo logo) { var seq = logo.FadeOut(300, Easing.InSine) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs new file mode 100644 index 0000000000..6ca9aab6c7 --- /dev/null +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -0,0 +1,101 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Threading; +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.Input.Events; +using osu.Framework.Platform; +using osu.Game.Online.API.Requests.Responses; + +namespace osu.Game.Screens.Menu +{ + public partial class SystemTitle : CompositeDrawable + { + internal Bindable Current { get; } = new Bindable(); + + private Container content = null!; + private CancellationTokenSource? cancellationTokenSource; + private SystemTitleImage? currentImage; + + [BackgroundDependencyLoader] + private void load(GameHost? gameHost) + { + Anchor = Anchor.BottomCentre; + Origin = Anchor.BottomCentre; + AutoSizeAxes = Axes.Both; + + InternalChild = content = new ClickableContainer + { + AutoSizeAxes = Axes.Both, + Action = () => + { + if (!string.IsNullOrEmpty(Current.Value?.Url)) + gameHost?.OpenUrlExternally(Current.Value.Url); + } + }; + } + + protected override bool OnHover(HoverEvent e) + { + content.ScaleTo(1.1f, 500, Easing.OutBounce); + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + content.ScaleTo(1f, 500, Easing.OutBounce); + base.OnHoverLost(e); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Current.BindValueChanged(_ => loadNewImage(), true); + } + + private void loadNewImage() + { + cancellationTokenSource?.Cancel(); + cancellationTokenSource = null; + currentImage?.FadeOut(500, Easing.OutQuint).Expire(); + + if (string.IsNullOrEmpty(Current.Value?.Image)) + return; + + LoadComponentAsync(new SystemTitleImage(Current.Value), loaded => + { + if (loaded.SystemTitle != Current.Value) + loaded.Dispose(); + + loaded.FadeInFromZero(500, Easing.OutQuint); + content.Add(currentImage = loaded); + }, (cancellationTokenSource ??= new CancellationTokenSource()).Token); + } + + [LongRunningLoad] + private partial class SystemTitleImage : Sprite + { + public readonly APISystemTitle SystemTitle; + + public SystemTitleImage(APISystemTitle systemTitle) + { + SystemTitle = systemTitle; + } + + [BackgroundDependencyLoader] + private void load(LargeTextureStore textureStore) + { + var texture = textureStore.Get(SystemTitle.Image); + if (SystemTitle.Image.Contains(@"@2x")) + texture.ScaleAdjust *= 2; + Texture = texture; + } + } + } +} From a3f720bc627f27d6bcc9fe36c011190010930b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 23:31:14 +0100 Subject: [PATCH 388/567] Retrieve system title from online source --- .../API/Requests/GetSystemTitleRequest.cs | 15 ++++++++++++ .../API/Requests/Responses/APISystemTitle.cs | 2 +- osu.Game/Screens/Menu/SystemTitle.cs | 23 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Online/API/Requests/GetSystemTitleRequest.cs diff --git a/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs b/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs new file mode 100644 index 0000000000..52ca0c11eb --- /dev/null +++ b/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Online.API.Requests.Responses; + +namespace osu.Game.Online.API.Requests +{ + public class GetSystemTitleRequest : OsuJsonWebRequest + { + public GetSystemTitleRequest() + : base(@"https://assets.ppy.sh/lazer-status.json") + { + } + } +} diff --git a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs index 3a2342cc4c..97bdc8355a 100644 --- a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs +++ b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json; namespace osu.Game.Online.API.Requests.Responses { - public class APISystemTitle + public record APISystemTitle { [JsonProperty(@"image")] public string Image { get; set; } = string.Empty; diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 6ca9aab6c7..0867fc4748 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -1,7 +1,9 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Threading; +using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -10,6 +12,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Framework.Platform; +using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Screens.Menu @@ -57,6 +60,26 @@ namespace osu.Game.Screens.Menu base.LoadComplete(); Current.BindValueChanged(_ => loadNewImage(), true); + + checkForUpdates(); + Scheduler.AddDelayed(checkForUpdates, TimeSpan.FromMinutes(15).TotalMilliseconds, true); + } + + private void checkForUpdates() + { + var request = new GetSystemTitleRequest(); + Task.Run(() => request.Perform()) + .ContinueWith(r => + { + if (r.IsCompletedSuccessfully) + Schedule(() => Current.Value = request.ResponseObject); + + // if the request failed, "observe" the exception. + // it isn't very important why this failed, as it's only for display. + // the inner error will be logged by framework mechanisms anyway. + if (r.IsFaulted) + _ = r.Exception; + }); } private void loadNewImage() From ac449131edcee95d9ca61fef538aeea7010c128d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 27 Dec 2023 23:47:37 +0100 Subject: [PATCH 389/567] CodeFileSanity does not like records in standalone files --- .../API/Requests/Responses/APISystemTitle.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs index 97bdc8355a..6d5d91f8f3 100644 --- a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs +++ b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs @@ -1,16 +1,29 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using Newtonsoft.Json; namespace osu.Game.Online.API.Requests.Responses { - public record APISystemTitle + public class APISystemTitle : IEquatable { [JsonProperty(@"image")] public string Image { get; set; } = string.Empty; [JsonProperty(@"url")] public string Url { get; set; } = string.Empty; + + public bool Equals(APISystemTitle? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return Image == other.Image && Url == other.Url; + } + + public override bool Equals(object? obj) => obj is APISystemTitle other && Equals(other); + + public override int GetHashCode() => HashCode.Combine(Image, Url); } } From ef3975981376e7308f4156024929f404f9240504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 00:09:51 +0100 Subject: [PATCH 390/567] More code quality inspections --- osu.Game/Online/API/Requests/Responses/APISystemTitle.cs | 1 + osu.Game/Screens/Menu/SystemTitle.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs index 6d5d91f8f3..bfa5c1043b 100644 --- a/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs +++ b/osu.Game/Online/API/Requests/Responses/APISystemTitle.cs @@ -24,6 +24,7 @@ namespace osu.Game.Online.API.Requests.Responses public override bool Equals(object? obj) => obj is APISystemTitle other && Equals(other); + // ReSharper disable NonReadonlyMemberInGetHashCode public override int GetHashCode() => HashCode.Combine(Image, Url); } } diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 0867fc4748..6b976a8ed6 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -93,7 +93,7 @@ namespace osu.Game.Screens.Menu LoadComponentAsync(new SystemTitleImage(Current.Value), loaded => { - if (loaded.SystemTitle != Current.Value) + if (!loaded.SystemTitle.Equals(Current.Value)) loaded.Dispose(); loaded.FadeInFromZero(500, Easing.OutQuint); From f8d6b8e347c18e2bf0bec85cdf76aac6f0f5d7a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 14:10:52 +0900 Subject: [PATCH 391/567] Adjust toolbar animations / layering to feel better --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index bd5faf1588..03a1cfc005 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -183,7 +183,7 @@ namespace osu.Game.Overlays.Toolbar protected override bool OnClick(ClickEvent e) { - flashBackground.FadeOutFromOne(800, Easing.OutQuint); + flashBackground.FadeIn(50).Then().FadeOutFromOne(800, Easing.OutQuint); tooltipContainer.FadeOut(100); return base.OnClick(e); } diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 09b8df14a6..06755a9da9 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -53,7 +53,7 @@ namespace osu.Game.Overlays.Toolbar RelativeSizeAxes = Axes.Both, Colour = colours.Carmine.Opacity(180), Blending = BlendingParameters.Additive, - Depth = 2, + Depth = float.MaxValue, Alpha = 0, }); @@ -65,11 +65,11 @@ namespace osu.Game.Overlays.Toolbar switch (state.NewValue) { case Visibility.Hidden: - stateBackground.FadeOut(200); + stateBackground.FadeOut(200, Easing.OutQuint); break; case Visibility.Visible: - stateBackground.FadeIn(200); + stateBackground.FadeIn(200, Easing.OutQuint); break; } } From ffc8778d673dd54a650066b9dc47d6252367da15 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 14:13:35 +0900 Subject: [PATCH 392/567] Fix song select leaderboard tab ordering not matching stable --- .../Select/Leaderboards/BeatmapLeaderboardScope.cs | 6 +++--- osu.Game/Screens/Select/PlayBeatmapDetailArea.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScope.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScope.cs index 5bcb4c27a7..e2e3404877 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScope.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScope.cs @@ -12,12 +12,12 @@ namespace osu.Game.Screens.Select.Leaderboards [Description("Local Ranking")] Local, - [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowScoreboardCountry))] - Country, - [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowScoreboardGlobal))] Global, + [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowScoreboardCountry))] + Country, + [LocalisableDescription(typeof(BeatmapsetsStrings), nameof(BeatmapsetsStrings.ShowScoreboardFriend))] Friend, } diff --git a/osu.Game/Screens/Select/PlayBeatmapDetailArea.cs b/osu.Game/Screens/Select/PlayBeatmapDetailArea.cs index 8a1b9ef3e1..deb1100dfc 100644 --- a/osu.Game/Screens/Select/PlayBeatmapDetailArea.cs +++ b/osu.Game/Screens/Select/PlayBeatmapDetailArea.cs @@ -80,8 +80,8 @@ namespace osu.Game.Screens.Select protected override BeatmapDetailAreaTabItem[] CreateTabItems() => base.CreateTabItems().Concat(new BeatmapDetailAreaTabItem[] { new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Local), - new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Country), new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Global), + new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Country), new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Friend), }).ToArray(); @@ -95,12 +95,12 @@ namespace osu.Game.Screens.Select case TabType.Local: return new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Local); - case TabType.Country: - return new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Country); - case TabType.Global: return new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Global); + case TabType.Country: + return new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Country); + case TabType.Friends: return new BeatmapDetailAreaLeaderboardTabItem(BeatmapLeaderboardScope.Friend); From 93a8afe96e101a63f65e6bcca92d9707c1fde767 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 14:40:10 +0900 Subject: [PATCH 393/567] Add very simple cache-busting (30 minutes) --- osu.Game/Online/API/Requests/GetSystemTitleRequest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs b/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs index 52ca0c11eb..659e46bb11 100644 --- a/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs +++ b/osu.Game/Online/API/Requests/GetSystemTitleRequest.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Online.API.Requests @@ -8,7 +9,7 @@ namespace osu.Game.Online.API.Requests public class GetSystemTitleRequest : OsuJsonWebRequest { public GetSystemTitleRequest() - : base(@"https://assets.ppy.sh/lazer-status.json") + : base($@"https://assets.ppy.sh/lazer-status.json?{DateTimeOffset.UtcNow.ToUnixTimeSeconds() / 1800}") { } } From c70e7d340da905d081eb87863ea9588021816453 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 14:48:17 +0900 Subject: [PATCH 394/567] Adjust animation and add delay to URL open --- osu.Game/Screens/Menu/SystemTitle.cs | 37 ++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 6b976a8ed6..2c8cb90b96 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -12,6 +12,8 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Framework.Platform; +using osu.Framework.Threading; +using osu.Game.Graphics.Containers; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; @@ -25,6 +27,8 @@ namespace osu.Game.Screens.Menu private CancellationTokenSource? cancellationTokenSource; private SystemTitleImage? currentImage; + private ScheduledDelegate? openUrlAction; + [BackgroundDependencyLoader] private void load(GameHost? gameHost) { @@ -32,29 +36,52 @@ namespace osu.Game.Screens.Menu Origin = Anchor.BottomCentre; AutoSizeAxes = Axes.Both; - InternalChild = content = new ClickableContainer + InternalChild = content = new OsuClickableContainer { AutoSizeAxes = Axes.Both, Action = () => { - if (!string.IsNullOrEmpty(Current.Value?.Url)) - gameHost?.OpenUrlExternally(Current.Value.Url); + // Delay slightly to allow animation to play out. + openUrlAction?.Cancel(); + openUrlAction = Scheduler.AddDelayed(() => + { + if (!string.IsNullOrEmpty(Current.Value?.Url)) + gameHost?.OpenUrlExternally(Current.Value.Url); + }, 250); } }; } protected override bool OnHover(HoverEvent e) { - content.ScaleTo(1.1f, 500, Easing.OutBounce); + content.ScaleTo(1.05f, 2000, Easing.OutQuint); return base.OnHover(e); } protected override void OnHoverLost(HoverLostEvent e) { - content.ScaleTo(1f, 500, Easing.OutBounce); + content.ScaleTo(1f, 500, Easing.OutQuint); base.OnHoverLost(e); } + protected override bool OnClick(ClickEvent e) + { + //hover.FlashColour(FlashColour, 800, Easing.OutQuint); + return base.OnClick(e); + } + + protected override bool OnMouseDown(MouseDownEvent e) + { + content.ScaleTo(0.95f, 500, Easing.OutQuint); + return base.OnMouseDown(e); + } + + protected override void OnMouseUp(MouseUpEvent e) + { + content.ScaleTo(1, 500, Easing.OutElastic); + base.OnMouseUp(e); + } + protected override void LoadComplete() { base.LoadComplete(); From 289e0f00f98ea570fd0a3f6b644b4399c0e4b5ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 14:58:05 +0900 Subject: [PATCH 395/567] Add flash on click --- osu.Game/Screens/Menu/SystemTitle.cs | 37 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 2c8cb90b96..667dc6e947 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -41,6 +41,8 @@ namespace osu.Game.Screens.Menu AutoSizeAxes = Axes.Both, Action = () => { + currentImage?.Flash(); + // Delay slightly to allow animation to play out. openUrlAction?.Cancel(); openUrlAction = Scheduler.AddDelayed(() => @@ -64,12 +66,6 @@ namespace osu.Game.Screens.Menu base.OnHoverLost(e); } - protected override bool OnClick(ClickEvent e) - { - //hover.FlashColour(FlashColour, 800, Easing.OutQuint); - return base.OnClick(e); - } - protected override bool OnMouseDown(MouseDownEvent e) { content.ScaleTo(0.95f, 500, Easing.OutQuint); @@ -78,7 +74,9 @@ namespace osu.Game.Screens.Menu protected override void OnMouseUp(MouseUpEvent e) { - content.ScaleTo(1, 500, Easing.OutElastic); + content + .ScaleTo(0.95f) + .ScaleTo(1, 500, Easing.OutElastic); base.OnMouseUp(e); } @@ -129,10 +127,12 @@ namespace osu.Game.Screens.Menu } [LongRunningLoad] - private partial class SystemTitleImage : Sprite + private partial class SystemTitleImage : CompositeDrawable { public readonly APISystemTitle SystemTitle; + private Sprite flash = null!; + public SystemTitleImage(APISystemTitle systemTitle) { SystemTitle = systemTitle; @@ -144,7 +144,26 @@ namespace osu.Game.Screens.Menu var texture = textureStore.Get(SystemTitle.Image); if (SystemTitle.Image.Contains(@"@2x")) texture.ScaleAdjust *= 2; - Texture = texture; + + AutoSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Sprite { Texture = texture }, + flash = new Sprite + { + Texture = texture, + Blending = BlendingParameters.Additive, + Alpha = 0, + }, + }; + } + + public void Flash() + { + flash.FadeInFromZero(50) + .Then() + .FadeOut(500, Easing.OutQuint); } } } From 481a25178658e80891a59bcdd7ad1720576854fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 15:10:05 +0900 Subject: [PATCH 396/567] Use `HandleLink` to allow potentially opening wiki or otherwise --- osu.Game/Screens/Menu/SystemTitle.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 667dc6e947..967b928b43 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; -using osu.Framework.Platform; using osu.Framework.Threading; using osu.Game.Graphics.Containers; using osu.Game.Online.API.Requests; @@ -30,7 +29,7 @@ namespace osu.Game.Screens.Menu private ScheduledDelegate? openUrlAction; [BackgroundDependencyLoader] - private void load(GameHost? gameHost) + private void load(OsuGame? game) { Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; @@ -48,7 +47,7 @@ namespace osu.Game.Screens.Menu openUrlAction = Scheduler.AddDelayed(() => { if (!string.IsNullOrEmpty(Current.Value?.Url)) - gameHost?.OpenUrlExternally(Current.Value.Url); + game?.HandleLink(Current.Value.Url); }, 250); } }; From 972234b1e5c1a505f23fe1491d509ab343636b4c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 15:12:44 +0900 Subject: [PATCH 397/567] Move re-schedule inside continuation --- osu.Game/Screens/Menu/SystemTitle.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 967b928b43..b8510dde87 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -86,7 +86,6 @@ namespace osu.Game.Screens.Menu Current.BindValueChanged(_ => loadNewImage(), true); checkForUpdates(); - Scheduler.AddDelayed(checkForUpdates, TimeSpan.FromMinutes(15).TotalMilliseconds, true); } private void checkForUpdates() @@ -103,6 +102,8 @@ namespace osu.Game.Screens.Menu // the inner error will be logged by framework mechanisms anyway. if (r.IsFaulted) _ = r.Exception; + + Scheduler.AddDelayed(checkForUpdates, TimeSpan.FromMinutes(15).TotalMilliseconds); }); } From 0ea62d0c5d52f98c19062e8baba5e225daea8c5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 15:16:42 +0900 Subject: [PATCH 398/567] Add initial additive blending on fade in --- osu.Game/Screens/Menu/SystemTitle.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index b8510dde87..8b243e8f7f 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -121,7 +121,6 @@ namespace osu.Game.Screens.Menu if (!loaded.SystemTitle.Equals(Current.Value)) loaded.Dispose(); - loaded.FadeInFromZero(500, Easing.OutQuint); content.Add(currentImage = loaded); }, (cancellationTokenSource ??= new CancellationTokenSource()).Token); } @@ -154,16 +153,25 @@ namespace osu.Game.Screens.Menu { Texture = texture, Blending = BlendingParameters.Additive, - Alpha = 0, }, }; } - public void Flash() + protected override void LoadComplete() + { + base.LoadComplete(); + + this.FadeInFromZero(500, Easing.OutQuint); + flash.FadeOutFromOne(4000, Easing.OutQuint); + } + + public Drawable Flash() { flash.FadeInFromZero(50) .Then() .FadeOut(500, Easing.OutQuint); + + return this; } } } From 6684987289a6dcbd0ab918cd9976909bead57dc1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 15:18:21 +0900 Subject: [PATCH 399/567] Reduce refresh interval slightly --- osu.Game/Screens/Menu/SystemTitle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 8b243e8f7f..bb623cacdf 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -103,7 +103,7 @@ namespace osu.Game.Screens.Menu if (r.IsFaulted) _ = r.Exception; - Scheduler.AddDelayed(checkForUpdates, TimeSpan.FromMinutes(15).TotalMilliseconds); + Scheduler.AddDelayed(checkForUpdates, TimeSpan.FromMinutes(5).TotalMilliseconds); }); } From a1867afbb43307ca775e56586bb6c86af038cc81 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 16:05:20 +0900 Subject: [PATCH 400/567] Move menu tips to main menu In preparation for removing the disclaimer screen. --- osu.Game/Configuration/OsuConfigManager.cs | 2 + osu.Game/Localisation/UserInterfaceStrings.cs | 7 +- .../UserInterface/MainMenuSettings.cs | 5 ++ osu.Game/Screens/Menu/Disclaimer.cs | 30 ------- osu.Game/Screens/Menu/MainMenu.cs | 38 +++++++- osu.Game/Screens/Menu/MenuTip.cs | 89 +++++++++++++++++++ osu.Game/Screens/Menu/SystemTitle.cs | 2 - 7 files changed, 138 insertions(+), 35 deletions(-) create mode 100644 osu.Game/Screens/Menu/MenuTip.cs diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 0df870655f..d4162b76d6 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -96,6 +96,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.MenuVoice, true); SetDefault(OsuSetting.MenuMusic, true); + SetDefault(OsuSetting.MenuTips, true); SetDefault(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1); @@ -350,6 +351,7 @@ namespace osu.Game.Configuration VolumeInactive, MenuMusic, MenuVoice, + MenuTips, CursorRotation, MenuParallax, Prefer24HourTime, diff --git a/osu.Game/Localisation/UserInterfaceStrings.cs b/osu.Game/Localisation/UserInterfaceStrings.cs index 68c5c3ccbc..dceedca05c 100644 --- a/osu.Game/Localisation/UserInterfaceStrings.cs +++ b/osu.Game/Localisation/UserInterfaceStrings.cs @@ -24,6 +24,11 @@ namespace osu.Game.Localisation /// public static LocalisableString MenuCursorSize => new TranslatableString(getKey(@"menu_cursor_size"), @"Menu cursor size"); + /// + /// "Menu tips" + /// + public static LocalisableString ShowMenuTips => new TranslatableString(getKey(@"show_menu_tips"), @"Menu tips"); + /// /// "Parallax" /// @@ -154,6 +159,6 @@ namespace osu.Game.Localisation /// public static LocalisableString TrueRandom => new TranslatableString(getKey(@"true_random"), @"True Random"); - private static string getKey(string key) => $"{prefix}:{key}"; + private static string getKey(string key) => $@"{prefix}:{key}"; } } diff --git a/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs index 4577fadb01..5e42c3035c 100644 --- a/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs @@ -29,6 +29,11 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface Children = new Drawable[] { + new SettingsCheckbox + { + LabelText = UserInterfaceStrings.ShowMenuTips, + Current = config.GetBindable(OsuSetting.MenuTips) + }, new SettingsCheckbox { LabelText = UserInterfaceStrings.InterfaceVoices, diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 539d58d2d7..1afef66313 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -12,7 +12,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; -using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online.API; @@ -122,10 +121,6 @@ namespace osu.Game.Screens.Menu textFlow.NewParagraph(); textFlow.NewParagraph(); - textFlow.AddParagraph("today's tip:", formatSemiBold); - textFlow.AddParagraph(getRandomTip(), formatRegular); - textFlow.NewParagraph(); - textFlow.NewParagraph(); iconColour = colours.Yellow; @@ -228,30 +223,5 @@ namespace osu.Game.Screens.Menu this.Push(nextScreen); }); } - - private string getRandomTip() - { - string[] tips = - { - "You can press Ctrl-T anywhere in the game to toggle the toolbar!", - "You can press Ctrl-O anywhere in the game to access options!", - "All settings are dynamic and take effect in real-time. Try pausing and changing the skin while playing!", - "New features are coming online every update. Make sure to stay up-to-date!", - "If you find the UI too large or small, try adjusting UI scale in settings!", - "Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!", - "What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!", - "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!", - "Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!", - "Try scrolling down in the mod select panel to find a bunch of new fun mods!", - "Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!", - "Get more details, hide or delete a beatmap by right-clicking on its panel at song select!", - "All delete operations are temporary until exiting. Restore accidentally deleted content from the maintenance settings!", - "Check out the \"playlists\" system, which lets users create their own custom and permanent leaderboards!", - "Toggle advanced frame / thread statistics with Ctrl-F11!", - "Take a look under the hood at performance counters and enable verbose performance logging with Ctrl-F2!", - }; - - return tips[RNG.Next(0, tips.Length)]; - } } } diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 0739689daa..cde7da53ce 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -95,6 +95,8 @@ namespace osu.Game.Screens.Menu private SongTicker songTicker; private Container logoTarget; private SystemTitle systemTitle; + private MenuTip menuTip; + private FillFlowContainer bottomElementsFlow; private Sample reappearSampleSwoosh; @@ -157,7 +159,27 @@ namespace osu.Game.Screens.Menu Margin = new MarginPadding { Right = 15, Top = 5 } }, new KiaiMenuFountains(), - systemTitle = new SystemTitle(), + bottomElementsFlow = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Spacing = new Vector2(15), + Children = new Drawable[] + { + menuTip = new MenuTip + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + systemTitle = new SystemTitle + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + } + } + }, holdToExitGameOverlay?.CreateProxy() ?? Empty() }); @@ -220,6 +242,8 @@ namespace osu.Game.Screens.Menu if (storage is OsuStorage osuStorage && osuStorage.Error != OsuStorageError.None) dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error)); + + menuTip.ShowNextTip(); } [CanBeNull] @@ -272,7 +296,7 @@ namespace osu.Game.Screens.Menu { base.Update(); - systemTitle.Margin = new MarginPadding + bottomElementsFlow.Margin = new MarginPadding { Bottom = (versionManager?.DrawHeight + 5) ?? 0 }; @@ -314,6 +338,10 @@ namespace osu.Game.Screens.Menu buttonsContainer.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine); sideFlashes.FadeOut(64, Easing.OutQuint); + + bottomElementsFlow + .ScaleTo(0.9f, 1000, Easing.OutQuint) + .FadeOut(500, Easing.OutQuint); } public override void OnResuming(ScreenTransitionEvent e) @@ -330,6 +358,12 @@ namespace osu.Game.Screens.Menu preloadSongSelect(); musicController.EnsurePlayingSomething(); + + menuTip.ShowNextTip(); + + bottomElementsFlow + .ScaleTo(1, 1000, Easing.OutQuint) + .FadeIn(1000, Easing.OutQuint); } public override bool OnExiting(ScreenExitEvent e) diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs new file mode 100644 index 0000000000..c9c8fea1c1 --- /dev/null +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -0,0 +1,89 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Utils; +using osu.Game.Configuration; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osuTK; + +namespace osu.Game.Screens.Menu +{ + public partial class MenuTip : CompositeDrawable + { + [Resolved] + private OsuConfigManager config { get; set; } = null!; + + private LinkFlowContainer textFlow = null!; + + [BackgroundDependencyLoader] + private void load() + { + AutoSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + textFlow = new LinkFlowContainer + { + Width = 700, + AutoSizeAxes = Axes.Y, + TextAnchor = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Spacing = new Vector2(0, 2), + }, + }; + } + + public void ShowNextTip() + { + if (!config.Get(OsuSetting.MenuTips)) return; + + static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular); + static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold); + + string tip = getRandomTip(); + + AutoSizeAxes = Axes.Both; + + textFlow.Clear(); + textFlow.AddParagraph("a tip for you:", formatSemiBold); + textFlow.AddParagraph(tip, formatRegular); + + this.FadeInFromZero(200, Easing.OutQuint) + .Delay(1000 + 80 * tip.Length) + .Then() + .FadeOutFromOne(2000, Easing.OutQuint) + .Finally(_ => AutoSizeAxes = Axes.X); + } + + private string getRandomTip() + { + string[] tips = + { + "You can press Ctrl-T anywhere in the game to toggle the toolbar!", + "You can press Ctrl-O anywhere in the game to access options!", + "All settings are dynamic and take effect in real-time. Try changing the skin while watching autoplay!", + "New features are coming online every update. Make sure to stay up-to-date!", + "If you find the UI too large or small, try adjusting UI scale in settings!", + "Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!", + "What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!", + "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!", + "Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!", + "Try scrolling down in the mod select panel to find a bunch of new fun mods!", + "Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!", + "Get more details, hide or delete a beatmap by right-clicking on its panel at song select!", + "All delete operations are temporary until exiting. Restore accidentally deleted content from the maintenance settings!", + "Check out the \"playlists\" system, which lets users create their own custom and permanent leaderboards!", + "Toggle advanced frame / thread statistics with Ctrl-F11!", + "Take a look under the hood at performance counters and enable verbose performance logging with Ctrl-F2!", + }; + + return tips[RNG.Next(0, tips.Length)]; + } + } +} diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index bb623cacdf..060e426f8c 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -31,8 +31,6 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(OsuGame? game) { - Anchor = Anchor.BottomCentre; - Origin = Anchor.BottomCentre; AutoSizeAxes = Axes.Both; InternalChild = content = new OsuClickableContainer From 222459d921f886a7dd621057752a94442bc703d6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 16:16:27 +0900 Subject: [PATCH 401/567] Add background and improve layout --- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/Menu/MenuTip.cs | 32 ++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index cde7da53ce..e8554d077b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -165,7 +165,7 @@ namespace osu.Game.Screens.Menu Direction = FillDirection.Vertical, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - Spacing = new Vector2(15), + Spacing = new Vector2(5), Children = new Drawable[] { menuTip = new MenuTip diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index c9c8fea1c1..ac23162bd0 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -4,12 +4,14 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Utils; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osuTK; +using osuTK.Graphics; namespace osu.Game.Screens.Menu { @@ -27,14 +29,29 @@ namespace osu.Game.Screens.Menu InternalChildren = new Drawable[] { + new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerExponent = 2.5f, + CornerRadius = 15, + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + Alpha = 0.4f, + }, + } + }, textFlow = new LinkFlowContainer { - Width = 700, + Width = 600, AutoSizeAxes = Axes.Y, TextAnchor = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, Spacing = new Vector2(0, 2), + Margin = new MarginPadding(10) }, }; } @@ -43,13 +60,11 @@ namespace osu.Game.Screens.Menu { if (!config.Get(OsuSetting.MenuTips)) return; - static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular); - static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold); + static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular); + static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold); string tip = getRandomTip(); - AutoSizeAxes = Axes.Both; - textFlow.Clear(); textFlow.AddParagraph("a tip for you:", formatSemiBold); textFlow.AddParagraph(tip, formatRegular); @@ -57,8 +72,7 @@ namespace osu.Game.Screens.Menu this.FadeInFromZero(200, Easing.OutQuint) .Delay(1000 + 80 * tip.Length) .Then() - .FadeOutFromOne(2000, Easing.OutQuint) - .Finally(_ => AutoSizeAxes = Axes.X); + .FadeOutFromOne(2000, Easing.OutQuint); } private string getRandomTip() From 932d03a4f8aebf8b76d43fad4c7b8ffa17e0ae95 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 16:19:12 +0900 Subject: [PATCH 402/567] Make toggle more immediately hide/show tips --- osu.Game/Screens/Menu/MainMenu.cs | 3 +-- osu.Game/Screens/Menu/MenuTip.cs | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index e8554d077b..e3fc69dc2f 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -242,8 +242,6 @@ namespace osu.Game.Screens.Menu if (storage is OsuStorage osuStorage && osuStorage.Error != OsuStorageError.None) dialogOverlay?.Push(new StorageErrorDialog(osuStorage, osuStorage.Error)); - - menuTip.ShowNextTip(); } [CanBeNull] @@ -359,6 +357,7 @@ namespace osu.Game.Screens.Menu musicController.EnsurePlayingSomething(); + // Cycle tip on resuming menuTip.ShowNextTip(); bottomElementsFlow diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index ac23162bd0..325fb07767 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -22,6 +23,8 @@ namespace osu.Game.Screens.Menu private LinkFlowContainer textFlow = null!; + private Bindable showMenuTips = null!; + [BackgroundDependencyLoader] private void load() { @@ -56,9 +59,21 @@ namespace osu.Game.Screens.Menu }; } + protected override void LoadComplete() + { + base.LoadComplete(); + + showMenuTips = config.GetBindable(OsuSetting.MenuTips); + showMenuTips.BindValueChanged(_ => ShowNextTip(), true); + } + public void ShowNextTip() { - if (!config.Get(OsuSetting.MenuTips)) return; + if (!showMenuTips.Value) + { + this.FadeOut(100, Easing.OutQuint); + return; + } static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular); static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold); From 0ad6ac8b2a2866d5b26cb044110122cd4702cd8b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 16:48:17 +0900 Subject: [PATCH 403/567] Remove unused variable --- osu.Game/Screens/Menu/MainMenu.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index e3fc69dc2f..a90d9151b5 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -94,7 +94,6 @@ namespace osu.Game.Screens.Menu private ParallaxContainer buttonsContainer; private SongTicker songTicker; private Container logoTarget; - private SystemTitle systemTitle; private MenuTip menuTip; private FillFlowContainer bottomElementsFlow; @@ -173,7 +172,7 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, - systemTitle = new SystemTitle + new SystemTitle { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, From b19f72481b5d3cd1ad81458601aca0404a09d8fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:19:41 +0900 Subject: [PATCH 404/567] Fade out quickly on game exit sequence --- osu.Game/Screens/Menu/MainMenu.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index a90d9151b5..bc19e9cb63 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -399,6 +399,10 @@ namespace osu.Game.Screens.Menu songTicker.Hide(); this.FadeOut(3000); + + bottomElementsFlow + .FadeOut(500, Easing.OutQuint); + return base.OnExiting(e); } From 1f2339244ef739341e3429d88678e512430a47d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:14:16 +0900 Subject: [PATCH 405/567] Add supporter display to main menu --- .../Visual/Menus/TestSceneSupporterDisplay.cs | 37 +++++ osu.Game/Screens/Menu/MainMenu.cs | 13 ++ osu.Game/Screens/Menu/SupporterDisplay.cs | 126 ++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 osu.Game.Tests/Visual/Menus/TestSceneSupporterDisplay.cs create mode 100644 osu.Game/Screens/Menu/SupporterDisplay.cs diff --git a/osu.Game.Tests/Visual/Menus/TestSceneSupporterDisplay.cs b/osu.Game.Tests/Visual/Menus/TestSceneSupporterDisplay.cs new file mode 100644 index 0000000000..8b18adbe0d --- /dev/null +++ b/osu.Game.Tests/Visual/Menus/TestSceneSupporterDisplay.cs @@ -0,0 +1,37 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual.Menus +{ + public partial class TestSceneSupporterDisplay : OsuTestScene + { + [Test] + public void TestBasic() + { + AddStep("create display", () => + { + Child = new SupporterDisplay + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; + }); + + AddStep("toggle support", () => + { + ((DummyAPIAccess)API).LocalUser.Value = new APIUser + { + Username = API.LocalUser.Value.Username, + Id = API.LocalUser.Value.Id + 1, + IsSupporter = !API.LocalUser.Value.IsSupporter, + }; + }); + } + } +} diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index bc19e9cb63..401460a498 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -96,6 +96,7 @@ namespace osu.Game.Screens.Menu private Container logoTarget; private MenuTip menuTip; private FillFlowContainer bottomElementsFlow; + private SupporterDisplay supporterDisplay; private Sample reappearSampleSwoosh; @@ -179,6 +180,12 @@ namespace osu.Game.Screens.Menu } } }, + supporterDisplay = new SupporterDisplay + { + Margin = new MarginPadding(5), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + }, holdToExitGameOverlay?.CreateProxy() ?? Empty() }); @@ -339,6 +346,9 @@ namespace osu.Game.Screens.Menu bottomElementsFlow .ScaleTo(0.9f, 1000, Easing.OutQuint) .FadeOut(500, Easing.OutQuint); + + supporterDisplay + .FadeOut(500, Easing.OutQuint); } public override void OnResuming(ScreenTransitionEvent e) @@ -403,6 +413,9 @@ namespace osu.Game.Screens.Menu bottomElementsFlow .FadeOut(500, Easing.OutQuint); + supporterDisplay + .FadeOut(500, Easing.OutQuint); + return base.OnExiting(e); } diff --git a/osu.Game/Screens/Menu/SupporterDisplay.cs b/osu.Game/Screens/Menu/SupporterDisplay.cs new file mode 100644 index 0000000000..d8ba21cd88 --- /dev/null +++ b/osu.Game/Screens/Menu/SupporterDisplay.cs @@ -0,0 +1,126 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests.Responses; +using osuTK; +using osuTK.Graphics; + +namespace osu.Game.Screens.Menu +{ + public partial class SupporterDisplay : CompositeDrawable + { + private LinkFlowContainer supportFlow = null!; + + private Drawable heart = null!; + + private readonly IBindable currentUser = new Bindable(); + + private Box backgroundBox = null!; + + [Resolved] + private IAPIProvider api { get; set; } = null!; + + [Resolved] + private OsuColour colours { get; set; } = null!; + + [BackgroundDependencyLoader] + private void load() + { + Height = 40; + + AutoSizeAxes = Axes.X; + AutoSizeDuration = 1000; + AutoSizeEasing = Easing.OutQuint; + + Masking = true; + CornerExponent = 2.5f; + CornerRadius = 15; + + InternalChildren = new Drawable[] + { + backgroundBox = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.4f, + }, + supportFlow = new LinkFlowContainer + { + AutoSizeAxes = Axes.Both, + Padding = new MarginPadding(10), + Spacing = new Vector2(0, 2), + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + const float font_size = 14; + + static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: font_size, weight: FontWeight.SemiBold); + + currentUser.BindTo(api.LocalUser); + currentUser.BindValueChanged(e => + { + supportFlow.Children.ForEach(d => d.FadeOut().Expire()); + + if (e.NewValue.IsSupporter) + { + supportFlow.AddText("Eternal thanks to you for supporting osu!", formatSemiBold); + + backgroundBox.FadeColour(colours.Pink, 250); + } + else + { + supportFlow.AddText("Consider becoming an ", formatSemiBold); + supportFlow.AddLink("osu!supporter", "https://osu.ppy.sh/home/support", formatSemiBold); + supportFlow.AddText(" to help support osu!'s development", formatSemiBold); + + backgroundBox.FadeColour(colours.Pink4, 250); + } + + supportFlow.AddIcon(FontAwesome.Solid.Heart, t => + { + heart = t; + + t.Padding = new MarginPadding { Left = 5, Top = 1 }; + t.Font = t.Font.With(size: font_size); + t.Origin = Anchor.Centre; + t.Colour = colours.Pink; + + Schedule(() => + { + heart?.FlashColour(Color4.White, 750, Easing.OutQuint).Loop(); + }); + }); + }, true); + + this + .FadeOut() + .Delay(1000) + .FadeInFromZero(800, Easing.OutQuint); + + Scheduler.AddDelayed(() => + { + AutoSizeEasing = Easing.In; + supportFlow.BypassAutoSizeAxes = Axes.X; + this + .Delay(200) + .FadeOut(750, Easing.Out); + }, 6000); + } + } +} From 7dc50b9baf5e6268c84b4177d3f6b14bbaa99514 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:18:47 +0900 Subject: [PATCH 406/567] Don't dismiss on hover, and allow dismissing via click --- osu.Game/Screens/Menu/SupporterDisplay.cs | 43 ++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/SupporterDisplay.cs b/osu.Game/Screens/Menu/SupporterDisplay.cs index d8ba21cd88..6639300f4a 100644 --- a/osu.Game/Screens/Menu/SupporterDisplay.cs +++ b/osu.Game/Screens/Menu/SupporterDisplay.cs @@ -8,6 +8,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Input.Events; +using osu.Framework.Threading; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online.API; @@ -113,8 +115,47 @@ namespace osu.Game.Screens.Menu .Delay(1000) .FadeInFromZero(800, Easing.OutQuint); - Scheduler.AddDelayed(() => + scheduleDismissal(); + } + + protected override bool OnClick(ClickEvent e) + { + dismissalDelegate?.Cancel(); + + supportFlow.BypassAutoSizeAxes = Axes.X; + this.FadeOut(500, Easing.OutQuint); + return base.OnClick(e); + } + + protected override bool OnHover(HoverEvent e) + { + backgroundBox.FadeTo(0.6f, 500, Easing.OutQuint); + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + backgroundBox.FadeTo(0.4f, 500, Easing.OutQuint); + base.OnHoverLost(e); + } + + private ScheduledDelegate? dismissalDelegate; + + private void scheduleDismissal() + { + dismissalDelegate?.Cancel(); + dismissalDelegate = Scheduler.AddDelayed(() => { + // If the user is hovering they may want to interact with the link. + // Give them more time. + if (IsHovered) + { + scheduleDismissal(); + return; + } + + dismissalDelegate?.Cancel(); + AutoSizeEasing = Easing.In; supportFlow.BypassAutoSizeAxes = Axes.X; this From bd0e2b4dde99cd20d990959ba52965cc73099977 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:21:29 +0900 Subject: [PATCH 407/567] Remove disclaimer screen completely --- .../Visual/Menus/TestSceneDisclaimer.cs | 29 --- osu.Game/Screens/Loader.cs | 13 +- osu.Game/Screens/Menu/Disclaimer.cs | 227 ------------------ 3 files changed, 2 insertions(+), 267 deletions(-) delete mode 100644 osu.Game.Tests/Visual/Menus/TestSceneDisclaimer.cs delete mode 100644 osu.Game/Screens/Menu/Disclaimer.cs diff --git a/osu.Game.Tests/Visual/Menus/TestSceneDisclaimer.cs b/osu.Game.Tests/Visual/Menus/TestSceneDisclaimer.cs deleted file mode 100644 index fb82b0df80..0000000000 --- a/osu.Game.Tests/Visual/Menus/TestSceneDisclaimer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Allocation; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests.Responses; -using osu.Game.Screens.Menu; - -namespace osu.Game.Tests.Visual.Menus -{ - public partial class TestSceneDisclaimer : ScreenTestScene - { - [BackgroundDependencyLoader] - private void load() - { - AddStep("load disclaimer", () => LoadScreen(new Disclaimer())); - - AddStep("toggle support", () => - { - ((DummyAPIAccess)API).LocalUser.Value = new APIUser - { - Username = API.LocalUser.Value.Username, - Id = API.LocalUser.Value.Id + 1, - IsSupporter = !API.LocalUser.Value.IsSupporter, - }; - }); - } - } -} diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 372cfe748e..4dba512cbd 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -21,8 +21,6 @@ namespace osu.Game.Screens { public partial class Loader : StartupScreen { - private bool showDisclaimer; - public Loader() { ValidForResume = false; @@ -35,13 +33,7 @@ namespace osu.Game.Screens private LoadingSpinner spinner; private ScheduledDelegate spinnerShow; - protected virtual OsuScreen CreateLoadableScreen() - { - if (showDisclaimer) - return new Disclaimer(getIntroSequence()); - - return getIntroSequence(); - } + protected virtual OsuScreen CreateLoadableScreen() => getIntroSequence(); private IntroScreen getIntroSequence() { @@ -107,9 +99,8 @@ namespace osu.Game.Screens } [BackgroundDependencyLoader] - private void load(OsuGameBase game, OsuConfigManager config) + private void load(OsuConfigManager config) { - showDisclaimer = game.IsDeployedBuild; introSequence = config.Get(OsuSetting.IntroSequence); } diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs deleted file mode 100644 index 1afef66313..0000000000 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -#nullable disable - -using System.Collections.Generic; -using System.Linq; -using osu.Framework.Allocation; -using osu.Framework.Bindables; -using osu.Framework.Extensions.IEnumerableExtensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Screens; -using osu.Game.Graphics; -using osu.Game.Graphics.Containers; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests.Responses; -using osuTK; -using osuTK.Graphics; - -namespace osu.Game.Screens.Menu -{ - public partial class Disclaimer : StartupScreen - { - private SpriteIcon icon; - private Color4 iconColour; - private LinkFlowContainer textFlow; - private LinkFlowContainer supportFlow; - - private Drawable heart; - - private const float icon_y = -85; - private const float icon_size = 30; - - private readonly OsuScreen nextScreen; - - private readonly Bindable currentUser = new Bindable(); - private FillFlowContainer fill; - - private readonly List expendableText = new List(); - - public Disclaimer(OsuScreen nextScreen = null) - { - this.nextScreen = nextScreen; - ValidForResume = false; - } - - [Resolved] - private IAPIProvider api { get; set; } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - InternalChildren = new Drawable[] - { - icon = new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Icon = OsuIcon.Logo, - Size = new Vector2(icon_size), - Y = icon_y, - }, - fill = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Y = icon_y, - Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, - Children = new Drawable[] - { - textFlow = new LinkFlowContainer - { - Width = 680, - AutoSizeAxes = Axes.Y, - TextAnchor = Anchor.TopCentre, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Spacing = new Vector2(0, 2), - }, - } - }, - supportFlow = new LinkFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - TextAnchor = Anchor.BottomCentre, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - Padding = new MarginPadding(20), - Alpha = 0, - Spacing = new Vector2(0, 2), - }, - }; - - textFlow.AddText("this is osu!", t => t.Font = t.Font.With(Typeface.Torus, 30, FontWeight.Regular)); - - expendableText.Add(textFlow.AddText("lazer", t => - { - t.Font = t.Font.With(Typeface.Torus, 30, FontWeight.Regular); - t.Colour = colours.PinkLight; - })); - - static void formatRegular(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Regular); - static void formatSemiBold(SpriteText t) => t.Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold); - - textFlow.NewParagraph(); - - textFlow.AddText("the next ", formatRegular); - textFlow.AddText("major update", t => - { - t.Font = t.Font.With(Typeface.Torus, 20, FontWeight.SemiBold); - t.Colour = colours.Pink; - }); - expendableText.Add(textFlow.AddText(" coming to osu!", formatRegular)); - textFlow.AddText(".", formatRegular); - - textFlow.NewParagraph(); - textFlow.NewParagraph(); - - textFlow.NewParagraph(); - - iconColour = colours.Yellow; - - // manually transfer the user once, but only do the final bind in LoadComplete to avoid thread woes (API scheduler could run while this screen is still loading). - // the manual transfer is here to ensure all text content is loaded ahead of time as this is very early in the game load process and we want to avoid stutters. - currentUser.Value = api.LocalUser.Value; - currentUser.BindValueChanged(e => - { - supportFlow.Children.ForEach(d => d.FadeOut().Expire()); - - if (e.NewValue.IsSupporter) - { - supportFlow.AddText("Eternal thanks to you for supporting osu!", formatSemiBold); - } - else - { - supportFlow.AddText("Consider becoming an ", formatSemiBold); - supportFlow.AddLink("osu!supporter", "https://osu.ppy.sh/home/support", formatSemiBold); - supportFlow.AddText(" to help support osu!'s development", formatSemiBold); - } - - supportFlow.AddIcon(FontAwesome.Solid.Heart, t => - { - heart = t; - - t.Padding = new MarginPadding { Left = 5, Top = 3 }; - t.Font = t.Font.With(size: 20); - t.Origin = Anchor.Centre; - t.Colour = colours.Pink; - - Schedule(() => heart?.FlashColour(Color4.White, 750, Easing.OutQuint).Loop()); - }); - - if (supportFlow.IsPresent) - supportFlow.FadeInFromZero(500); - }, true); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - if (nextScreen != null) - LoadComponentAsync(nextScreen); - - ((IBindable)currentUser).BindTo(api.LocalUser); - } - - public override void OnSuspending(ScreenTransitionEvent e) - { - base.OnSuspending(e); - - // Once this screen has finished being displayed, we don't want to unnecessarily handle user change events. - currentUser.UnbindAll(); - } - - public override void OnEntering(ScreenTransitionEvent e) - { - base.OnEntering(e); - - icon.RotateTo(10); - icon.FadeOut(); - icon.ScaleTo(0.5f); - - icon.Delay(500).FadeIn(500).ScaleTo(1, 500, Easing.OutQuint); - - using (BeginDelayedSequence(3000)) - { - icon.FadeColour(iconColour, 200, Easing.OutQuint); - icon.MoveToY(icon_y * 1.3f, 500, Easing.OutCirc) - .RotateTo(-360, 520, Easing.OutQuint) - .Then() - .MoveToY(icon_y, 160, Easing.InQuart) - .FadeColour(Color4.White, 160); - - using (BeginDelayedSequence(520 + 160)) - { - fill.MoveToOffset(new Vector2(0, 15), 160, Easing.OutQuart); - Schedule(() => expendableText.SelectMany(t => t.Drawables).ForEach(t => - { - t.FadeOut(100); - t.ScaleTo(new Vector2(0, 1), 100, Easing.OutQuart); - })); - } - } - - supportFlow.FadeOut().Delay(2000).FadeIn(500); - double delay = 500; - foreach (var c in textFlow.Children) - c.FadeTo(0.001f).Delay(delay += 20).FadeIn(500); - - this - .FadeInFromZero(500) - .Then(5500) - .FadeOut(250) - .ScaleTo(0.9f, 250, Easing.InQuint) - .Finally(_ => - { - if (nextScreen != null) - this.Push(nextScreen); - }); - } - } -} From 2ec9343868693f45f7650e2209271b157222d973 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:35:10 +0900 Subject: [PATCH 408/567] Add the ability to spectate a user by right clicking their user panel --- osu.Game/Localisation/ContextMenuStrings.cs | 9 +++-- osu.Game/Users/UserPanel.cs | 39 +++++++++++++-------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/osu.Game/Localisation/ContextMenuStrings.cs b/osu.Game/Localisation/ContextMenuStrings.cs index 029fba67d8..cb18a2159c 100644 --- a/osu.Game/Localisation/ContextMenuStrings.cs +++ b/osu.Game/Localisation/ContextMenuStrings.cs @@ -20,9 +20,14 @@ namespace osu.Game.Localisation public static LocalisableString ViewBeatmap => new TranslatableString(getKey(@"view_beatmap"), @"View beatmap"); /// - /// "Invite player" + /// "Invite to room" /// - public static LocalisableString InvitePlayer => new TranslatableString(getKey(@"invite_player"), @"Invite player"); + public static LocalisableString InvitePlayer => new TranslatableString(getKey(@"invite_player"), @"Invite to room"); + + /// + /// "Spectate" + /// + public static LocalisableString SpectatePlayer => new TranslatableString(getKey(@"spectate_player"), @"Spectate"); private static string getKey(string key) => $@"{prefix}:{key}"; } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 273faf9bd1..b6a77e754d 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -13,6 +13,7 @@ using osu.Game.Overlays; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; using osu.Framework.Graphics.Cursor; +using osu.Framework.Screens; using osu.Game.Graphics.Containers; using osu.Game.Online.API; using osu.Game.Online.API.Requests.Responses; @@ -20,6 +21,8 @@ using osu.Game.Online.Chat; using osu.Game.Resources.Localisation.Web; using osu.Game.Localisation; using osu.Game.Online.Multiplayer; +using osu.Game.Screens; +using osu.Game.Screens.Play; namespace osu.Game.Users { @@ -60,6 +63,9 @@ namespace osu.Game.Users [Resolved] protected OverlayColourProvider? ColourProvider { get; private set; } + [Resolved] + private IPerformFromScreenRunner? performer { get; set; } + [Resolved] protected OsuColour Colours { get; private set; } = null!; @@ -113,23 +119,26 @@ namespace osu.Game.Users new OsuMenuItem(ContextMenuStrings.ViewProfile, MenuItemType.Highlighted, ViewProfile) }; - if (!User.Equals(api.LocalUser.Value)) - { - items.Add(new OsuMenuItem(UsersStrings.CardSendMessage, MenuItemType.Standard, () => - { - channelManager?.OpenPrivateChannel(User); - chatOverlay?.Show(); - })); - } + if (User.Equals(api.LocalUser.Value)) + return items.ToArray(); - if ( - // TODO: uncomment this once lazer / osu-web is updating online states - // User.IsOnline && - multiplayerClient?.Room != null && - multiplayerClient.Room.Users.All(u => u.UserID != User.Id) - ) + items.Add(new OsuMenuItem(UsersStrings.CardSendMessage, MenuItemType.Standard, () => { - items.Add(new OsuMenuItem(ContextMenuStrings.InvitePlayer, MenuItemType.Standard, () => multiplayerClient.InvitePlayer(User.Id))); + channelManager?.OpenPrivateChannel(User); + chatOverlay?.Show(); + })); + + if (User.IsOnline) + { + items.Add(new OsuMenuItem(ContextMenuStrings.SpectatePlayer, MenuItemType.Standard, () => + { + performer?.PerformFromScreen(s => s.Push(new SoloSpectatorScreen(User))); + })); + + if (multiplayerClient?.Room?.Users.All(u => u.UserID != User.Id) == true) + { + items.Add(new OsuMenuItem(ContextMenuStrings.InvitePlayer, MenuItemType.Standard, () => multiplayerClient.InvitePlayer(User.Id))); + } } return items.ToArray(); From 22eced33006f959af2bc17198eafd46779a4923b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 17:40:07 +0900 Subject: [PATCH 409/567] Show local user in online users --- osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs index 37ea3f9c38..ee277ff538 100644 --- a/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs +++ b/osu.Game/Overlays/Dashboard/CurrentlyOnlineDisplay.cs @@ -131,9 +131,6 @@ namespace osu.Game.Overlays.Dashboard { int userId = kvp.Key; - if (userId == api.LocalUser.Value.Id) - continue; - users.GetUserAsync(userId).ContinueWith(task => { APIUser user = task.GetResultSafely(); From 28e220ca501592f854aab01b294981ca4d83154e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 19:04:19 +0900 Subject: [PATCH 410/567] Update popup dialog design Had to be done. I hated the old ones so much. As usual, disclaimer that this is an iterative design and will probably be replaced in the future. --- .../UserInterface/TestSceneDialogOverlay.cs | 19 ++--- .../Graphics/UserInterface/DialogButton.cs | 14 ++-- osu.Game/Overlays/Dialog/PopupDialog.cs | 77 +++++++++++-------- osu.Game/Overlays/DialogOverlay.cs | 12 +-- 4 files changed, 68 insertions(+), 54 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs index 81b692004b..3b38343f04 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs @@ -9,6 +9,7 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Overlays.Dialog; @@ -19,11 +20,15 @@ namespace osu.Game.Tests.Visual.UserInterface { private DialogOverlay overlay; + [SetUpSteps] + public void SetUpSteps() + { + AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay()); + } + [Test] public void TestBasic() { - AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay()); - TestPopupDialog firstDialog = null; TestPopupDialog secondDialog = null; @@ -84,7 +89,7 @@ namespace osu.Game.Tests.Visual.UserInterface })); AddAssert("second dialog displayed", () => overlay.CurrentDialog == secondDialog); - AddAssert("first dialog is not part of hierarchy", () => firstDialog.Parent == null); + AddUntilStep("first dialog is not part of hierarchy", () => firstDialog.Parent == null); } [Test] @@ -92,7 +97,7 @@ namespace osu.Game.Tests.Visual.UserInterface { PopupDialog dialog = null; - AddStep("create dialog overlay", () => overlay = new SlowLoadingDialogOverlay()); + AddStep("create slow loading dialog overlay", () => overlay = new SlowLoadingDialogOverlay()); AddStep("start loading overlay", () => LoadComponentAsync(overlay, Add)); @@ -128,8 +133,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestDismissBeforePush() { - AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay()); - TestPopupDialog testDialog = null; AddStep("dismissed dialog push", () => { @@ -146,8 +149,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestDismissBeforePushViaButtonPress() { - AddStep("create dialog overlay", () => Child = overlay = new DialogOverlay()); - TestPopupDialog testDialog = null; AddStep("dismissed dialog push", () => { @@ -163,7 +164,7 @@ namespace osu.Game.Tests.Visual.UserInterface }); AddAssert("no dialog pushed", () => overlay.CurrentDialog == null); - AddAssert("dialog is not part of hierarchy", () => testDialog.Parent == null); + AddUntilStep("dialog is not part of hierarchy", () => testDialog.Parent == null); } private partial class TestPopupDialog : PopupDialog diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index db81bc991d..c920597a95 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -25,7 +25,7 @@ namespace osu.Game.Graphics.UserInterface private const float idle_width = 0.8f; private const float hover_width = 0.9f; - private const float hover_duration = 500; + private const float hover_duration = 300; private const float click_duration = 200; public event Action? StateChanged; @@ -54,7 +54,7 @@ namespace osu.Game.Graphics.UserInterface private readonly Box rightGlow; private readonly Box background; private readonly SpriteText spriteText; - private Vector2 hoverSpacing => new Vector2(3f, 0f); + private Vector2 hoverSpacing => new Vector2(1.4f, 0f); public DialogButton(HoverSampleSet sampleSet = HoverSampleSet.Button) : base(sampleSet) @@ -279,15 +279,15 @@ namespace osu.Game.Graphics.UserInterface if (newState == SelectionState.Selected) { - spriteText.TransformSpacingTo(hoverSpacing, hover_duration, Easing.OutElastic); - ColourContainer.ResizeWidthTo(hover_width, hover_duration, Easing.OutElastic); + spriteText.TransformSpacingTo(hoverSpacing, hover_duration, Easing.OutQuint); + ColourContainer.ResizeWidthTo(hover_width, hover_duration, Easing.OutQuint); glowContainer.FadeIn(hover_duration, Easing.OutQuint); } else { - ColourContainer.ResizeWidthTo(idle_width, hover_duration, Easing.OutElastic); - spriteText.TransformSpacingTo(Vector2.Zero, hover_duration, Easing.OutElastic); - glowContainer.FadeOut(hover_duration, Easing.OutQuint); + ColourContainer.ResizeWidthTo(idle_width, hover_duration / 2, Easing.OutQuint); + spriteText.TransformSpacingTo(Vector2.Zero, hover_duration / 2, Easing.OutQuint); + glowContainer.FadeOut(hover_duration / 2, Easing.OutQuint); } } diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index 36a9baac67..663c2e78ce 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; using osu.Framework.Localisation; +using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; using osuTK; @@ -25,11 +26,10 @@ namespace osu.Game.Overlays.Dialog public abstract partial class PopupDialog : VisibilityContainer { public const float ENTER_DURATION = 500; - public const float EXIT_DURATION = 200; + public const float EXIT_DURATION = 500; private readonly Vector2 ringSize = new Vector2(100f); private readonly Vector2 ringMinifiedSize = new Vector2(20f); - private readonly Vector2 buttonsEnterSpacing = new Vector2(0f, 50f); private readonly Box flashLayer; private Sample flashSample = null!; @@ -108,13 +108,20 @@ namespace osu.Game.Overlays.Dialog protected PopupDialog() { - RelativeSizeAxes = Axes.Both; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + + Anchor = Anchor.Centre; + Origin = Anchor.Centre; Children = new Drawable[] { content = new Container { - RelativeSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Alpha = 0f, Children = new Drawable[] { @@ -122,11 +129,13 @@ namespace osu.Game.Overlays.Dialog { RelativeSizeAxes = Axes.Both, Masking = true, + CornerRadius = 20, + CornerExponent = 2.5f, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(0.5f), - Radius = 8, + Colour = Color4.Black.Opacity(0.2f), + Radius = 14, }, Children = new Drawable[] { @@ -142,23 +151,29 @@ namespace osu.Game.Overlays.Dialog ColourDark = Color4Extensions.FromHex(@"1e171e"), TriangleScale = 4, }, + flashLayer = new Box + { + Alpha = 0, + RelativeSizeAxes = Axes.Both, + Blending = BlendingParameters.Additive, + Colour = Color4Extensions.FromHex(@"221a21"), + }, }, }, new FillFlowContainer { - Anchor = Anchor.Centre, - Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0f, 10f), - Padding = new MarginPadding { Bottom = 10 }, + Padding = new MarginPadding { Vertical = 60 }, Children = new Drawable[] { new Container { Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, + Padding = new MarginPadding { Bottom = 30 }, Size = ringSize, Children = new Drawable[] { @@ -181,6 +196,7 @@ namespace osu.Game.Overlays.Dialog Origin = Anchor.Centre, Anchor = Anchor.Centre, Icon = FontAwesome.Solid.TimesCircle, + Y = -2, Size = new Vector2(50), }, }, @@ -202,25 +218,18 @@ namespace osu.Game.Overlays.Dialog TextAnchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Padding = new MarginPadding(5), + }, + buttonsContainer = new FillFlowContainer + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Padding = new MarginPadding { Top = 30 }, }, }, }, - buttonsContainer = new FillFlowContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - }, - flashLayer = new Box - { - Alpha = 0, - RelativeSizeAxes = Axes.Both, - Blending = BlendingParameters.Additive, - Colour = Color4Extensions.FromHex(@"221a21"), - }, }, }, }; @@ -231,7 +240,7 @@ namespace osu.Game.Overlays.Dialog } [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(AudioManager audio, OsuColour colours) { flashSample = audio.Samples.Get(@"UI/default-select-disabled"); } @@ -288,15 +297,15 @@ namespace osu.Game.Overlays.Dialog // Reset various animations but only if the dialog animation fully completed if (content.Alpha == 0) { - buttonsContainer.TransformSpacingTo(buttonsEnterSpacing); - buttonsContainer.MoveToY(buttonsEnterSpacing.Y); + content.ScaleTo(0.7f); ring.ResizeTo(ringMinifiedSize); } - content.FadeIn(ENTER_DURATION, Easing.OutQuint); - ring.ResizeTo(ringSize, ENTER_DURATION, Easing.OutQuint); - buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, Easing.OutQuint); - buttonsContainer.MoveToY(0, ENTER_DURATION, Easing.OutQuint); + content + .ScaleTo(1, 750, Easing.OutElasticHalf) + .FadeIn(ENTER_DURATION, Easing.OutQuint); + + ring.ResizeTo(ringSize, ENTER_DURATION * 1.5f, Easing.OutQuint); } protected override void PopOut() @@ -306,7 +315,9 @@ namespace osu.Game.Overlays.Dialog // This is presumed to always be a sane default "cancel" action. buttonsContainer.Last().TriggerClick(); - content.FadeOut(EXIT_DURATION, Easing.InSine); + content + .ScaleTo(0.7f, EXIT_DURATION, Easing.Out) + .FadeOut(EXIT_DURATION, Easing.OutQuint); } private void pressButtonAtIndex(int index) diff --git a/osu.Game/Overlays/DialogOverlay.cs b/osu.Game/Overlays/DialogOverlay.cs index 005162bbcc..a85f1ecbcd 100644 --- a/osu.Game/Overlays/DialogOverlay.cs +++ b/osu.Game/Overlays/DialogOverlay.cs @@ -29,16 +29,18 @@ namespace osu.Game.Overlays public DialogOverlay() { - RelativeSizeAxes = Axes.Both; + AutoSizeAxes = Axes.Y; Child = dialogContainer = new Container { - RelativeSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, }; - Width = 0.4f; - Anchor = Anchor.BottomCentre; - Origin = Anchor.BottomCentre; + Width = 500; + + Anchor = Anchor.Centre; + Origin = Anchor.Centre; } [BackgroundDependencyLoader] From b7f3c83514deec96959b51bcbb227ec0ee4f8801 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 20:01:29 +0900 Subject: [PATCH 411/567] Expose the ability to update global offset from the player loader screen --- osu.Game/Overlays/SettingsOverlay.cs | 29 +++++++++++++++---- .../PlayerSettings/BeatmapOffsetControl.cs | 19 ++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 5735b1515a..cf76ed8781 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -3,19 +3,21 @@ #nullable disable +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Localisation; +using osu.Framework.Testing; +using osu.Game.Graphics; +using osu.Game.Localisation; using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings.Sections; using osu.Game.Overlays.Settings.Sections.Input; using osuTK.Graphics; -using System.Collections.Generic; -using osu.Framework.Bindables; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Localisation; -using osu.Game.Graphics; -using osu.Game.Localisation; namespace osu.Game.Overlays { @@ -55,6 +57,21 @@ namespace osu.Game.Overlays public override bool AcceptsFocus => lastOpenedSubPanel == null || lastOpenedSubPanel.State.Value == Visibility.Hidden; + public void ShowAtControl() + where T : Drawable + { + Show(); + + // wait for load of sections + if (!SectionsContainer.Any()) + { + Scheduler.Add(ShowAtControl); + return; + } + + SectionsContainer.ScrollTo(SectionsContainer.ChildrenOfType().Single()); + } + private T createSubPanel(T subPanel) where T : SettingsSubPanel { diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index 3f0f0fd1df..8c6f1a8f7f 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -21,7 +21,9 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Input.Bindings; using osu.Game.Localisation; +using osu.Game.Overlays; using osu.Game.Overlays.Settings; +using osu.Game.Overlays.Settings.Sections.Audio; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; @@ -213,6 +215,8 @@ namespace osu.Game.Screens.Play.PlayerSettings lastPlayAverage = average; lastPlayBeatmapOffset = Current.Value; + LinkFlowContainer globalOffsetText; + referenceScoreContainer.AddRange(new Drawable[] { lastPlayGraph = new HitEventTimingDistributionGraph(hitEvents) @@ -226,9 +230,24 @@ namespace osu.Game.Screens.Play.PlayerSettings Text = BeatmapOffsetControlStrings.CalibrateUsingLastPlay, Action = () => Current.Value = lastPlayBeatmapOffset - lastPlayAverage }, + globalOffsetText = new LinkFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + } }); + + if (settings != null) + { + globalOffsetText.AddText("You can also "); + globalOffsetText.AddLink("adjust the global offset", () => settings.ShowAtControl()); + globalOffsetText.AddText(" based off this play."); + } } + [Resolved] + private SettingsOverlay? settings { get; set; } + protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); From 91af94086c6ba2905779c07ebb35dc011979993f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 20:02:06 +0900 Subject: [PATCH 412/567] Remove offset wizard button for now --- osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index af15d310fc..e05d20a5db 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { protected override LocalisableString Header => AudioSettingsStrings.OffsetHeader; - public override IEnumerable FilterTerms => base.FilterTerms.Concat(new LocalisableString[] { "universal", "uo", "timing", "delay", "latency" }); + public override IEnumerable FilterTerms => base.FilterTerms.Concat(new LocalisableString[] { "universal", "uo", "timing", "delay", "latency", "wizard" }); [BackgroundDependencyLoader] private void load(OsuConfigManager config) @@ -26,10 +26,6 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { Current = config.GetBindable(OsuSetting.AudioOffset), }, - new SettingsButton - { - Text = AudioSettingsStrings.OffsetWizard - } }; } } From e1a376c0a742d958399734683c8eb79631f37add Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 20:13:19 +0900 Subject: [PATCH 413/567] Fix using "Back" binding at spectator fail screen not working --- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 10 +++++++++- osu.Game/Screens/Play/PauseOverlay.cs | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 0680842891..440b8d37b9 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -44,7 +44,15 @@ namespace osu.Game.Screens.Play /// /// Action that is invoked when is triggered. /// - protected virtual Action BackAction => () => InternalButtons.LastOrDefault()?.TriggerClick(); + protected virtual Action BackAction => () => + { + // We prefer triggering the button click as it will animate... + // but sometimes buttons aren't present (see FailOverlay's constructor as an example). + if (Buttons.Any()) + Buttons.Last().TriggerClick(); + else + OnQuit?.Invoke(); + }; /// /// Action that is invoked when is triggered. diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index 88561ada71..2aa2793fd4 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -29,7 +29,13 @@ namespace osu.Game.Screens.Play private SkinnableSound pauseLoop; - protected override Action BackAction => () => InternalButtons.First().TriggerClick(); + protected override Action BackAction => () => + { + if (Buttons.Any()) + Buttons.First().TriggerClick(); + else + OnResume?.Invoke(); + }; [BackgroundDependencyLoader] private void load(OsuColour colours) From f8347288c1a5cdc5ab6587a49e3980075eec4872 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 20:29:56 +0900 Subject: [PATCH 414/567] Add padding around text in dialogs --- .../UserInterface/TestSceneDialogOverlay.cs | 24 +++++++++++++++++++ osu.Game/Overlays/Dialog/PopupDialog.cs | 2 ++ 2 files changed, 26 insertions(+) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs index 3b38343f04..f2313022ec 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneDialogOverlay.cs @@ -92,6 +92,30 @@ namespace osu.Game.Tests.Visual.UserInterface AddUntilStep("first dialog is not part of hierarchy", () => firstDialog.Parent == null); } + [Test] + public void TestTooMuchText() + { + AddStep("dialog #1", () => overlay.Push(new TestPopupDialog + { + Icon = FontAwesome.Regular.TrashAlt, + HeaderText = @"Confirm deletion ofConfirm deletion ofConfirm deletion ofConfirm deletion ofConfirm deletion ofConfirm deletion of", + BodyText = @"Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver.Ayase Rie - Yuima-ru*World TVver. ", + Buttons = new PopupDialogButton[] + { + new PopupDialogOkButton + { + Text = @"I never want to see this again.", + Action = () => Console.WriteLine(@"OK"), + }, + new PopupDialogCancelButton + { + Text = @"Firetruck, I still want quick ranks!", + Action = () => Console.WriteLine(@"Cancel"), + }, + }, + })); + } + [Test] public void TestPushBeforeLoad() { diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index 663c2e78ce..4048b35e78 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -210,6 +210,7 @@ namespace osu.Game.Overlays.Dialog RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, TextAnchor = Anchor.TopCentre, + Padding = new MarginPadding { Horizontal = 5 }, }, body = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 18)) { @@ -218,6 +219,7 @@ namespace osu.Game.Overlays.Dialog TextAnchor = Anchor.TopCentre, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Horizontal = 5 }, }, buttonsContainer = new FillFlowContainer { From 6bc0f02e2d46296fe2838cf97d57a3905d739928 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 28 Dec 2023 20:40:51 +0900 Subject: [PATCH 415/567] Fix test initialising dialogs without cleaning up --- .../Visual/UserInterface/TestScenePopupDialog.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs b/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs index 9537ab63be..37ff66aa35 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs @@ -1,10 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using NUnit.Framework; -using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Testing; using osu.Game.Overlays.Dialog; @@ -15,18 +12,17 @@ namespace osu.Game.Tests.Visual.UserInterface { public partial class TestScenePopupDialog : OsuManualInputManagerTestScene { - private TestPopupDialog dialog; + private TestPopupDialog dialog = null!; [SetUpSteps] public void SetUpSteps() { AddStep("new popup", () => { - Add(dialog = new TestPopupDialog + Child = dialog = new TestPopupDialog { - RelativeSizeAxes = Axes.Both, State = { Value = Framework.Graphics.Containers.Visibility.Visible }, - }); + }; }); } From bb0737837b537fd7d97f276e48aaae871f0abc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 13:58:00 +0100 Subject: [PATCH 416/567] Fix test failing due to querying button position during transform --- osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs b/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs index 37ff66aa35..96d19911bd 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestScenePopupDialog.cs @@ -29,6 +29,8 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] public void TestDangerousButton([Values(false, true)] bool atEdge) { + AddStep("finish transforms", () => dialog.FinishTransforms(true)); + if (atEdge) { AddStep("move mouse to button edge", () => From e6f1d7db4446e9e0c2308b5d17c937c65a4f7a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 14:10:03 +0100 Subject: [PATCH 417/567] Move `SessionAverageHitErrorTracker` to more general namespace --- .../Audio => Configuration}/SessionAverageHitErrorTracker.cs | 3 +-- .../Settings/Sections/Audio/AudioOffsetAdjustControl.cs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) rename osu.Game/{Overlays/Settings/Sections/Audio => Configuration}/SessionAverageHitErrorTracker.cs (95%) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs b/osu.Game/Configuration/SessionAverageHitErrorTracker.cs similarity index 95% rename from osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs rename to osu.Game/Configuration/SessionAverageHitErrorTracker.cs index b714d49b89..13b1ea7d37 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/SessionAverageHitErrorTracker.cs +++ b/osu.Game/Configuration/SessionAverageHitErrorTracker.cs @@ -5,12 +5,11 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Game.Configuration; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; -namespace osu.Game.Overlays.Settings.Sections.Audio +namespace osu.Game.Configuration { /// /// Tracks the local user's average hit error during the ongoing play session. diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index 0023c60c61..e10de58a6c 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; From 6718de01ecc7397f3804954f0c01aaa81d1fffdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 14:11:08 +0100 Subject: [PATCH 418/567] Suggest audio adjust after one play --- .../Settings/Sections/Audio/AudioOffsetAdjustControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index e10de58a6c..98acea1f2e 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -143,7 +143,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio break; } - suggestedOffset.Value = averageHitErrorHistory.Count < 3 ? null : -averageHitErrorHistory.Average(); + suggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average() : null; } private float getXPositionForAverage(double average) => (float)(Math.Clamp(-average, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); @@ -152,7 +152,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { hintText.Text = suggestedOffset.Value == null ? @"Play a few beatmaps to receive a suggested offset!" - : $@"Based on the last {averageHitErrorHistory.Count} plays, the suggested offset is {suggestedOffset.Value:N0} ms."; + : $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {suggestedOffset.Value:N0} ms."; applySuggestion.Enabled.Value = suggestedOffset.Value != null; } } From 619b0cc69b1998fdc8b1b1fcb69bcddaefc08004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 14:12:28 +0100 Subject: [PATCH 419/567] Fix code quality inspection --- .../Screens/Play/PlayerSettings/BeatmapOffsetControl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs index 8c6f1a8f7f..8efb80e771 100644 --- a/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs +++ b/osu.Game/Screens/Play/PlayerSettings/BeatmapOffsetControl.cs @@ -160,11 +160,11 @@ namespace osu.Game.Screens.Play.PlayerSettings // Apply to all difficulties in a beatmap set for now (they generally always share timing). foreach (var b in setInfo.Beatmaps) { - BeatmapUserSettings settings = b.UserSettings; + BeatmapUserSettings userSettings = b.UserSettings; double val = Current.Value; - if (settings.Offset != val) - settings.Offset = val; + if (userSettings.Offset != val) + userSettings.Offset = val; } }); } From 6d124513e7d88aba2849b5494783820eeb476777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 14:15:15 +0100 Subject: [PATCH 420/567] Fix test failures due to player bailing early after failing to load beatmap --- osu.Game/Screens/Play/SubmittingPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index ff2c57bf35..83adf1f960 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -180,7 +180,7 @@ namespace osu.Game.Screens.Play { bool exiting = base.OnExiting(e); submitFromFailOrQuit(); - statics.SetValue(Static.LastLocalUserScore, Score.ScoreInfo.DeepClone()); + statics.SetValue(Static.LastLocalUserScore, Score?.ScoreInfo.DeepClone()); return exiting; } From 93c7ebdae3f61e95e36cc61c014d71fb67e8a3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 14:30:11 +0100 Subject: [PATCH 421/567] Remove unused using --- osu.Game/OsuGameBase.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 90c88b2b33..4e465f59df 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -55,7 +55,6 @@ using osu.Game.Online.Spectator; using osu.Game.Overlays; using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings.Sections; -using osu.Game.Overlays.Settings.Sections.Audio; using osu.Game.Overlays.Settings.Sections.Input; using osu.Game.Resources; using osu.Game.Rulesets; From 68402bfd113b3c4051aead283fe3cf57d5b9ca78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 20:32:33 +0100 Subject: [PATCH 422/567] Add test coverage of failure scenario --- osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs index 85aa14f33e..46570e7cdf 100644 --- a/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs +++ b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs @@ -24,6 +24,11 @@ namespace osu.Game.Tests.Visual.Menus Image = @"https://assets.ppy.sh/main-menu/wf2023-vote@2x.png", Url = @"https://osu.ppy.sh/community/contests/189", }); + AddStep("set title with nonexistent image", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + { + Image = @"https://test.invalid/@2x", // .invalid TLD reserved by https://datatracker.ietf.org/doc/html/rfc2606#section-2 + Url = @"https://osu.ppy.sh/community/contests/189", + }); AddStep("unset system title", () => Game.ChildrenOfType().Single().Current.Value = null); } } From 7a10e132eaea162febb65d03baa16067a1244e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 28 Dec 2023 20:33:56 +0100 Subject: [PATCH 423/567] Fix crash when retrieval of system title image fails Closes https://github.com/ppy/osu/issues/26194. --- osu.Game/Screens/Menu/SystemTitle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 060e426f8c..7d49a1dd5f 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -138,8 +138,8 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(LargeTextureStore textureStore) { - var texture = textureStore.Get(SystemTitle.Image); - if (SystemTitle.Image.Contains(@"@2x")) + Texture? texture = textureStore.Get(SystemTitle.Image); + if (texture != null && SystemTitle.Image.Contains(@"@2x")) texture.ScaleAdjust *= 2; AutoSizeAxes = Axes.Both; From 637119f7d4ae7142d9cef29e8a2cd22000c95fb1 Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Thu, 28 Dec 2023 17:15:23 -0600 Subject: [PATCH 424/567] increase the base size of button icons --- osu.Game/Screens/Menu/MainMenuButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenuButton.cs b/osu.Game/Screens/Menu/MainMenuButton.cs index bc638b44ac..a9927541f1 100644 --- a/osu.Game/Screens/Menu/MainMenuButton.cs +++ b/osu.Game/Screens/Menu/MainMenuButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; @@ -125,7 +125,7 @@ namespace osu.Game.Screens.Menu Shadow = true, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(30), + Size = new Vector2(32), Position = new Vector2(0, 0), Icon = symbol }, From 4760c6aaee2bef3a47329158c612d9ea231d4e3b Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Thu, 28 Dec 2023 17:17:24 -0600 Subject: [PATCH 425/567] move icon upwards to be visually centered --- osu.Game/Screens/Menu/MainMenuButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenuButton.cs b/osu.Game/Screens/Menu/MainMenuButton.cs index a9927541f1..87136675a2 100644 --- a/osu.Game/Screens/Menu/MainMenuButton.cs +++ b/osu.Game/Screens/Menu/MainMenuButton.cs @@ -126,7 +126,7 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(32), - Position = new Vector2(0, 0), + Position = new Vector2(0, -4), Icon = symbol }, new OsuSpriteText @@ -186,7 +186,7 @@ namespace osu.Game.Screens.Menu { icon.ClearTransforms(); icon.RotateTo(0, 500, Easing.Out); - icon.MoveTo(Vector2.Zero, 500, Easing.Out); + icon.MoveTo(new Vector2(0, -4), 500, Easing.Out); icon.ScaleTo(Vector2.One, 200, Easing.Out); if (State == ButtonState.Expanded) From f1f1221e0e4f5e83f89b74df1c6e1b1c3ce4e04d Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Thu, 28 Dec 2023 17:18:41 -0600 Subject: [PATCH 426/567] move text left to be visually centered in the skewed rectangle --- osu.Game/Screens/Menu/MainMenuButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/MainMenuButton.cs b/osu.Game/Screens/Menu/MainMenuButton.cs index 87136675a2..69dbaa8ed8 100644 --- a/osu.Game/Screens/Menu/MainMenuButton.cs +++ b/osu.Game/Screens/Menu/MainMenuButton.cs @@ -135,7 +135,7 @@ namespace osu.Game.Screens.Menu AllowMultiline = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Position = new Vector2(0, 35), + Position = new Vector2(-3, 35), Text = text } } From 51d26d2d715f463a13b47d4692daac3d13a9319d Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Thu, 28 Dec 2023 17:20:44 -0600 Subject: [PATCH 427/567] make the hover scale bigger as a consequence, the rotation needs to be tweaked to be lower --- osu.Game/Screens/Menu/MainMenuButton.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenuButton.cs b/osu.Game/Screens/Menu/MainMenuButton.cs index 69dbaa8ed8..3d56a75ca8 100644 --- a/osu.Game/Screens/Menu/MainMenuButton.cs +++ b/osu.Game/Screens/Menu/MainMenuButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; @@ -31,6 +31,9 @@ namespace osu.Game.Screens.Menu /// public partial class MainMenuButton : BeatSyncedContainer, IStateful { + public const float BOUNCE_COMPRESSION = 0.9f; + public const float HOVER_SCALE = 1.2f; + public const float BOUNCE_ROTATION = 8; public event Action? StateChanged; public readonly Key[] TriggerKeys; @@ -153,14 +156,14 @@ namespace osu.Game.Screens.Menu double duration = timingPoint.BeatLength / 2; - icon.RotateTo(rightward ? 10 : -10, duration * 2, Easing.InOutSine); + icon.RotateTo(rightward ? BOUNCE_ROTATION : -BOUNCE_ROTATION, duration * 2, Easing.InOutSine); icon.Animate( i => i.MoveToY(-10, duration, Easing.Out), - i => i.ScaleTo(1, duration, Easing.Out) + i => i.ScaleTo(HOVER_SCALE, duration, Easing.Out) ).Then( i => i.MoveToY(0, duration, Easing.In), - i => i.ScaleTo(new Vector2(1, 0.9f), duration, Easing.In) + i => i.ScaleTo(new Vector2(HOVER_SCALE, HOVER_SCALE * BOUNCE_COMPRESSION), duration, Easing.In) ); rightward = !rightward; @@ -177,8 +180,8 @@ namespace osu.Game.Screens.Menu double duration = TimeUntilNextBeat; icon.ClearTransforms(); - icon.RotateTo(rightward ? -10 : 10, duration, Easing.InOutSine); - icon.ScaleTo(new Vector2(1, 0.9f), duration, Easing.Out); + icon.RotateTo(rightward ? -BOUNCE_ROTATION : BOUNCE_ROTATION, duration, Easing.InOutSine); + icon.ScaleTo(new Vector2(HOVER_SCALE, HOVER_SCALE * BOUNCE_COMPRESSION), duration, Easing.Out); return true; } From c68a850325e36b8585b2d60f25be81deef52565a Mon Sep 17 00:00:00 2001 From: Nitrous Date: Fri, 29 Dec 2023 08:51:54 +0800 Subject: [PATCH 428/567] Make menu tip about mod select more up to date. --- osu.Game/Screens/Menu/MenuTip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index 325fb07767..ab09c07e64 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -103,7 +103,7 @@ namespace osu.Game.Screens.Menu "What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!", "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!", "Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!", - "Try scrolling down in the mod select panel to find a bunch of new fun mods!", + "Try scrolling right in mod select to find a bunch of new fun mods!", "Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!", "Get more details, hide or delete a beatmap by right-clicking on its panel at song select!", "All delete operations are temporary until exiting. Restore accidentally deleted content from the maintenance settings!", From 150bf670649e61ac071796fa4056aa372ff9023b Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 29 Dec 2023 05:30:50 +0300 Subject: [PATCH 429/567] Fix dropdown colour not updating correctly on enabled state changes --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 632036fef9..c99a21ac28 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -363,6 +363,7 @@ namespace osu.Game.Graphics.UserInterface base.LoadComplete(); SearchBar.State.ValueChanged += _ => updateColour(); + Enabled.BindValueChanged(_ => updateColour()); updateColour(); } From c147ec0a98b22bec0a4635e1fc65cc32c5b34ddf Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 29 Dec 2023 05:31:13 +0300 Subject: [PATCH 430/567] Update dropdown disabled state to match with other components --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index c99a21ac28..2dc701dc9d 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -384,6 +384,9 @@ namespace osu.Game.Graphics.UserInterface var hoveredColour = colourProvider?.Light4 ?? colours.PinkDarker; var unhoveredColour = colourProvider?.Background5 ?? Color4.Black.Opacity(0.5f); + Colour = Color4.White; + Alpha = Enabled.Value ? 1 : 0.3f; + if (SearchBar.State.Value == Visibility.Visible) { Icon.Colour = hovered ? hoveredColour.Lighten(0.5f) : Colour4.White; From a6313c4ee8b78361d052304a3469fc9bf229edfb Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 29 Dec 2023 17:16:16 +0900 Subject: [PATCH 431/567] Expose `Mod.UsesDefaultConfiguration` --- osu.Game/Rulesets/Mods/Mod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index d635dccab1..0500b49513 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -195,7 +195,7 @@ namespace osu.Game.Rulesets.Mods /// /// Whether all settings in this mod are set to their default state. /// - protected virtual bool UsesDefaultConfiguration => SettingsBindables.All(s => s.IsDefault); + public virtual bool UsesDefaultConfiguration => SettingsBindables.All(s => s.IsDefault); /// /// Creates a copy of this initialised to a default state. From 9bb0663b3bb3b7f717a5cedbcd62a0051062eacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 10:36:52 +0100 Subject: [PATCH 432/567] Add test coverage of failure case --- .../Visual/Editing/TestSceneEditorBeatmapCreation.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs index 7a2ed23cae..db87987815 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs @@ -25,6 +25,7 @@ using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Taiko; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Screens.Edit; +using osu.Game.Screens.Edit.Compose.Components.Timeline; using osu.Game.Screens.Edit.Setup; using osu.Game.Storyboards; using osu.Game.Tests.Resources; @@ -94,8 +95,11 @@ namespace osu.Game.Tests.Visual.Editing [Test] public void TestAddAudioTrack() { - AddAssert("track is virtual", () => Beatmap.Value.Track is TrackVirtual); + AddStep("enter compose mode", () => InputManager.Key(Key.F1)); + AddUntilStep("wait for timeline load", () => Editor.ChildrenOfType().FirstOrDefault()?.IsLoaded == true); + AddStep("enter setup mode", () => InputManager.Key(Key.F4)); + AddAssert("track is virtual", () => Beatmap.Value.Track is TrackVirtual); AddAssert("switch track to real track", () => { var setup = Editor.ChildrenOfType().First(); From cd1f6b46c40639443c49cb03bc84289fcdd47f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 10:24:48 +0100 Subject: [PATCH 433/567] Fix crash after changing audio track in editor Closes https://github.com/ppy/osu/issues/26213. Reproduction scenario: switch audio track in editor after timeline loads. Happens because `beatmap.Value.Track.Length` is 0 immediately after a track switch, until BASS computes the actual track length on the audio thread. Yes this is a hack. No I have no better immediate ideas how to address this otherwise. --- .../Screens/Edit/Compose/Components/Timeline/Timeline.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs index 83d34ab61a..03a868b0f3 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs @@ -141,12 +141,13 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline waveformOpacity = config.GetBindable(OsuSetting.EditorWaveformOpacity); track.BindTo(editorClock.Track); - track.BindValueChanged(_ => + // schedule added as without it, `beatmap.Value.Track.Length` can be 0 immediately after a track switch. + track.BindValueChanged(_ => Schedule(() => { waveform.Waveform = beatmap.Value.Waveform; waveform.RelativePositionAxes = Axes.X; waveform.X = -(float)(Editor.WAVEFORM_VISUAL_OFFSET / beatmap.Value.Track.Length); - }, true); + }), true); Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom); } From 99cddb631702f2aebe23056424ae86428369a5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 11:07:45 +0100 Subject: [PATCH 434/567] Use alternative workaround --- .../Compose/Components/Timeline/Timeline.cs | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs index 03a868b0f3..a2704e550c 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs @@ -141,17 +141,29 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline waveformOpacity = config.GetBindable(OsuSetting.EditorWaveformOpacity); track.BindTo(editorClock.Track); - // schedule added as without it, `beatmap.Value.Track.Length` can be 0 immediately after a track switch. - track.BindValueChanged(_ => Schedule(() => + track.BindValueChanged(_ => { waveform.Waveform = beatmap.Value.Waveform; - waveform.RelativePositionAxes = Axes.X; - waveform.X = -(float)(Editor.WAVEFORM_VISUAL_OFFSET / beatmap.Value.Track.Length); - }), true); + Scheduler.AddOnce(applyVisualOffset, beatmap); + }, true); Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom); } + private void applyVisualOffset(IBindable beatmap) + { + waveform.RelativePositionAxes = Axes.X; + + if (beatmap.Value.Track.Length > 0) + waveform.X = -(float)(Editor.WAVEFORM_VISUAL_OFFSET / beatmap.Value.Track.Length); + else + { + // sometimes this can be the case immediately after a track switch. + // reschedule with the hope that the track length eventually populates. + Scheduler.AddOnce(applyVisualOffset, beatmap); + } + } + protected override void LoadComplete() { base.LoadComplete(); From 25fa76a1b2bbb8d96794466e28024842aff9e71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 11:14:28 +0100 Subject: [PATCH 435/567] Do not show main menu version display on deployed builds See https://discord.com/channels/188630481301012481/188630652340404224/1190028102525530202. --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 37996e8832..0d6eb1ea44 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -994,7 +994,7 @@ namespace osu.Game Margin = new MarginPadding(5), }, topMostOverlayContent.Add); - if (!args?.Any(a => a == @"--no-version-overlay") ?? true) + if (!IsDeployedBuild) { dependencies.Cache(versionManager = new VersionManager { Depth = int.MinValue }); loadComponentSingleFile(versionManager, ScreenContainer.Add); From db78d73fa511b647e45286e805a6ae7784ee4fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 11:50:30 +0100 Subject: [PATCH 436/567] Do not display system title in inital menu state Addresses https://github.com/ppy/osu/discussions/26199. --- osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs | 15 +++++++++++---- osu.Game/Screens/Menu/MainMenu.cs | 5 ++++- osu.Game/Screens/Menu/SystemTitle.cs | 12 +++++++++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs index 46570e7cdf..7053a9d544 100644 --- a/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs +++ b/osu.Game.Tests/Visual/Menus/TestSceneMainMenu.cs @@ -3,33 +3,40 @@ using System.Linq; using NUnit.Framework; +using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Game.Online.API.Requests.Responses; using osu.Game.Screens.Menu; +using osuTK.Input; namespace osu.Game.Tests.Visual.Menus { public partial class TestSceneMainMenu : OsuGameTestScene { + private SystemTitle systemTitle => Game.ChildrenOfType().Single(); + [Test] public void TestSystemTitle() { - AddStep("set system title", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + AddStep("set system title", () => systemTitle.Current.Value = new APISystemTitle { Image = @"https://assets.ppy.sh/main-menu/project-loved-2@2x.png", Url = @"https://osu.ppy.sh/home/news/2023-12-21-project-loved-december-2023", }); - AddStep("set another title", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + AddAssert("system title not visible", () => systemTitle.State.Value, () => Is.EqualTo(Visibility.Hidden)); + AddStep("enter menu", () => InputManager.Key(Key.Enter)); + AddUntilStep("system title visible", () => systemTitle.State.Value, () => Is.EqualTo(Visibility.Visible)); + AddStep("set another title", () => systemTitle.Current.Value = new APISystemTitle { Image = @"https://assets.ppy.sh/main-menu/wf2023-vote@2x.png", Url = @"https://osu.ppy.sh/community/contests/189", }); - AddStep("set title with nonexistent image", () => Game.ChildrenOfType().Single().Current.Value = new APISystemTitle + AddStep("set title with nonexistent image", () => systemTitle.Current.Value = new APISystemTitle { Image = @"https://test.invalid/@2x", // .invalid TLD reserved by https://datatracker.ietf.org/doc/html/rfc2606#section-2 Url = @"https://osu.ppy.sh/community/contests/189", }); - AddStep("unset system title", () => Game.ChildrenOfType().Single().Current.Value = null); + AddStep("unset system title", () => systemTitle.Current.Value = null); } } } diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 401460a498..516b090a16 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -94,6 +94,7 @@ namespace osu.Game.Screens.Menu private ParallaxContainer buttonsContainer; private SongTicker songTicker; private Container logoTarget; + private SystemTitle systemTitle; private MenuTip menuTip; private FillFlowContainer bottomElementsFlow; private SupporterDisplay supporterDisplay; @@ -173,7 +174,7 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, - new SystemTitle + systemTitle = new SystemTitle { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, @@ -196,10 +197,12 @@ namespace osu.Game.Screens.Menu case ButtonSystemState.Initial: case ButtonSystemState.Exit: ApplyToBackground(b => b.FadeColour(Color4.White, 500, Easing.OutSine)); + systemTitle.State.Value = Visibility.Hidden; break; default: ApplyToBackground(b => b.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine)); + systemTitle.State.Value = Visibility.Visible; break; } }; diff --git a/osu.Game/Screens/Menu/SystemTitle.cs b/osu.Game/Screens/Menu/SystemTitle.cs index 7d49a1dd5f..813a470ed6 100644 --- a/osu.Game/Screens/Menu/SystemTitle.cs +++ b/osu.Game/Screens/Menu/SystemTitle.cs @@ -18,10 +18,12 @@ using osu.Game.Online.API.Requests.Responses; namespace osu.Game.Screens.Menu { - public partial class SystemTitle : CompositeDrawable + public partial class SystemTitle : VisibilityContainer { internal Bindable Current { get; } = new Bindable(); + private const float transition_duration = 500; + private Container content = null!; private CancellationTokenSource? cancellationTokenSource; private SystemTitleImage? currentImage; @@ -32,9 +34,13 @@ namespace osu.Game.Screens.Menu private void load(OsuGame? game) { AutoSizeAxes = Axes.Both; + AutoSizeDuration = transition_duration; + AutoSizeEasing = Easing.OutQuint; InternalChild = content = new OsuClickableContainer { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Action = () => { @@ -51,6 +57,10 @@ namespace osu.Game.Screens.Menu }; } + protected override void PopIn() => content.FadeInFromZero(transition_duration, Easing.OutQuint); + + protected override void PopOut() => content.FadeOut(transition_duration, Easing.OutQuint); + protected override bool OnHover(HoverEvent e) { content.ScaleTo(1.05f, 2000, Easing.OutQuint); From cdcb3ef4aa7401243d6a97e151d9cc41cd284060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 12:20:14 +0100 Subject: [PATCH 437/567] Fix global audio offset suggestion feature not taking previous offset value into account See https://osu.ppy.sh/comments/2989193 etc. --- .../SessionAverageHitErrorTracker.cs | 25 ++++++++++++++++--- .../Audio/AudioOffsetAdjustControl.cs | 14 +++++------ 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/osu.Game/Configuration/SessionAverageHitErrorTracker.cs b/osu.Game/Configuration/SessionAverageHitErrorTracker.cs index 13b1ea7d37..cd21eb6fa8 100644 --- a/osu.Game/Configuration/SessionAverageHitErrorTracker.cs +++ b/osu.Game/Configuration/SessionAverageHitErrorTracker.cs @@ -17,11 +17,14 @@ namespace osu.Game.Configuration [Cached] public partial class SessionAverageHitErrorTracker : Component { - public IBindableList AverageHitErrorHistory => averageHitErrorHistory; - private readonly BindableList averageHitErrorHistory = new BindableList(); + public IBindableList AverageHitErrorHistory => averageHitErrorHistory; + private readonly BindableList averageHitErrorHistory = new BindableList(); private readonly Bindable latestScore = new Bindable(); + [Resolved] + private OsuConfigManager configManager { get; set; } = null!; + [BackgroundDependencyLoader] private void load(SessionStatics statics) { @@ -46,9 +49,25 @@ namespace osu.Game.Configuration // keep a sane maximum number of entries. if (averageHitErrorHistory.Count >= 50) averageHitErrorHistory.RemoveAt(0); - averageHitErrorHistory.Add(averageError); + + double globalOffset = configManager.Get(OsuSetting.AudioOffset); + averageHitErrorHistory.Add(new DataPoint(averageError, globalOffset)); } public void ClearHistory() => averageHitErrorHistory.Clear(); + + public readonly struct DataPoint + { + public double AverageHitError { get; } + public double GlobalAudioOffset { get; } + + public double SuggestedGlobalAudioOffset => GlobalAudioOffset - AverageHitError; + + public DataPoint(double averageHitError, double globalOffset) + { + AverageHitError = averageHitError; + GlobalAudioOffset = globalOffset; + } + } } } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index 98acea1f2e..08bf4b0dad 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio private readonly BindableNumberWithCurrent current = new BindableNumberWithCurrent(); - private readonly IBindableList averageHitErrorHistory = new BindableList(); + private readonly IBindableList averageHitErrorHistory = new BindableList(); private readonly Bindable suggestedOffset = new Bindable(); @@ -112,7 +112,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio switch (e.Action) { case NotifyCollectionChangedAction.Add: - foreach (double average in e.NewItems!) + foreach (SessionAverageHitErrorTracker.DataPoint dataPoint in e.NewItems!) { notchContainer.ForEach(n => n.Alpha *= 0.95f); notchContainer.Add(new Box @@ -122,16 +122,16 @@ namespace osu.Game.Overlays.Settings.Sections.Audio RelativePositionAxes = Axes.X, Anchor = Anchor.Centre, Origin = Anchor.Centre, - X = getXPositionForAverage(average) + X = getXPositionForOffset(dataPoint.SuggestedGlobalAudioOffset) }); } break; case NotifyCollectionChangedAction.Remove: - foreach (double average in e.OldItems!) + foreach (SessionAverageHitErrorTracker.DataPoint dataPoint in e.OldItems!) { - var notch = notchContainer.FirstOrDefault(n => n.X == getXPositionForAverage(average)); + var notch = notchContainer.FirstOrDefault(n => n.X == getXPositionForOffset(dataPoint.SuggestedGlobalAudioOffset)); Debug.Assert(notch != null); notchContainer.Remove(notch, true); } @@ -143,10 +143,10 @@ namespace osu.Game.Overlays.Settings.Sections.Audio break; } - suggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average() : null; + suggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average(dataPoint => dataPoint.SuggestedGlobalAudioOffset) : null; } - private float getXPositionForAverage(double average) => (float)(Math.Clamp(-average, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); + private float getXPositionForOffset(double offset) => (float)(Math.Clamp(offset, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); private void updateHintText() { From 17753b82356c4e4f51fb6e55dbff4e8b604c6ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Dec 2023 13:48:49 +0100 Subject: [PATCH 438/567] Remove opaque background from toolbar user button Would close https://github.com/ppy/osu/issues/26223, and generally seems more consistent with the rest of toolbar anyhow? --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 7d1b6c7404..19b98628e6 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -40,8 +40,6 @@ namespace osu.Game.Overlays.Toolbar [BackgroundDependencyLoader] private void load(OsuColour colours, IAPIProvider api, LoginOverlay? login) { - BackgroundContent.Add(new OpaqueBackground { Depth = 1 }); - Flow.Add(new Container { Masking = true, From d00b7c9cdf23b204f4843523dbd7a5ae0883faaa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 29 Dec 2023 22:14:51 +0900 Subject: [PATCH 439/567] Add some new menu tips (and reword some others) --- osu.Game/Screens/Menu/MenuTip.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index ab09c07e64..e31281ea20 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -94,14 +94,14 @@ namespace osu.Game.Screens.Menu { string[] tips = { - "You can press Ctrl-T anywhere in the game to toggle the toolbar!", - "You can press Ctrl-O anywhere in the game to access options!", + "Press Ctrl-T anywhere in the game to toggle the toolbar!", + "Press Ctrl-O anywhere in the game to access options!", "All settings are dynamic and take effect in real-time. Try changing the skin while watching autoplay!", "New features are coming online every update. Make sure to stay up-to-date!", "If you find the UI too large or small, try adjusting UI scale in settings!", "Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!", "What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!", - "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen!", + "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen or by using the left and right arrow keys!", "Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!", "Try scrolling right in mod select to find a bunch of new fun mods!", "Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!", @@ -110,6 +110,18 @@ namespace osu.Game.Screens.Menu "Check out the \"playlists\" system, which lets users create their own custom and permanent leaderboards!", "Toggle advanced frame / thread statistics with Ctrl-F11!", "Take a look under the hood at performance counters and enable verbose performance logging with Ctrl-F2!", + "You can pause during a replay by pressing Space!", + "Most of the hotkeys in the game are configurable and can be changed to anything you want. Check the bindings panel under input settings!", + "When your gameplay HUD is hidden, you can press and hold Ctrl to view it temporarily!", + "Your gameplay HUD can be customized by using the skin layout editor. Open at any time via Ctrl-Shift-S!", + "Drag and drop any image into the skin editor to load it in quickly!", + "You can create mod presets to make toggling your favorite mod combinations easier!", + "Many mods have customisation settings that drastically change how they function. Click the Mod Customisation button in mod select to view settings!", + "Press Ctrl-Shift-R to switch to a random skin!", + "Press Ctrl-Shift-F to toggle the FPS Counter. But make sure not to pay too much attention to it!", + "While watching a reply replay, press Ctrl-H to toggle replay settings!", + "You can easily copy the mods from scores on a leaderboard by right-clicking on them!", + "Ctrl-Enter at song select will start a beatmap in autoplay mode!" }; return tips[RNG.Next(0, tips.Length)]; From 9f0fe6c6cab17dc1395e6874e57bf29a58b39a8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 29 Dec 2023 22:20:29 +0900 Subject: [PATCH 440/567] Fix common typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartłomiej Dach --- osu.Game/Screens/Menu/MenuTip.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index e31281ea20..0f250768f1 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -113,13 +113,13 @@ namespace osu.Game.Screens.Menu "You can pause during a replay by pressing Space!", "Most of the hotkeys in the game are configurable and can be changed to anything you want. Check the bindings panel under input settings!", "When your gameplay HUD is hidden, you can press and hold Ctrl to view it temporarily!", - "Your gameplay HUD can be customized by using the skin layout editor. Open at any time via Ctrl-Shift-S!", + "Your gameplay HUD can be customized by using the skin layout editor. Open it at any time via Ctrl-Shift-S!", "Drag and drop any image into the skin editor to load it in quickly!", "You can create mod presets to make toggling your favorite mod combinations easier!", "Many mods have customisation settings that drastically change how they function. Click the Mod Customisation button in mod select to view settings!", "Press Ctrl-Shift-R to switch to a random skin!", "Press Ctrl-Shift-F to toggle the FPS Counter. But make sure not to pay too much attention to it!", - "While watching a reply replay, press Ctrl-H to toggle replay settings!", + "While watching a replay, press Ctrl-H to toggle replay settings!", "You can easily copy the mods from scores on a leaderboard by right-clicking on them!", "Ctrl-Enter at song select will start a beatmap in autoplay mode!" }; From 61c46b78bd380189944107782533915f9ec37995 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 29 Dec 2023 22:24:16 +0900 Subject: [PATCH 441/567] Update MenuTip.cs Co-authored-by: Salman Ahmed --- osu.Game/Screens/Menu/MenuTip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/MenuTip.cs b/osu.Game/Screens/Menu/MenuTip.cs index 0f250768f1..da349373c3 100644 --- a/osu.Game/Screens/Menu/MenuTip.cs +++ b/osu.Game/Screens/Menu/MenuTip.cs @@ -101,7 +101,7 @@ namespace osu.Game.Screens.Menu "If you find the UI too large or small, try adjusting UI scale in settings!", "Try adjusting the \"Screen Scaling\" mode to change your gameplay or UI area, even in fullscreen!", "What used to be \"osu!direct\" is available to all users just like on the website. You can access it anywhere using Ctrl-B!", - "Seeking in replays is available by dragging on the difficulty bar at the bottom of the screen or by using the left and right arrow keys!", + "Seeking in replays is available by dragging on the progress bar at the bottom of the screen or by using the left and right arrow keys!", "Multithreading support means that even with low \"FPS\" your input and judgements will be accurate!", "Try scrolling right in mod select to find a bunch of new fun mods!", "Most of the web content (profiles, rankings, etc.) are available natively in-game from the icons on the toolbar!", From 8df9a1ee1f8b8253e1438909f245aa709bd0be46 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 29 Dec 2023 20:43:00 +0300 Subject: [PATCH 442/567] Fix argon miss judgement on mania placed on a different position --- osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs index 4ce3c50f7c..6b1d8a7fcd 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs @@ -76,7 +76,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); - this.MoveTo(Vector2.Zero); this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); this.RotateTo(0); From 08d88ec2fa94b8d6e855246e40d7eb23e632773a Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Fri, 29 Dec 2023 20:47:18 +0300 Subject: [PATCH 443/567] Add back initial position transform to ensure correctness --- .../Skinning/Argon/ArgonJudgementPiece.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs index 6b1d8a7fcd..a191dee1ca 100644 --- a/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs +++ b/osu.Game.Rulesets.Mania/Skinning/Argon/ArgonJudgementPiece.cs @@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon { public partial class ArgonJudgementPiece : JudgementPiece, IAnimatableJudgement { + private const float judgement_y_position = 160; + private RingExplosion? ringExplosion; [Resolved] @@ -30,7 +32,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; - Y = 160; + Y = judgement_y_position; } [BackgroundDependencyLoader] @@ -76,6 +78,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon this.ScaleTo(1.6f); this.ScaleTo(1, 100, Easing.In); + this.MoveToY(judgement_y_position); this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint); this.RotateTo(0); From 807443b6481223fc14574b6c0829e4f197dee6cb Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 30 Dec 2023 10:21:59 +0900 Subject: [PATCH 444/567] Add HitResult.SliderTailHit --- .../Rulesets/Scoring/ScoreProcessorTest.cs | 8 ++++++++ osu.Game/Rulesets/Judgements/Judgement.cs | 2 ++ osu.Game/Rulesets/Scoring/HitResult.cs | 15 +++++++++++++++ osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 3 +++ 4 files changed, 28 insertions(+) diff --git a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs index d883b91abc..567bf6968f 100644 --- a/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs +++ b/osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs @@ -84,6 +84,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(ScoringMode.Standardised, HitResult.SmallTickHit, HitResult.SmallTickHit, 493_652)] [TestCase(ScoringMode.Standardised, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] [TestCase(ScoringMode.Standardised, HitResult.LargeTickHit, HitResult.LargeTickHit, 326_963)] + [TestCase(ScoringMode.Standardised, HitResult.SliderTailHit, HitResult.SliderTailHit, 326_963)] [TestCase(ScoringMode.Standardised, HitResult.SmallBonus, HitResult.SmallBonus, 1_000_030)] [TestCase(ScoringMode.Standardised, HitResult.LargeBonus, HitResult.LargeBonus, 1_000_150)] [TestCase(ScoringMode.Classic, HitResult.Miss, HitResult.Great, 0)] @@ -96,6 +97,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(ScoringMode.Classic, HitResult.SmallTickHit, HitResult.SmallTickHit, 49_365)] [TestCase(ScoringMode.Classic, HitResult.LargeTickMiss, HitResult.LargeTickHit, 0)] [TestCase(ScoringMode.Classic, HitResult.LargeTickHit, HitResult.LargeTickHit, 32_696)] + [TestCase(ScoringMode.Classic, HitResult.SliderTailHit, HitResult.SliderTailHit, 32_696)] [TestCase(ScoringMode.Classic, HitResult.SmallBonus, HitResult.SmallBonus, 100_003)] [TestCase(ScoringMode.Classic, HitResult.LargeBonus, HitResult.LargeBonus, 100_015)] public void TestFourVariousResultsOneMiss(ScoringMode scoringMode, HitResult hitResult, HitResult maxResult, int expectedScore) @@ -167,6 +169,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.Perfect, HitResult.Miss)] [TestCase(HitResult.SmallTickHit, HitResult.SmallTickMiss)] [TestCase(HitResult.LargeTickHit, HitResult.LargeTickMiss)] + [TestCase(HitResult.SliderTailHit, HitResult.LargeTickMiss)] [TestCase(HitResult.SmallBonus, HitResult.IgnoreMiss)] [TestCase(HitResult.LargeBonus, HitResult.IgnoreMiss)] public void TestMinResults(HitResult hitResult, HitResult expectedMinResult) @@ -187,6 +190,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.SmallTickHit, false)] [TestCase(HitResult.LargeTickMiss, true)] [TestCase(HitResult.LargeTickHit, true)] + [TestCase(HitResult.SliderTailHit, true)] [TestCase(HitResult.SmallBonus, false)] [TestCase(HitResult.LargeBonus, false)] public void TestAffectsCombo(HitResult hitResult, bool expectedReturnValue) @@ -207,6 +211,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.SmallTickHit, true)] [TestCase(HitResult.LargeTickMiss, true)] [TestCase(HitResult.LargeTickHit, true)] + [TestCase(HitResult.SliderTailHit, true)] [TestCase(HitResult.SmallBonus, false)] [TestCase(HitResult.LargeBonus, false)] public void TestAffectsAccuracy(HitResult hitResult, bool expectedReturnValue) @@ -227,6 +232,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.SmallTickHit, false)] [TestCase(HitResult.LargeTickMiss, false)] [TestCase(HitResult.LargeTickHit, false)] + [TestCase(HitResult.SliderTailHit, false)] [TestCase(HitResult.SmallBonus, true)] [TestCase(HitResult.LargeBonus, true)] public void TestIsBonus(HitResult hitResult, bool expectedReturnValue) @@ -247,6 +253,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.SmallTickHit, true)] [TestCase(HitResult.LargeTickMiss, false)] [TestCase(HitResult.LargeTickHit, true)] + [TestCase(HitResult.SliderTailHit, true)] [TestCase(HitResult.SmallBonus, true)] [TestCase(HitResult.LargeBonus, true)] public void TestIsHit(HitResult hitResult, bool expectedReturnValue) @@ -267,6 +274,7 @@ namespace osu.Game.Tests.Rulesets.Scoring [TestCase(HitResult.SmallTickHit, true)] [TestCase(HitResult.LargeTickMiss, true)] [TestCase(HitResult.LargeTickHit, true)] + [TestCase(HitResult.SliderTailHit, true)] [TestCase(HitResult.SmallBonus, true)] [TestCase(HitResult.LargeBonus, true)] public void TestIsScorable(HitResult hitResult, bool expectedReturnValue) diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 27402d522c..93386de483 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -73,6 +73,7 @@ namespace osu.Game.Rulesets.Judgements return HitResult.SmallTickMiss; case HitResult.LargeTickHit: + case HitResult.SliderTailHit: return HitResult.LargeTickMiss; default: @@ -104,6 +105,7 @@ namespace osu.Game.Rulesets.Judgements case HitResult.SmallTickMiss: return -DEFAULT_MAX_HEALTH_INCREASE * 0.5; + case HitResult.SliderTailHit: case HitResult.LargeTickHit: return DEFAULT_MAX_HEALTH_INCREASE; diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index 2d55f1a649..f307344347 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -139,6 +139,13 @@ namespace osu.Game.Rulesets.Scoring [Order(15)] ComboBreak, + /// + /// A special judgement similar to that's used to increase the valuation of the final tick of a slider. + /// + [EnumMember(Value = "slider_tail_hit")] + [Order(16)] + SliderTailHit, + /// /// A special result used as a padding value for legacy rulesets. It is a hit type and affects combo, but does not affect the base score (does not affect accuracy). /// @@ -188,6 +195,7 @@ namespace osu.Game.Rulesets.Scoring case HitResult.LargeTickMiss: case HitResult.LegacyComboIncrease: case HitResult.ComboBreak: + case HitResult.SliderTailHit: return true; default: @@ -246,6 +254,7 @@ namespace osu.Game.Rulesets.Scoring case HitResult.LargeTickMiss: case HitResult.SmallTickHit: case HitResult.SmallTickMiss: + case HitResult.SliderTailHit: return true; default: @@ -329,6 +338,9 @@ namespace osu.Game.Rulesets.Scoring case HitResult.ComboBreak: return true; + case HitResult.SliderTailHit: + return true; + default: // Note that IgnoreHit and IgnoreMiss are excluded as they do not affect score. return result >= HitResult.Miss && result < HitResult.IgnoreMiss; @@ -383,6 +395,9 @@ namespace osu.Game.Rulesets.Scoring if (minResult == HitResult.IgnoreMiss) return; + if (maxResult == HitResult.SliderTailHit && minResult != HitResult.LargeTickMiss) + throw new ArgumentOutOfRangeException(nameof(minResult), $"{HitResult.LargeTickMiss} is the only valid minimum result for a {maxResult} judgement."); + if (maxResult == HitResult.LargeTickHit && minResult != HitResult.LargeTickMiss) throw new ArgumentOutOfRangeException(nameof(minResult), $"{HitResult.LargeTickMiss} is the only valid minimum result for a {maxResult} judgement."); diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 5123668e54..837bb4080e 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -322,6 +322,9 @@ namespace osu.Game.Rulesets.Scoring case HitResult.LargeTickHit: return 30; + case HitResult.SliderTailHit: + return 150; + case HitResult.Meh: return 50; From 17a531209cf4ca6d2e2386f736779ad084a9fa44 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 30 Dec 2023 10:24:59 +0900 Subject: [PATCH 445/567] Use SliderTailHit result for slider tails (non-classic-mod) --- .../TestSceneSliderEarlyHitJudgement.cs | 2 +- .../TestSceneSliderInput.cs | 4 ++-- .../TestSceneSliderLateHitJudgement.cs | 14 +++++++------- osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs | 2 +- .../Scoring/OsuHealthProcessor.cs | 1 + .../Scoring/OsuLegacyHealthProcessor.cs | 1 + 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs index 4ea21e51f6..19883060a0 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderEarlyHitJudgement.cs @@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); assertTickJudgement(HitResult.LargeTickHit); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs index 716d2e0756..12be74c4cc 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs @@ -467,13 +467,13 @@ namespace osu.Game.Rulesets.Osu.Tests private void assertHeadMissTailTracked() { - AddAssert("Tracking retained", () => judgementResults[^2].Type, () => Is.EqualTo(HitResult.LargeTickHit)); + AddAssert("Tracking retained", () => judgementResults[^2].Type, () => Is.EqualTo(HitResult.SliderTailHit)); AddAssert("Slider head missed", () => judgementResults.First().IsHit, () => Is.False); } private void assertMidSliderJudgements() { - AddAssert("Tracking acquired", () => judgementResults[^2].Type, () => Is.EqualTo(HitResult.LargeTickHit)); + AddAssert("Tracking acquired", () => judgementResults[^2].Type, () => Is.EqualTo(HitResult.SliderTailHit)); } private void assertMidSliderJudgementFail() diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs index 6ba9c723da..1ba4a60b75 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSliderLateHitJudgement.cs @@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.Tests }); assertHeadJudgement(HitResult.Ok); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertTickJudgement(1, HitResult.LargeTickHit); assertTickJudgement(2, HitResult.LargeTickHit); assertTickJudgement(3, HitResult.LargeTickHit); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -182,7 +182,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); assertAllTickJudgements(HitResult.LargeTickHit); assertRepeatJudgement(HitResult.LargeTickHit); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -210,7 +210,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); assertRepeatJudgement(HitResult.LargeTickHit); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertAllTickJudgements(HitResult.LargeTickMiss); // This particular test actually starts tracking the slider just before the end, so the tail should be hit because of its leniency. - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -276,7 +276,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); assertTickJudgement(0, HitResult.LargeTickMiss); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } @@ -307,7 +307,7 @@ namespace osu.Game.Rulesets.Osu.Tests assertHeadJudgement(HitResult.Meh); assertTickJudgement(0, HitResult.LargeTickMiss); assertTickJudgement(1, HitResult.LargeTickMiss); - assertTailJudgement(HitResult.LargeTickHit); + assertTailJudgement(HitResult.SliderTailHit); assertSliderJudgement(HitResult.IgnoreHit); } diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs index 357476ed30..ceee513412 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects public class TailJudgement : SliderEndJudgement { - public override HitResult MaxResult => HitResult.LargeTickHit; + public override HitResult MaxResult => HitResult.SliderTailHit; public override HitResult MinResult => HitResult.IgnoreMiss; } } diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs index 2eb257b3e6..fe6da9af35 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHealthProcessor.cs @@ -91,6 +91,7 @@ namespace osu.Game.Rulesets.Osu.Scoring // When classic slider mechanics are enabled, this result comes from the tail. return 0.02; + case HitResult.SliderTailHit: case HitResult.LargeTickHit: switch (result.HitObject) { diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs index e383e82b86..57d2f64e2c 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuLegacyHealthProcessor.cs @@ -57,6 +57,7 @@ namespace osu.Game.Rulesets.Osu.Scoring increase = 0.02; break; + case HitResult.SliderTailHit: case HitResult.LargeTickHit: // This result comes from either a slider tick or repeat. increase = hitObject is SliderTick ? 0.015 : 0.02; From bca060048266e1b124699def72b8f86e00b79c99 Mon Sep 17 00:00:00 2001 From: CaffeeLake Date: Wed, 27 Dec 2023 22:11:54 +0900 Subject: [PATCH 446/567] Use 0.99x or 1.01x Signed-off-by: CaffeeLake --- osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs | 10 ++++++++-- osu.Game/Screens/Select/FooterButtonMods.cs | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs b/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs index c758632392..85bcf6f0b2 100644 --- a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs +++ b/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; +using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -108,13 +109,13 @@ namespace osu.Game.Overlays.Mods Current.BindValueChanged(e => { - if (e.NewValue > Current.Default) + if (Precision.DefinitelyBigger(e.NewValue, Current.Default)) { MainBackground .FadeColour(colours.ForModType(ModType.DifficultyIncrease), transition_duration, Easing.OutQuint); counter.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint); } - else if (e.NewValue < Current.Default) + else if (Precision.DefinitelyBigger(Current.Default, e.NewValue)) { MainBackground .FadeColour(colours.ForModType(ModType.DifficultyReduction), transition_duration, Easing.OutQuint); @@ -131,6 +132,11 @@ namespace osu.Game.Overlays.Mods .FadeTo(0.15f, 60, Easing.OutQuint) .Then().FadeOut(500, Easing.OutQuint); + if (Precision.DefinitelyBigger(1.0, Current.Value) && Current.Value >= 0.995) + Current.Value = 0.99; + if (Precision.DefinitelyBigger(Current.Value, 1.0) && Current.Value < 1.005) + Current.Value = 1.01; + const float move_amount = 4; if (e.NewValue > e.OldValue) counter.MoveToY(Math.Max(-move_amount * 2, counter.Y - move_amount)).Then().MoveToY(0, transition_duration * 2, Easing.OutQuint); diff --git a/osu.Game/Screens/Select/FooterButtonMods.cs b/osu.Game/Screens/Select/FooterButtonMods.cs index 9a84f9a0aa..cfbd17be01 100644 --- a/osu.Game/Screens/Select/FooterButtonMods.cs +++ b/osu.Game/Screens/Select/FooterButtonMods.cs @@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; using osu.Game.Input.Bindings; +using osu.Framework.Utils; namespace osu.Game.Screens.Select { @@ -88,11 +89,16 @@ namespace osu.Game.Screens.Select { double multiplier = Current.Value?.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier) ?? 1; - MultiplierText.Text = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x"; + if (Precision.DefinitelyBigger(1.0, multiplier) && multiplier >= 0.995) + MultiplierText.Text = $"{0.99:N2}x"; + else if (Precision.DefinitelyBigger(multiplier, 1.0) && multiplier < 1.005) + MultiplierText.Text = $"{1.01:N2}x"; + else + MultiplierText.Text = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x"; - if (multiplier > 1.0) + if (Precision.DefinitelyBigger(multiplier, 1.0)) MultiplierText.FadeColour(highMultiplierColour, 200); - else if (multiplier < 1.0) + else if (Precision.DefinitelyBigger(1.0, multiplier)) MultiplierText.FadeColour(lowMultiplierColour, 200); else MultiplierText.FadeColour(Color4.White, 200); From cc89390ea89e6b1f8127adef2717e4d6438b7b46 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 30 Dec 2023 21:33:03 +0300 Subject: [PATCH 447/567] Expose `SuggestedOffset` bindable for testing purposes --- .../Sections/Audio/AudioOffsetAdjustControl.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index 08bf4b0dad..e46dc602eb 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -24,6 +24,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { public partial class AudioOffsetAdjustControl : SettingsItem { + public IBindable SuggestedOffset => ((AudioOffsetPreview)Control).SuggestedOffset; + [BackgroundDependencyLoader] private void load() { @@ -44,7 +46,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio private readonly IBindableList averageHitErrorHistory = new BindableList(); - private readonly Bindable suggestedOffset = new Bindable(); + public readonly Bindable SuggestedOffset = new Bindable(); private Container notchContainer = null!; private TextFlowContainer hintText = null!; @@ -90,8 +92,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio Text = "Apply suggested offset", Action = () => { - if (suggestedOffset.Value.HasValue) - current.Value = suggestedOffset.Value.Value; + if (SuggestedOffset.Value.HasValue) + current.Value = SuggestedOffset.Value.Value; hitErrorTracker.ClearHistory(); } } @@ -104,7 +106,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio base.LoadComplete(); averageHitErrorHistory.BindCollectionChanged(updateDisplay, true); - suggestedOffset.BindValueChanged(_ => updateHintText(), true); + SuggestedOffset.BindValueChanged(_ => updateHintText(), true); } private void updateDisplay(object? _, NotifyCollectionChangedEventArgs e) @@ -143,17 +145,17 @@ namespace osu.Game.Overlays.Settings.Sections.Audio break; } - suggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average(dataPoint => dataPoint.SuggestedGlobalAudioOffset) : null; + SuggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average(dataPoint => dataPoint.SuggestedGlobalAudioOffset) : null; } private float getXPositionForOffset(double offset) => (float)(Math.Clamp(offset, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); private void updateHintText() { - hintText.Text = suggestedOffset.Value == null + hintText.Text = SuggestedOffset.Value == null ? @"Play a few beatmaps to receive a suggested offset!" - : $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {suggestedOffset.Value:N0} ms."; - applySuggestion.Enabled.Value = suggestedOffset.Value != null; + : $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {SuggestedOffset.Value:N0} ms."; + applySuggestion.Enabled.Value = SuggestedOffset.Value != null; } } } From 68dd103c89e25619bf4aea6aea65e61d369396d6 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 30 Dec 2023 21:33:22 +0300 Subject: [PATCH 448/567] Add failing test cases --- .../TestSceneAudioOffsetAdjustControl.cs | 88 ++++++++++++++++--- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs b/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs index efb65bb0a8..85cde966b1 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneAudioOffsetAdjustControl.cs @@ -3,7 +3,7 @@ using NUnit.Framework; using osu.Framework.Allocation; -using osu.Framework.Bindables; +using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Utils; @@ -25,9 +25,15 @@ namespace osu.Game.Tests.Visual.Settings private Container content = null!; protected override Container Content => content; + private OsuConfigManager localConfig = null!; + private AudioOffsetAdjustControl adjustControl = null!; + [BackgroundDependencyLoader] private void load() { + localConfig = new OsuConfigManager(LocalStorage); + Dependencies.CacheAs(localConfig); + base.Content.AddRange(new Drawable[] { tracker, @@ -41,17 +47,21 @@ namespace osu.Game.Tests.Visual.Settings }); } - [Test] - public void TestBehaviour() + [SetUp] + public void SetUp() => Schedule(() => { - AddStep("create control", () => Child = new AudioOffsetAdjustControl + Child = adjustControl = new AudioOffsetAdjustControl { - Current = new BindableDouble - { - MinValue = -500, - MaxValue = 500 - } - }); + Current = localConfig.GetBindable(OsuSetting.AudioOffset), + }; + + localConfig.SetValue(OsuSetting.AudioOffset, 0.0); + tracker.ClearHistory(); + }); + + [Test] + public void TestDisplay() + { AddStep("set new score", () => statics.SetValue(Static.LastLocalUserScore, new ScoreInfo { HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(RNG.NextDouble(-100, 100)), @@ -59,5 +69,63 @@ namespace osu.Game.Tests.Visual.Settings })); AddStep("clear history", () => tracker.ClearHistory()); } + + [Test] + public void TestBehaviour() + { + AddStep("set score with -20ms", () => setScore(-20)); + AddAssert("suggested global offset is 20ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(20)); + AddStep("clear history", () => tracker.ClearHistory()); + + AddStep("set score with 40ms", () => setScore(40)); + AddAssert("suggested global offset is -40ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(-40)); + AddStep("clear history", () => tracker.ClearHistory()); + } + + [Test] + public void TestNonZeroGlobalOffset() + { + AddStep("set global offset to -20ms", () => localConfig.SetValue(OsuSetting.AudioOffset, -20.0)); + AddStep("set score with -20ms", () => setScore(-20)); + AddAssert("suggested global offset is 0ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(0)); + AddStep("clear history", () => tracker.ClearHistory()); + + AddStep("set global offset to 20ms", () => localConfig.SetValue(OsuSetting.AudioOffset, 20.0)); + AddStep("set score with 40ms", () => setScore(40)); + AddAssert("suggested global offset is -20ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(-20)); + AddStep("clear history", () => tracker.ClearHistory()); + } + + [Test] + public void TestMultiplePlays() + { + AddStep("set score with -20ms", () => setScore(-20)); + AddStep("set score with -10ms", () => setScore(-10)); + AddAssert("suggested global offset is 15ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(15)); + AddStep("clear history", () => tracker.ClearHistory()); + + AddStep("set score with -20ms", () => setScore(-20)); + AddStep("set global offset to 30ms", () => localConfig.SetValue(OsuSetting.AudioOffset, 30.0)); + AddStep("set score with 10ms", () => setScore(10)); + AddAssert("suggested global offset is 20ms", () => adjustControl.SuggestedOffset.Value, () => Is.EqualTo(20)); + AddStep("clear history", () => tracker.ClearHistory()); + } + + private void setScore(double averageHitError) + { + statics.SetValue(Static.LastLocalUserScore, new ScoreInfo + { + HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(averageHitError), + BeatmapInfo = Beatmap.Value.BeatmapInfo, + }); + } + + protected override void Dispose(bool isDisposing) + { + if (localConfig.IsNotNull()) + localConfig.Dispose(); + + base.Dispose(isDisposing); + } } } From e6fe631625643a23b18641a132c6e67c1062b9ee Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 30 Dec 2023 21:34:37 +0300 Subject: [PATCH 449/567] Fix suggested value in audio offset adjust control being opposite in signs --- .../Settings/Sections/Audio/AudioOffsetAdjustControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs index e46dc602eb..90f5a59215 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioOffsetAdjustControl.cs @@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio break; } - SuggestedOffset.Value = averageHitErrorHistory.Any() ? -averageHitErrorHistory.Average(dataPoint => dataPoint.SuggestedGlobalAudioOffset) : null; + SuggestedOffset.Value = averageHitErrorHistory.Any() ? averageHitErrorHistory.Average(dataPoint => dataPoint.SuggestedGlobalAudioOffset) : null; } private float getXPositionForOffset(double offset) => (float)(Math.Clamp(offset, current.MinValue, current.MaxValue) / (2 * current.MaxValue)); From 452f201f0673426df7e88b78f720293863e8d660 Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Sat, 30 Dec 2023 12:56:38 -0600 Subject: [PATCH 450/567] use margins isntead of moving the position of the sprite --- osu.Game/Screens/Menu/MainMenuButton.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenuButton.cs b/osu.Game/Screens/Menu/MainMenuButton.cs index 3d56a75ca8..422599a4a8 100644 --- a/osu.Game/Screens/Menu/MainMenuButton.cs +++ b/osu.Game/Screens/Menu/MainMenuButton.cs @@ -129,7 +129,8 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(32), - Position = new Vector2(0, -4), + Position = new Vector2(0, 0), + Margin = new MarginPadding { Top = -4 }, Icon = symbol }, new OsuSpriteText @@ -138,7 +139,8 @@ namespace osu.Game.Screens.Menu AllowMultiline = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Position = new Vector2(-3, 35), + Position = new Vector2(0, 35), + Margin = new MarginPadding { Left = -3 }, Text = text } } @@ -189,7 +191,7 @@ namespace osu.Game.Screens.Menu { icon.ClearTransforms(); icon.RotateTo(0, 500, Easing.Out); - icon.MoveTo(new Vector2(0, -4), 500, Easing.Out); + icon.MoveTo(Vector2.Zero, 500, Easing.Out); icon.ScaleTo(Vector2.One, 200, Easing.Out); if (State == ButtonState.Expanded) From 535177ab97c06c291aaba6860b0499096413c708 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 30 Dec 2023 11:40:40 -0800 Subject: [PATCH 451/567] Remove outdated main menu version reference on issue template --- .github/ISSUE_TEMPLATE/bug-issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue.yml b/.github/ISSUE_TEMPLATE/bug-issue.yml index dfdcf8d320..a8a5d5e64b 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue.yml +++ b/.github/ISSUE_TEMPLATE/bug-issue.yml @@ -42,7 +42,7 @@ body: - type: input attributes: label: Version - description: The version you encountered this bug on. This is shown at the bottom of the main menu and also at the end of the settings screen. + description: The version you encountered this bug on. This is shown at the end of the settings overlay. validations: required: true - type: markdown From 922b6ccb83b0e83d9b2be6f63ee7e8366e500c73 Mon Sep 17 00:00:00 2001 From: Gabriel Del Nero <43073074+Gabixel@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:36:55 +0100 Subject: [PATCH 452/567] Use `FontAwesome` solid heart icon instead of `OsuIcon`'s --- osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs index 08a816930e..85751e7457 100644 --- a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs @@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Profile.Header bool anyInfoAdded = false; anyInfoAdded |= tryAddInfo(FontAwesome.Solid.MapMarker, user.Location); - anyInfoAdded |= tryAddInfo(OsuIcon.Heart, user.Interests); + anyInfoAdded |= tryAddInfo(FontAwesome.Solid.Heart, user.Interests); anyInfoAdded |= tryAddInfo(FontAwesome.Solid.Suitcase, user.Occupation); if (anyInfoAdded) From 7cfb786b1a1dae5ef00c5d0359de336c4725c757 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 31 Dec 2023 04:48:06 +0300 Subject: [PATCH 453/567] Add helper method for properly formatting score multiplier in `ModUtils` --- osu.Game/Utils/ModUtils.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/osu.Game/Utils/ModUtils.cs b/osu.Game/Utils/ModUtils.cs index 1bd60fcdde..dad8c72aa1 100644 --- a/osu.Game/Utils/ModUtils.cs +++ b/osu.Game/Utils/ModUtils.cs @@ -5,6 +5,8 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; +using osu.Framework.Extensions.LocalisationExtensions; +using osu.Framework.Localisation; using osu.Game.Online.API; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; @@ -226,5 +228,21 @@ namespace osu.Game.Utils return proposedWereValid; } + + /// + /// Given a value of a score multiplier, returns a string version with special handling for a value near 1.00x. + /// + /// The value of the score multiplier. + /// A formatted score multiplier with a trailing "x" symbol + public static LocalisableString FormatScoreMultiplier(double scoreMultiplier) + { + // Round multiplier values away from 1.00x to two significant digits. + if (scoreMultiplier > 1) + scoreMultiplier = Math.Ceiling(scoreMultiplier * 100) / 100; + else + scoreMultiplier = Math.Floor(scoreMultiplier * 100) / 100; + + return scoreMultiplier.ToLocalisableString("0.00x"); + } } } From 4dc11c4c48d49104a2d5e504a58441f1752e6d7b Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 31 Dec 2023 05:18:07 +0300 Subject: [PATCH 454/567] Update existing code to use helper method --- osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs | 14 ++++---------- osu.Game/Screens/Select/FooterButtonMods.cs | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs b/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs index 85bcf6f0b2..b599b53082 100644 --- a/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs +++ b/osu.Game/Overlays/Mods/ScoreMultiplierDisplay.cs @@ -4,18 +4,17 @@ using System; using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; -using osu.Framework.Utils; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Localisation; using osu.Game.Rulesets.Mods; +using osu.Game.Utils; using osuTK; namespace osu.Game.Overlays.Mods @@ -109,13 +108,13 @@ namespace osu.Game.Overlays.Mods Current.BindValueChanged(e => { - if (Precision.DefinitelyBigger(e.NewValue, Current.Default)) + if (e.NewValue > Current.Default) { MainBackground .FadeColour(colours.ForModType(ModType.DifficultyIncrease), transition_duration, Easing.OutQuint); counter.FadeColour(ColourProvider.Background5, transition_duration, Easing.OutQuint); } - else if (Precision.DefinitelyBigger(Current.Default, e.NewValue)) + else if (e.NewValue < Current.Default) { MainBackground .FadeColour(colours.ForModType(ModType.DifficultyReduction), transition_duration, Easing.OutQuint); @@ -132,11 +131,6 @@ namespace osu.Game.Overlays.Mods .FadeTo(0.15f, 60, Easing.OutQuint) .Then().FadeOut(500, Easing.OutQuint); - if (Precision.DefinitelyBigger(1.0, Current.Value) && Current.Value >= 0.995) - Current.Value = 0.99; - if (Precision.DefinitelyBigger(Current.Value, 1.0) && Current.Value < 1.005) - Current.Value = 1.01; - const float move_amount = 4; if (e.NewValue > e.OldValue) counter.MoveToY(Math.Max(-move_amount * 2, counter.Y - move_amount)).Then().MoveToY(0, transition_duration * 2, Easing.OutQuint); @@ -153,7 +147,7 @@ namespace osu.Game.Overlays.Mods { protected override double RollingDuration => 500; - protected override LocalisableString FormatCount(double count) => count.ToLocalisableString(@"0.00x"); + protected override LocalisableString FormatCount(double count) => ModUtils.FormatScoreMultiplier(count); protected override OsuSpriteText CreateSpriteText() => new OsuSpriteText { diff --git a/osu.Game/Screens/Select/FooterButtonMods.cs b/osu.Game/Screens/Select/FooterButtonMods.cs index cfbd17be01..69782c25bb 100644 --- a/osu.Game/Screens/Select/FooterButtonMods.cs +++ b/osu.Game/Screens/Select/FooterButtonMods.cs @@ -19,7 +19,7 @@ using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; using osu.Game.Input.Bindings; -using osu.Framework.Utils; +using osu.Game.Utils; namespace osu.Game.Screens.Select { @@ -88,17 +88,11 @@ namespace osu.Game.Screens.Select private void updateMultiplierText() => Schedule(() => { double multiplier = Current.Value?.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier) ?? 1; + MultiplierText.Text = multiplier == 1 ? string.Empty : ModUtils.FormatScoreMultiplier(multiplier); - if (Precision.DefinitelyBigger(1.0, multiplier) && multiplier >= 0.995) - MultiplierText.Text = $"{0.99:N2}x"; - else if (Precision.DefinitelyBigger(multiplier, 1.0) && multiplier < 1.005) - MultiplierText.Text = $"{1.01:N2}x"; - else - MultiplierText.Text = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x"; - - if (Precision.DefinitelyBigger(multiplier, 1.0)) + if (multiplier > 1) MultiplierText.FadeColour(highMultiplierColour, 200); - else if (Precision.DefinitelyBigger(1.0, multiplier)) + else if (multiplier < 1) MultiplierText.FadeColour(lowMultiplierColour, 200); else MultiplierText.FadeColour(Color4.White, 200); From cd9250d08ccc415b5d94bacf8e0c31eb0d273ffb Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 31 Dec 2023 05:18:10 +0300 Subject: [PATCH 455/567] Add test coverage --- osu.Game.Tests/Mods/ModUtilsTest.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game.Tests/Mods/ModUtilsTest.cs b/osu.Game.Tests/Mods/ModUtilsTest.cs index 9107ddd1ae..4f10a0ea54 100644 --- a/osu.Game.Tests/Mods/ModUtilsTest.cs +++ b/osu.Game.Tests/Mods/ModUtilsTest.cs @@ -310,6 +310,13 @@ namespace osu.Game.Tests.Mods Assert.That(invalid?.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid)); } + [Test] + public void TestFormatScoreMultiplier() + { + Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.9999).ToString(), "0.99x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.0001).ToString(), "1.01x"); + } + public abstract class CustomMod1 : Mod, IModCompatibilitySpecification { } @@ -339,6 +346,16 @@ namespace osu.Game.Tests.Mods public override bool ValidForMultiplayerAsFreeMod => false; } + public class EditableMod : Mod + { + public override string Name => string.Empty; + public override LocalisableString Description => string.Empty; + public override string Acronym => string.Empty; + public override double ScoreMultiplier => Multiplier; + + public double Multiplier = 1; + } + public interface IModCompatibilitySpecification { } From 5ae5d7f92dc7b002e5b685922707c9cef61edbf9 Mon Sep 17 00:00:00 2001 From: iminlikewithyou Date: Sat, 30 Dec 2023 23:59:47 -0600 Subject: [PATCH 456/567] change floor to round --- osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs index b5315feccb..45213b7bdb 100644 --- a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs +++ b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs @@ -224,7 +224,7 @@ namespace osu.Game.Screens.Edit.Timing row.Alpha = time < selectedGroupStartTime || time > selectedGroupEndTime ? 0.2f : 1; row.WaveformOffsetTo(-offset, animated); row.WaveformScale = new Vector2(scale, 1); - row.BeatIndex = (int)Math.Floor(index); + row.BeatIndex = (int)Math.Round(index); index++; } From 4a94cfd35d74060daf691aabf6cf6235a1282344 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 31 Dec 2023 16:47:10 +0300 Subject: [PATCH 457/567] Fix failing test case --- .../Visual/UserInterface/TestSceneFooterButtonMods.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs index 4e1bf1390a..b98b91e8e5 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs @@ -5,10 +5,12 @@ using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Localisation; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Select; +using osu.Game.Utils; namespace osu.Game.Tests.Visual.UserInterface { @@ -74,7 +76,7 @@ namespace osu.Game.Tests.Visual.UserInterface private bool assertModsMultiplier(IEnumerable mods) { double multiplier = mods.Aggregate(1.0, (current, mod) => current * mod.ScoreMultiplier); - string expectedValue = multiplier.Equals(1.0) ? string.Empty : $"{multiplier:N2}x"; + string expectedValue = multiplier == 1 ? string.Empty : ModUtils.FormatScoreMultiplier(multiplier).ToString(); return expectedValue == footerButtonMods.MultiplierText.Current.Value; } From ca0f09733ab7741a1ee583d710bafead4fe86039 Mon Sep 17 00:00:00 2001 From: CaffeeLake Date: Sun, 31 Dec 2023 23:35:42 +0900 Subject: [PATCH 458/567] Remove unnecessary using directives Signed-off-by: CaffeeLake --- osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs index b98b91e8e5..a95bb2c9e3 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFooterButtonMods.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; -using osu.Framework.Localisation; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; From ad4b5f6deddc8cab855be638d7c77a358e6bf05a Mon Sep 17 00:00:00 2001 From: CaffeeLake Date: Mon, 1 Jan 2024 08:32:21 +0900 Subject: [PATCH 459/567] Fix: floating point errors Signed-off-by: CaffeeLake --- osu.Game/Utils/ModUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Utils/ModUtils.cs b/osu.Game/Utils/ModUtils.cs index dad8c72aa1..252579a186 100644 --- a/osu.Game/Utils/ModUtils.cs +++ b/osu.Game/Utils/ModUtils.cs @@ -238,9 +238,9 @@ namespace osu.Game.Utils { // Round multiplier values away from 1.00x to two significant digits. if (scoreMultiplier > 1) - scoreMultiplier = Math.Ceiling(scoreMultiplier * 100) / 100; + scoreMultiplier = Math.Ceiling(Math.Round(scoreMultiplier * 100, 12)) / 100; else - scoreMultiplier = Math.Floor(scoreMultiplier * 100) / 100; + scoreMultiplier = Math.Floor(Math.Round(scoreMultiplier * 100, 12)) / 100; return scoreMultiplier.ToLocalisableString("0.00x"); } From 94531807e476c774c42df3ef0ef745608eb80534 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jan 2024 17:01:32 +0900 Subject: [PATCH 460/567] Make slider ends show on results screen again --- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 ++ osu.Game/Scoring/ScoreInfo.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 5959576b9d..0496d1f680 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -277,6 +277,7 @@ namespace osu.Game.Rulesets.Osu HitResult.LargeTickHit, HitResult.SmallTickHit, + HitResult.SliderTailHit, HitResult.SmallBonus, HitResult.LargeBonus, }; @@ -289,6 +290,7 @@ namespace osu.Game.Rulesets.Osu case HitResult.LargeTickHit: return "slider tick"; + case HitResult.SliderTailHit: case HitResult.SmallTickHit: return "slider end"; diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 44795c6fa7..32e4bbbf29 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -350,6 +350,7 @@ namespace osu.Game.Scoring { case HitResult.SmallTickHit: case HitResult.LargeTickHit: + case HitResult.SliderTailHit: case HitResult.LargeBonus: case HitResult.SmallBonus: if (MaximumStatistics.TryGetValue(r.result, out int count) && count > 0) From b0cfea491675a012694576168396ba1c433133e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 10:11:49 +0100 Subject: [PATCH 461/567] Fix standardised score conversion failing for some taiko scores due to overestimating accuracy portion Standardised score conversion would return a negative total score for https://osu.ppy.sh/scores/taiko/182230346. The underlying reason for this is that the estimation of the accuracy portion for a score can be above the actual accuracy portion in the taiko ruleset. When calculating the maximum accuracy portion achievable, `TaikoLegacyScoreSimulator` will include the extra 300 points from a double hit on a strong hit, per strong hit. However, this double hit is not factored into accuracy. Both of the aforementioned facts mean that in taiko maximumLegacyAccuracyScore * score.Accuracy - which normally in other rulesets can be used pretty reliably as the exact number of points gained from the accuracy portion - is an estimate in the case of taiko, and an _upper_ estimate at that, because it implicitly assumes that the user has also hit `score.Accuracy` percent of all double hits possible in the beatmap. If this assumption is not upheld, then the user will have earned _less_ points than that from the accuracy portion, which means that the combo proportion estimate will go below zero. It is possible that this has happened on other scores before, but did not result in the total score going negative as the accuracy portion gained would have counteracted the effect of that due to being larger in magnitude than the score loss incurred from the negative combo portion. In the case of the score in question this was not the case due to very low accuracy _and_ very low max combo. --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 66c816e796..9cfb9ea957 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -316,7 +316,7 @@ namespace osu.Game.Database // when playing a beatmap with no bonus objects, with mods that have a 0.0x multiplier on stable (relax/autopilot). // In such cases, just assume 0. double comboProportion = maximumLegacyComboScore + maximumLegacyBonusScore > 0 - ? ((double)score.LegacyTotalScore - legacyAccScore) / (maximumLegacyComboScore + maximumLegacyBonusScore) + ? Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore) : 0; // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. From 3c5e9ac9a9cfc224905f8f8c6da66ed143cc7e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 10:49:09 +0100 Subject: [PATCH 462/567] Fix possible double score submission when auto-retrying via perfect mod Closes https://github.com/ppy/osu/issues/26035. `submitOnFailOrQuit()`, as the name suggests, can be called both when the player has failed, or when the player screen is being exited from. Notably, when perfect mod with auto-retry is active, the two happen almost simultaneously. This double call exposes a data race in `submitScore()` concerning the handling of `scoreSubmissionSource`. The race could be experimentally confirmed by applying the following patch: diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index 83adf1f960..76dd29bbdb 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -228,6 +228,7 @@ private Task submitScore(Score score) return Task.CompletedTask; } + Logger.Log($"{nameof(scoreSubmissionSource)} is {(scoreSubmissionSource == null ? "null" : "not null")}"); if (scoreSubmissionSource != null) return scoreSubmissionSource.Task; @@ -237,6 +238,7 @@ private Task submitScore(Score score) Logger.Log($"Beginning score submission (token:{token.Value})..."); + Logger.Log($"creating new {nameof(scoreSubmissionSource)}"); scoreSubmissionSource = new TaskCompletionSource(); var request = CreateSubmissionRequest(score, token.Value); which would result in the following log output: [runtime] 2024-01-02 09:54:13 [verbose]: scoreSubmissionSource is null [runtime] 2024-01-02 09:54:13 [verbose]: scoreSubmissionSource is null [runtime] 2024-01-02 09:54:13 [verbose]: Beginning score submission (token:36780)... [runtime] 2024-01-02 09:54:13 [verbose]: creating new scoreSubmissionSource [runtime] 2024-01-02 09:54:13 [verbose]: Beginning score submission (token:36780)... [runtime] 2024-01-02 09:54:13 [verbose]: creating new scoreSubmissionSource [network] 2024-01-02 09:54:13 [verbose]: Performing request osu.Game.Online.Solo.SubmitSoloScoreRequest [network] 2024-01-02 09:54:14 [verbose]: Request to https://dev.ppy.sh/api/v2/beatmaps/869310/solo/scores/36780 successfully completed! [network] 2024-01-02 09:54:14 [verbose]: SubmitSoloScoreRequest finished with response size of 639 bytes [network] 2024-01-02 09:54:14 [verbose]: Performing request osu.Game.Online.Solo.SubmitSoloScoreRequest [runtime] 2024-01-02 09:54:14 [verbose]: Score submission completed! (token:36780 id:20247) [network] 2024-01-02 09:54:14 [verbose]: Request to https://dev.ppy.sh/api/v2/beatmaps/869310/solo/scores/36780 successfully completed! [network] 2024-01-02 09:54:14 [verbose]: SubmitSoloScoreRequest finished with response size of 639 bytes [runtime] 2024-01-02 09:54:14 [error]: An unhandled error has occurred. [runtime] 2024-01-02 09:54:14 [error]: System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed. [runtime] 2024-01-02 09:54:14 [error]: at osu.Game.Screens.Play.SubmittingPlayer.<>c__DisplayClass30_0.b__0(MultiplayerScore s) in /home/dachb/Documents/opensource/osu/osu.Game/Screens/Play/SubmittingPlayer.cs:line 250 The intention of the submission logic was to only ever create one `scoreSubmissionSource`, and then reuse this one if a redundant submission request was made. However, because of the temporal proximity of fail and quit in this particular case, combined with the fact that the calls to `submitScore()` are taking place on TPL threads, means that there is a read-write data race on `scoreSubmissionSource`, wherein the source can be actually created twice. This leads to two concurrent score submission requests, which, upon completion, attempt to transition only _the second_ `scoreSubmissionSource` to a final state (this is because the API success/failure request callbacks capture `this`, i.e. the entire `SubmittingPlayer` instance, rather than the `scoreSubmissionSource` reference specifically). To fix, ensure correct synchronisation on the read-write critical section, which should prevent the `scoreSubmissionSource` from being created multiple times. --- osu.Game/Screens/Play/SubmittingPlayer.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index 83adf1f960..fb3481cbc4 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -41,6 +41,7 @@ namespace osu.Game.Screens.Play [Resolved] private SessionStatics statics { get; set; } + private readonly object scoreSubmissionLock = new object(); private TaskCompletionSource scoreSubmissionSource; protected SubmittingPlayer(PlayerConfiguration configuration = null) @@ -228,16 +229,19 @@ namespace osu.Game.Screens.Play return Task.CompletedTask; } - if (scoreSubmissionSource != null) - return scoreSubmissionSource.Task; + lock (scoreSubmissionLock) + { + if (scoreSubmissionSource != null) + return scoreSubmissionSource.Task; + + scoreSubmissionSource = new TaskCompletionSource(); + } // if the user never hit anything, this score should not be counted in any way. if (!score.ScoreInfo.Statistics.Any(s => s.Key.IsHit() && s.Value > 0)) return Task.CompletedTask; Logger.Log($"Beginning score submission (token:{token.Value})..."); - - scoreSubmissionSource = new TaskCompletionSource(); var request = CreateSubmissionRequest(score, token.Value); request.Success += s => From 72e502e6156b58474c8a6c9517b6f4c73ad420b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 11:55:59 +0100 Subject: [PATCH 463/567] Fix backwards z-ordering of fruits in juice streams and banana showers Closes https://github.com/ppy/osu/issues/25827. The logic cannot be easily abstracted out (because `CompareReverseChildID()` is protected and non-static on `CompositeDrawable`), so a local copy was applied instead. No testing as any testing would have been purely visual anyways. --- .../Objects/Drawables/DrawableBananaShower.cs | 2 +- .../Objects/Drawables/DrawableJuiceStream.cs | 2 +- .../Objects/Drawables/NestedFruitContainer.cs | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 osu.Game.Rulesets.Catch/Objects/Drawables/NestedFruitContainer.cs diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBananaShower.cs index 03adbce885..9ee4a15182 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableBananaShower.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables RelativeSizeAxes = Axes.X; Origin = Anchor.BottomLeft; - AddInternal(bananaContainer = new Container { RelativeSizeAxes = Axes.Both }); + AddInternal(bananaContainer = new NestedFruitContainer { RelativeSizeAxes = Axes.Both }); } protected override void AddNestedHitObject(DrawableHitObject hitObject) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableJuiceStream.cs index 41ecf59276..677b61df47 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/DrawableJuiceStream.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables RelativeSizeAxes = Axes.X; Origin = Anchor.BottomLeft; - AddInternal(dropletContainer = new Container { RelativeSizeAxes = Axes.Both, }); + AddInternal(dropletContainer = new NestedFruitContainer { RelativeSizeAxes = Axes.Both, }); } protected override void AddNestedHitObject(DrawableHitObject hitObject) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawables/NestedFruitContainer.cs b/osu.Game.Rulesets.Catch/Objects/Drawables/NestedFruitContainer.cs new file mode 100644 index 0000000000..90bdb0237e --- /dev/null +++ b/osu.Game.Rulesets.Catch/Objects/Drawables/NestedFruitContainer.cs @@ -0,0 +1,26 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Rulesets.Catch.Objects.Drawables +{ + public partial class NestedFruitContainer : Container + { + /// + /// This comparison logic is a copy of comparison logic, + /// which can't be easily extracted to a more common place. + /// + /// + protected override int Compare(Drawable x, Drawable y) + { + if (x is not DrawableCatchHitObject xObj || y is not DrawableCatchHitObject yObj) + return base.Compare(x, y); + + int result = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime); + return result == 0 ? CompareReverseChildID(x, y) : result; + } + } +} From f9f03ebc0f066dc8d7c23764fc3d88e4d6278bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 14:04:40 +0100 Subject: [PATCH 464/567] Store user online state in config for next launch Closes remainder of https://github.com/ppy/osu/issues/12635. --- osu.Game/Configuration/OsuConfigManager.cs | 3 +++ osu.Game/Online/API/APIAccess.cs | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index d4162b76d6..23686db1f8 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -20,6 +20,7 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; using osu.Game.Skinning; +using osu.Game.Users; namespace osu.Game.Configuration { @@ -193,6 +194,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.LastProcessedMetadataId, -1); SetDefault(OsuSetting.ComboColourNormalisationAmount, 0.2f, 0f, 1f, 0.01f); + SetDefault(OsuSetting.UserOnlineStatus, null); } protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup) @@ -420,5 +422,6 @@ namespace osu.Game.Configuration EditorShowSpeedChanges, TouchDisableGameplayTaps, ModSelectTextSearchStartsActive, + UserOnlineStatus, } } diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 21107d61fc..be5bdeca77 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -62,6 +62,9 @@ namespace osu.Game.Online.API private Bindable activity { get; } = new Bindable(); + private Bindable configStatus { get; } = new Bindable(); + private Bindable localUserStatus { get; } = new Bindable(); + protected bool HasLogin => authentication.Token.Value != null || (!string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password)); private readonly CancellationTokenSource cancellationToken = new CancellationTokenSource(); @@ -85,12 +88,20 @@ namespace osu.Game.Online.API authentication.TokenString = config.Get(OsuSetting.Token); authentication.Token.ValueChanged += onTokenChanged; + config.BindWith(OsuSetting.UserOnlineStatus, configStatus); + localUser.BindValueChanged(u => { u.OldValue?.Activity.UnbindFrom(activity); u.NewValue.Activity.BindTo(activity); + + if (u.OldValue != null) + localUserStatus.UnbindFrom(u.OldValue.Status); + localUserStatus.BindTo(u.NewValue.Status); }, true); + localUserStatus.BindValueChanged(val => configStatus.Value = val.NewValue); + var thread = new Thread(run) { Name = "APIAccess", @@ -200,6 +211,7 @@ namespace osu.Game.Online.API setLocalUser(new APIUser { Username = ProvidedUsername, + Status = { Value = configStatus.Value ?? UserStatus.Online } }); } @@ -246,8 +258,7 @@ namespace osu.Game.Online.API }; userReq.Success += user => { - // todo: save/pull from settings - user.Status.Value = UserStatus.Online; + user.Status.Value = configStatus.Value ?? UserStatus.Online; setLocalUser(user); From d4e917448d98e6409982719231f8b53e4340e11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 14:07:04 +0100 Subject: [PATCH 465/567] Fix login panel dropdown forcing user online It was sort of assuming that the user can't be anything but online when opening, thus forcing the status to online via the immediately-run value change callback. --- osu.Game/Overlays/Login/LoginPanel.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/osu.Game/Overlays/Login/LoginPanel.cs b/osu.Game/Overlays/Login/LoginPanel.cs index 19af95459f..b0af2fa273 100644 --- a/osu.Game/Overlays/Login/LoginPanel.cs +++ b/osu.Game/Overlays/Login/LoginPanel.cs @@ -143,6 +143,8 @@ namespace osu.Game.Overlays.Login panel.Status.BindTo(api.LocalUser.Value.Status); panel.Activity.BindTo(api.LocalUser.Value.Activity); + panel.Status.BindValueChanged(_ => updateDropdownCurrent(), true); + dropdown.Current.BindValueChanged(action => { switch (action.NewValue) @@ -174,6 +176,24 @@ namespace osu.Game.Overlays.Login ScheduleAfterChildren(() => GetContainingInputManager()?.ChangeFocus(form)); }); + private void updateDropdownCurrent() + { + switch (panel.Status.Value) + { + case UserStatus.Online: + dropdown.Current.Value = UserAction.Online; + break; + + case UserStatus.DoNotDisturb: + dropdown.Current.Value = UserAction.DoNotDisturb; + break; + + case UserStatus.Offline: + dropdown.Current.Value = UserAction.AppearOffline; + break; + } + } + public override bool AcceptsFocus => true; protected override bool OnClick(ClickEvent e) => true; From 09b2a4e3b42defa1ead3a156c2f8c890ed175473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 14:07:59 +0100 Subject: [PATCH 466/567] Fix users blipping online briefly before their online status is known --- osu.Game/Online/Metadata/OnlineMetadataClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Online/Metadata/OnlineMetadataClient.cs b/osu.Game/Online/Metadata/OnlineMetadataClient.cs index 6d00ce7551..c42c3378b7 100644 --- a/osu.Game/Online/Metadata/OnlineMetadataClient.cs +++ b/osu.Game/Online/Metadata/OnlineMetadataClient.cs @@ -23,7 +23,6 @@ namespace osu.Game.Online.Metadata public override IBindable IsWatchingUserPresence => isWatchingUserPresence; private readonly BindableBool isWatchingUserPresence = new BindableBool(); - // ReSharper disable once InconsistentlySynchronizedField public override IBindableDictionary UserStates => userStates; private readonly BindableDictionary userStates = new BindableDictionary(); @@ -192,7 +191,7 @@ namespace osu.Game.Online.Metadata { Schedule(() => { - if (presence != null) + if (presence?.Status != null) userStates[userId] = presence.Value; else userStates.Remove(userId); From 17656e9b9cfe4e6ce3fa2627bb1b3e34694ad305 Mon Sep 17 00:00:00 2001 From: Lena Date: Tue, 2 Jan 2024 18:38:25 +0100 Subject: [PATCH 467/567] update the current activity when the multiplayer room updates --- .../Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs index 7c12e6eab5..56256bb15c 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs @@ -349,6 +349,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer addItemButton.Alpha = localUserCanAddItem ? 1 : 0; Scheduler.AddOnce(UpdateMods); + + Activity.Value = new UserActivity.InLobby(Room); } private bool localUserCanAddItem => client.IsHost || Room.QueueMode.Value != QueueMode.HostOnly; From 88509f28ad66110f0b8b7fb79e69aeccce7e5929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 20:51:22 +0100 Subject: [PATCH 468/567] Adjust assertion to match new juice stream child ordering --- osu.Game.Rulesets.Catch.Tests/TestSceneCatchModHidden.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatchModHidden.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatchModHidden.cs index 419a846ec3..825e8c697c 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatchModHidden.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatchModHidden.cs @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Catch.Tests Mod = new CatchModHidden(), PassCondition = () => Player.Results.Count > 0 && Player.ChildrenOfType().Single().Alpha > 0 - && Player.ChildrenOfType().Last().Alpha > 0 + && Player.ChildrenOfType().First().Alpha > 0 }); } From bdfaa4b583912ebe4bba70a0d48c13ef1e79b919 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2024 13:34:49 +0900 Subject: [PATCH 469/567] Fix crash when dragging rotation control in editor with both mouse buttons Closes https://github.com/ppy/osu/issues/26325. --- .../Edit/Compose/Components/SelectionBoxRotationHandle.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionBoxRotationHandle.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionBoxRotationHandle.cs index 024749a701..5270162189 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionBoxRotationHandle.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionBoxRotationHandle.cs @@ -62,6 +62,9 @@ namespace osu.Game.Screens.Edit.Compose.Components protected override bool OnDragStart(DragStartEvent e) { + if (e.Button != MouseButton.Left) + return false; + if (rotationHandler == null) return false; rotationHandler.Begin(); From 9e8d07d3144bd4b072d28bd9bd0e255fee410de0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 27 Dec 2023 15:47:05 +0900 Subject: [PATCH 470/567] Add NVAPI and force thread optimisations on This undoes what stable does to force this setting off. --- osu.Desktop/NVAPI.cs | 737 +++++++++++++++++++++++++++++++++++++++++ osu.Desktop/Program.cs | 2 + 2 files changed, 739 insertions(+) create mode 100644 osu.Desktop/NVAPI.cs diff --git a/osu.Desktop/NVAPI.cs b/osu.Desktop/NVAPI.cs new file mode 100644 index 0000000000..9648ea1072 --- /dev/null +++ b/osu.Desktop/NVAPI.cs @@ -0,0 +1,737 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable disable + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using osu.Framework.Logging; + +namespace osu.Desktop +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class NVAPI + { + private const string osu_filename = "osu!.exe"; + + // This is a good reference: + // https://github.com/errollw/Warp-and-Blend-Quadros/blob/master/WarpBlend-Quadros/UnwarpAll-Quadros/include/nvapi.h + // Note our Stride == their VERSION (e.g. NVDRS_SETTING_VER) + + public const int MAX_PHYSICAL_GPUS = 64; + public const int UNICODE_STRING_MAX = 2048; + + public const string APPLICATION_NAME = @"osu!"; + public const string PROFILE_NAME = @"osu!"; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus EnumPhysicalGPUsDelegate([Out] IntPtr[] gpuHandles, out int gpuCount); + + public static readonly EnumPhysicalGPUsDelegate EnumPhysicalGPUs; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus EnumLogicalGPUsDelegate([Out] IntPtr[] gpuHandles, out int gpuCount); + + public static readonly EnumLogicalGPUsDelegate EnumLogicalGPUs; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus GetSystemTypeDelegate(IntPtr gpuHandle, out NvSystemType systemType); + + public static readonly GetSystemTypeDelegate GetSystemType; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus GetGPUTypeDelegate(IntPtr gpuHandle, out NvGpuType gpuType); + + public static readonly GetGPUTypeDelegate GetGPUType; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus CreateSessionDelegate(out IntPtr sessionHandle); + + public static CreateSessionDelegate CreateSession; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus LoadSettingsDelegate(IntPtr sessionHandle); + + public static LoadSettingsDelegate LoadSettings; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus FindApplicationByNameDelegate(IntPtr sessionHandle, [MarshalAs(UnmanagedType.BStr)] string appName, out IntPtr profileHandle, ref NvApplication application); + + public static FindApplicationByNameDelegate FindApplicationByName; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus GetCurrentGlobalProfileDelegate(IntPtr sessionHandle, out IntPtr profileHandle); + + public static GetCurrentGlobalProfileDelegate GetCurrentGlobalProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus GetProfileInfoDelegate(IntPtr sessionHandle, IntPtr profileHandle, ref NvProfile profile); + + public static GetProfileInfoDelegate GetProfileInfo; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate NvStatus GetSettingDelegate(IntPtr sessionHandle, IntPtr profileHandle, NvSettingID settingID, ref NvSetting setting); + + public static GetSettingDelegate GetSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvStatus CreateProfileDelegate(IntPtr sessionHandle, ref NvProfile profile, out IntPtr profileHandle); + + private static readonly CreateProfileDelegate CreateProfile; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvStatus SetSettingDelegate(IntPtr sessionHandle, IntPtr profileHandle, ref NvSetting setting); + + private static readonly SetSettingDelegate SetSetting; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvStatus EnumApplicationsDelegate(IntPtr sessionHandle, IntPtr profileHandle, uint startIndex, ref uint appCount, [In, Out, MarshalAs(UnmanagedType.LPArray)] NvApplication[] applications); + + private static readonly EnumApplicationsDelegate EnumApplications; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvStatus CreateApplicationDelegate(IntPtr sessionHandle, IntPtr profileHandle, ref NvApplication application); + + private static readonly CreateApplicationDelegate CreateApplication; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate NvStatus SaveSettingsDelegate(IntPtr sessionHandle); + + private static readonly SaveSettingsDelegate SaveSettings; + + public static NvStatus Status { get; private set; } = NvStatus.OK; + public static bool Available { get; private set; } + + private static IntPtr sessionHandle; + + public static bool IsUsingOptimusDedicatedGpu + { + get + { + if (!Available) + return false; + + if (!IsLaptop) + return false; + + IntPtr profileHandle; + if (!getProfile(out profileHandle, out _, out bool _)) + return false; + + // Get the optimus setting + NvSetting setting; + if (!getSetting(NvSettingID.SHIM_RENDERING_MODE_ID, profileHandle, out setting)) + return false; + + return (setting.U32CurrentValue & (uint)NvShimSetting.SHIM_RENDERING_MODE_ENABLE) > 0; + } + } + + public static bool IsLaptop + { + get + { + if (!Available) + return false; + + // Make sure that this is a laptop. + var gpus = new IntPtr[64]; + if (checkError(EnumPhysicalGPUs(gpus, out int gpuCount))) + return false; + + for (int i = 0; i < gpuCount; i++) + { + if (checkError(GetSystemType(gpus[i], out var type))) + return false; + + if (type == NvSystemType.LAPTOP) + return true; + } + + return false; + } + } + + public static bool ThreadedOptimisations + { + get + { + if (!Available) + return false; + + IntPtr profileHandle; + if (!getProfile(out profileHandle, out _, out bool _)) + return false; + + // Get the threaded optimisations setting + NvSetting setting; + if (!getSetting(NvSettingID.OGL_THREAD_CONTROL_ID, profileHandle, out setting)) + return false; + + return setting.U32CurrentValue != (uint)NvThreadControlSetting.OGL_THREAD_CONTROL_DISABLE; + } + set + { + if (!Available) + return; + + bool success = setSetting(NvSettingID.OGL_THREAD_CONTROL_ID, (uint)(value ? NvThreadControlSetting.OGL_THREAD_CONTROL_ENABLE : NvThreadControlSetting.OGL_THREAD_CONTROL_DISABLE)); + + Logger.Log(success ? $"Threaded optimizations set to \"{value}\"!" : "Threaded optimizations set failed!"); + } + } + + /// + /// Checks if the profile contains the current application. + /// + /// If the profile contains the current application. + private static bool containsApplication(IntPtr profileHandle, NvProfile profile, out NvApplication application) + { + application = new NvApplication + { + Version = NvApplication.Stride + }; + + if (profile.NumOfApps == 0) + return false; + + NvApplication[] applications = new NvApplication[profile.NumOfApps]; + applications[0].Version = NvApplication.Stride; + + uint numApps = profile.NumOfApps; + + if (checkError(EnumApplications(sessionHandle, profileHandle, 0, ref numApps, applications))) + return false; + + for (uint i = 0; i < numApps; i++) + { + if (applications[i].AppName == osu_filename) + { + application = applications[i]; + return true; + } + } + + return false; + } + + /// + /// Retrieves the profile of the current application. + /// + /// The profile handle. + /// The current application description. + /// If this profile is not a global (default) profile. + /// If the operation succeeded. + private static bool getProfile(out IntPtr profileHandle, out NvApplication application, out bool isApplicationSpecific) + { + application = new NvApplication + { + Version = NvApplication.Stride + }; + + isApplicationSpecific = true; + + if (checkError(FindApplicationByName(sessionHandle, osu_filename, out profileHandle, ref application))) + { + isApplicationSpecific = false; + if (checkError(GetCurrentGlobalProfile(sessionHandle, out profileHandle))) + return false; + } + + return true; + } + + /// + /// Creates a profile. + /// + /// The profile handle. + /// If the operation succeeded. + private static bool createProfile(out IntPtr profileHandle) + { + NvProfile newProfile = new NvProfile + { + Version = NvProfile.Stride, + IsPredefined = 0, + ProfileName = PROFILE_NAME, + GPUSupport = new uint[32] + }; + + newProfile.GPUSupport[0] = 1; + + if (checkError(CreateProfile(sessionHandle, ref newProfile, out profileHandle))) + return false; + + return true; + } + + /// + /// Retrieves a setting from the profile. + /// + /// The setting to retrieve. + /// The profile handle to retrieve the setting from. + /// The setting. + /// If the operation succeeded. + private static bool getSetting(NvSettingID settingId, IntPtr profileHandle, out NvSetting setting) + { + setting = new NvSetting + { + Version = NvSetting.Stride, + SettingID = settingId + }; + + if (checkError(GetSetting(sessionHandle, profileHandle, settingId, ref setting))) + return false; + + return true; + } + + private static bool setSetting(NvSettingID settingId, uint settingValue) + { + NvApplication application; + IntPtr profileHandle; + bool isApplicationSpecific; + if (!getProfile(out profileHandle, out application, out isApplicationSpecific)) + return false; + + if (!isApplicationSpecific) + { + // We don't want to interfere with the user's other settings, so let's create a separate config for osu! + if (!createProfile(out profileHandle)) + return false; + } + + NvSetting newSetting = new NvSetting + { + Version = NvSetting.Stride, + SettingID = settingId, + U32CurrentValue = settingValue + }; + + // Set the thread state + if (checkError(SetSetting(sessionHandle, profileHandle, ref newSetting))) + return false; + + // Get the profile (needed to check app count) + NvProfile profile = new NvProfile + { + Version = NvProfile.Stride + }; + if (checkError(GetProfileInfo(sessionHandle, profileHandle, ref profile))) + return false; + + if (!containsApplication(profileHandle, profile, out application)) + { + // Need to add the current application to the profile + application.IsPredefined = 0; + + application.AppName = osu_filename; + application.UserFriendlyName = APPLICATION_NAME; + + if (checkError(CreateApplication(sessionHandle, profileHandle, ref application))) + return false; + } + + // Save! + return !checkError(SaveSettings(sessionHandle)); + } + + /// + /// Creates a session to access the driver configuration. + /// + /// If the operation succeeded. + private static bool createSession() + { + if (checkError(CreateSession(out sessionHandle))) + return false; + + // Load settings into session + if (checkError(LoadSettings(sessionHandle))) + return false; + + return true; + } + + private static bool checkError(NvStatus status) + { + Status = status; + return status != NvStatus.OK; + } + + static NVAPI() + { + // TODO: check whether gpu vendor contains NVIDIA before attempting load? + + try + { + // Try to load NVAPI + if ((IntPtr.Size == 4 && loadLibrary(@"nvapi.dll") == IntPtr.Zero) + || (IntPtr.Size == 8 && loadLibrary(@"nvapi64.dll") == IntPtr.Zero)) + { + return; + } + + InitializeDelegate initialize; + getDelegate(0x0150E828, out initialize); + + if (initialize?.Invoke() == NvStatus.OK) + { + // IDs can be found here: https://github.com/jNizM/AHK_NVIDIA_NvAPI/blob/master/info/NvAPI_IDs.txt + + getDelegate(0xE5AC921F, out EnumPhysicalGPUs); + getDelegate(0x48B3EA59, out EnumLogicalGPUs); + getDelegate(0xBAAABFCC, out GetSystemType); + getDelegate(0xC33BAEB1, out GetGPUType); + getDelegate(0x0694D52E, out CreateSession); + getDelegate(0x375DBD6B, out LoadSettings); + getDelegate(0xEEE566B2, out FindApplicationByName); + getDelegate(0x617BFF9F, out GetCurrentGlobalProfile); + getDelegate(0x577DD202, out SetSetting); + getDelegate(0x61CD6FD6, out GetProfileInfo); + getDelegate(0x73BF8338, out GetSetting); + getDelegate(0xCC176068, out CreateProfile); + getDelegate(0x7FA2173A, out EnumApplications); + getDelegate(0x4347A9DE, out CreateApplication); + getDelegate(0xFCBC7E14, out SaveSettings); + } + + if (createSession()) + Available = true; + } + catch { } + } + + private static void getDelegate(uint id, out T newDelegate) where T : class + { + IntPtr ptr = IntPtr.Size == 4 ? queryInterface32(id) : queryInterface64(id); + newDelegate = ptr == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; + } + + [DllImport("kernel32.dll", EntryPoint = "LoadLibrary")] + private static extern IntPtr loadLibrary(string dllToLoad); + + [DllImport(@"nvapi.dll", EntryPoint = "nvapi_QueryInterface", CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr queryInterface32(uint id); + + [DllImport(@"nvapi64.dll", EntryPoint = "nvapi_QueryInterface", CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr queryInterface64(uint id); + + private delegate NvStatus InitializeDelegate(); + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct NvSetting + { + public uint Version; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string SettingName; + + public NvSettingID SettingID; + public uint SettingType; + public uint SettingLocation; + public uint IsCurrentPredefined; + public uint IsPredefinedValid; + + public uint U32PredefinedValue; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string StringPredefinedValue; + + public uint U32CurrentValue; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string StringCurrentValue; + + public static uint Stride => (uint)Marshal.SizeOf(typeof(NvSetting)) | (1 << 16); + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NvProfile + { + public uint Version; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string ProfileName; + + [MarshalAs(UnmanagedType.ByValArray)] + public uint[] GPUSupport; + + public uint IsPredefined; + public uint NumOfApps; + public uint NumOfSettings; + + public static uint Stride => (uint)Marshal.SizeOf(typeof(NvProfile)) | (1 << 16); + } + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)] + internal struct NvApplication + { + public uint Version; + public uint IsPredefined; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string AppName; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string UserFriendlyName; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string Launcher; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NVAPI.UNICODE_STRING_MAX)] + public string FileInFolder; + + public static uint Stride => (uint)Marshal.SizeOf(typeof(NvApplication)) | (2 << 16); + } + + internal enum NvStatus + { + OK = 0, // Success. Request is completed. + ERROR = -1, // Generic error + LIBRARY_NOT_FOUND = -2, // NVAPI support library cannot be loaded. + NO_IMPLEMENTATION = -3, // not implemented in current driver installation + API_NOT_INITIALIZED = -4, // Initialize has not been called (successfully) + INVALID_ARGUMENT = -5, // The argument/parameter value is not valid or NULL. + NVIDIA_DEVICE_NOT_FOUND = -6, // No NVIDIA display driver, or NVIDIA GPU driving a display, was found. + END_ENUMERATION = -7, // No more items to enumerate + INVALID_HANDLE = -8, // Invalid handle + INCOMPATIBLE_STRUCT_VERSION = -9, // An argument's structure version is not supported + HANDLE_INVALIDATED = -10, // The handle is no longer valid (likely due to GPU or display re-configuration) + OPENGL_CONTEXT_NOT_CURRENT = -11, // No NVIDIA OpenGL context is current (but needs to be) + INVALID_POINTER = -14, // An invalid pointer, usually NULL, was passed as a parameter + NO_GL_EXPERT = -12, // OpenGL Expert is not supported by the current drivers + INSTRUMENTATION_DISABLED = -13, // OpenGL Expert is supported, but driver instrumentation is currently disabled + NO_GL_NSIGHT = -15, // OpenGL does not support Nsight + + EXPECTED_LOGICAL_GPU_HANDLE = -100, // Expected a logical GPU handle for one or more parameters + EXPECTED_PHYSICAL_GPU_HANDLE = -101, // Expected a physical GPU handle for one or more parameters + EXPECTED_DISPLAY_HANDLE = -102, // Expected an NV display handle for one or more parameters + INVALID_COMBINATION = -103, // The combination of parameters is not valid. + NOT_SUPPORTED = -104, // Requested feature is not supported in the selected GPU + PORTID_NOT_FOUND = -105, // No port ID was found for the I2C transaction + EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, // Expected an unattached display handle as one of the input parameters. + INVALID_PERF_LEVEL = -107, // Invalid perf level + DEVICE_BUSY = -108, // Device is busy; request not fulfilled + NV_PERSIST_FILE_NOT_FOUND = -109, // NV persist file is not found + PERSIST_DATA_NOT_FOUND = -110, // NV persist data is not found + EXPECTED_TV_DISPLAY = -111, // Expected a TV output display + EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, // Expected a TV output on the D Connector - HDTV_EIAJ4120. + NO_ACTIVE_SLI_TOPOLOGY = -113, // SLI is not active on this device. + SLI_RENDERING_MODE_NOTALLOWED = -114, // Setup of SLI rendering mode is not possible right now. + EXPECTED_DIGITAL_FLAT_PANEL = -115, // Expected a digital flat panel. + ARGUMENT_EXCEED_MAX_SIZE = -116, // Argument exceeds the expected size. + DEVICE_SWITCHING_NOT_ALLOWED = -117, // Inhibit is ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI active. + TESTING_CLOCKS_NOT_SUPPORTED = -118, // Testing of clocks is not supported. + UNKNOWN_UNDERSCAN_CONFIG = -119, // The specified underscan config is from an unknown source (e.g. INF) + TIMEOUT_RECONFIGURING_GPU_TOPO = -120, // Timeout while reconfiguring GPUs + DATA_NOT_FOUND = -121, // Requested data was not found + EXPECTED_ANALOG_DISPLAY = -122, // Expected an analog display + NO_VIDLINK = -123, // No SLI video bridge is present + REQUIRES_REBOOT = -124, // NVAPI requires a reboot for the settings to take effect + INVALID_HYBRID_MODE = -125, // The function is not supported with the current Hybrid mode. + MIXED_TARGET_TYPES = -126, // The target types are not all the same + SYSWOW64_NOT_SUPPORTED = -127, // The function is not supported from 32-bit on a 64-bit system. + IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, // There is no implicit GPU topology active. Use SetHybridMode to change topology. + REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, // Prompt the user to close all non-migratable applications. + OUT_OF_MEMORY = -130, // Could not allocate sufficient memory to complete the call. + WAS_STILL_DRAWING = -131, // The previous operation that is transferring information to or from this surface is incomplete. + FILE_NOT_FOUND = -132, // The file was not found. + TOO_MANY_UNIQUE_STATE_OBJECTS = -133, // There are too many unique instances of a particular type of state object. + INVALID_CALL = -134, // The method call is invalid. For example, a method's parameter may not be a valid pointer. + D3D10_1_LIBRARY_NOT_FOUND = -135, // d3d10_1.dll cannot be loaded. + FUNCTION_NOT_FOUND = -136, // Couldn't find the function in the loaded DLL. + INVALID_USER_PRIVILEGE = -137, // Current User is not Admin. + EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, // The handle corresponds to GDIPrimary. + EXPECTED_COMPUTE_GPU_HANDLE = -139, // Setting Physx GPU requires that the GPU is compute-capable. + STEREO_NOT_INITIALIZED = -140, // The Stereo part of NVAPI failed to initialize completely. Check if the stereo driver is installed. + STEREO_REGISTRY_ACCESS_FAILED = -141, // Access to stereo-related registry keys or values has failed. + STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, // The given registry profile type is not supported. + STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, // The given registry value is not supported. + STEREO_NOT_ENABLED = -144, // Stereo is not enabled and the function needed it to execute completely. + STEREO_NOT_TURNED_ON = -145, // Stereo is not turned on and the function needed it to execute completely. + STEREO_INVALID_DEVICE_INTERFACE = -146, // Invalid device interface. + STEREO_PARAMETER_OUT_OF_RANGE = -147, // Separation percentage or JPEG image capture quality is out of [0-100] range. + STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, // The given frustum adjust mode is not supported. + TOPO_NOT_POSSIBLE = -149, // The mosaic topology is not possible given the current state of the hardware. + MODE_CHANGE_FAILED = -150, // An attempt to do a display resolution mode change has failed. + D3D11_LIBRARY_NOT_FOUND = -151, // d3d11.dll/d3d11_beta.dll cannot be loaded. + INVALID_ADDRESS = -152, // Address is outside of valid range. + STRING_TOO_SMALL = -153, // The pre-allocated string is too small to hold the result. + MATCHING_DEVICE_NOT_FOUND = -154, // The input does not match any of the available devices. + DRIVER_RUNNING = -155, // Driver is running. + DRIVER_NOTRUNNING = -156, // Driver is not running. + ERROR_DRIVER_RELOAD_REQUIRED = -157, // A driver reload is required to apply these settings. + SET_NOT_ALLOWED = -158, // Intended setting is not allowed. + ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, // Information can't be returned due to "advanced display topology". + SETTING_NOT_FOUND = -160, // Setting is not found. + SETTING_SIZE_TOO_LARGE = -161, // Setting size is too large. + TOO_MANY_SETTINGS_IN_PROFILE = -162, // There are too many settings for a profile. + PROFILE_NOT_FOUND = -163, // Profile is not found. + PROFILE_NAME_IN_USE = -164, // Profile name is duplicated. + PROFILE_NAME_EMPTY = -165, // Profile name is empty. + EXECUTABLE_NOT_FOUND = -166, // Application not found in the Profile. + EXECUTABLE_ALREADY_IN_USE = -167, // Application already exists in the other profile. + DATATYPE_MISMATCH = -168, // Data Type mismatch + PROFILE_REMOVED = -169, // The profile passed as parameter has been removed and is no longer valid. + UNREGISTERED_RESOURCE = -170, // An unregistered resource was passed as a parameter. + ID_OUT_OF_RANGE = -171, // The DisplayId corresponds to a display which is not within the normal outputId range. + DISPLAYCONFIG_VALIDATION_FAILED = -172, // Display topology is not valid so the driver cannot do a mode set on this configuration. + DPMST_CHANGED = -173, // Display Port Multi-Stream topology has been changed. + INSUFFICIENT_BUFFER = -174, // Input buffer is insufficient to hold the contents. + ACCESS_DENIED = -175, // No access to the caller. + MOSAIC_NOT_ACTIVE = -176, // The requested action cannot be performed without Mosaic being enabled. + SHARE_RESOURCE_RELOCATED = -177, // The surface is relocated away from video memory. + REQUEST_USER_TO_DISABLE_DWM = -178, // The user should disable DWM before calling NvAPI. + D3D_DEVICE_LOST = -179, // D3D device status is D3DERR_DEVICELOST or D3DERR_DEVICENOTRESET - the user has to reset the device. + INVALID_CONFIGURATION = -180, // The requested action cannot be performed in the current state. + STEREO_HANDSHAKE_NOT_DONE = -181, // Call failed as stereo handshake not completed. + EXECUTABLE_PATH_IS_AMBIGUOUS = -182, // The path provided was too short to determine the correct NVDRS_APPLICATION + DEFAULT_STEREO_PROFILE_IS_NOT_DEFINED = -183, // Default stereo profile is not currently defined + DEFAULT_STEREO_PROFILE_DOES_NOT_EXIST = -184, // Default stereo profile does not exist + CLUSTER_ALREADY_EXISTS = -185, // A cluster is already defined with the given configuration. + DPMST_DISPLAY_ID_EXPECTED = -186, // The input display id is not that of a multi stream enabled connector or a display device in a multi stream topology + INVALID_DISPLAY_ID = -187, // The input display id is not valid or the monitor associated to it does not support the current operation + STREAM_IS_OUT_OF_SYNC = -188, // While playing secure audio stream, stream goes out of sync + INCOMPATIBLE_AUDIO_DRIVER = -189, // Older audio driver version than required + VALUE_ALREADY_SET = -190, // Value already set, setting again not allowed. + TIMEOUT = -191, // Requested operation timed out + GPU_WORKSTATION_FEATURE_INCOMPLETE = -192, // The requested workstation feature set has incomplete driver internal allocation resources + STEREO_INIT_ACTIVATION_NOT_DONE = -193, // Call failed because InitActivation was not called. + SYNC_NOT_ACTIVE = -194, // The requested action cannot be performed without Sync being enabled. + SYNC_MASTER_NOT_FOUND = -195, // The requested action cannot be performed without Sync Master being enabled. + INVALID_SYNC_TOPOLOGY = -196, // Invalid displays passed in the NV_GSYNC_DISPLAY pointer. + ECID_SIGN_ALGO_UNSUPPORTED = -197, // The specified signing algorithm is not supported. Either an incorrect value was entered or the current installed driver/hardware does not support the input value. + ECID_KEY_VERIFICATION_FAILED = -198, // The encrypted public key verification has failed. + FIRMWARE_OUT_OF_DATE = -199, // The device's firmware is out of date. + FIRMWARE_REVISION_NOT_SUPPORTED = -200, // The device's firmware is not supported. + } + + internal enum NvSystemType + { + UNKNOWN = 0, + LAPTOP = 1, + DESKTOP = 2 + } + + internal enum NvGpuType + { + UNKNOWN = 0, + IGPU = 1, // Integrated + DGPU = 2, // Discrete + } + + internal enum NvSettingID : uint + { + OGL_AA_LINE_GAMMA_ID = 0x2089BF6C, + OGL_DEEP_COLOR_SCANOUT_ID = 0x2097C2F6, + OGL_DEFAULT_SWAP_INTERVAL_ID = 0x206A6582, + OGL_DEFAULT_SWAP_INTERVAL_FRACTIONAL_ID = 0x206C4581, + OGL_DEFAULT_SWAP_INTERVAL_SIGN_ID = 0x20655CFA, + OGL_EVENT_LOG_SEVERITY_THRESHOLD_ID = 0x209DF23E, + OGL_EXTENSION_STRING_VERSION_ID = 0x20FF7493, + OGL_FORCE_BLIT_ID = 0x201F619F, + OGL_FORCE_STEREO_ID = 0x204D9A0C, + OGL_IMPLICIT_GPU_AFFINITY_ID = 0x20D0F3E6, + OGL_MAX_FRAMES_ALLOWED_ID = 0x208E55E3, + OGL_MULTIMON_ID = 0x200AEBFC, + OGL_OVERLAY_PIXEL_TYPE_ID = 0x209AE66F, + OGL_OVERLAY_SUPPORT_ID = 0x206C28C4, + OGL_QUALITY_ENHANCEMENTS_ID = 0x20797D6C, + OGL_SINGLE_BACKDEPTH_BUFFER_ID = 0x20A29055, + OGL_THREAD_CONTROL_ID = 0x20C1221E, + OGL_TRIPLE_BUFFER_ID = 0x20FDD1F9, + OGL_VIDEO_EDITING_MODE_ID = 0x20EE02B4, + AA_BEHAVIOR_FLAGS_ID = 0x10ECDB82, + AA_MODE_ALPHATOCOVERAGE_ID = 0x10FC2D9C, + AA_MODE_GAMMACORRECTION_ID = 0x107D639D, + AA_MODE_METHOD_ID = 0x10D773D2, + AA_MODE_REPLAY_ID = 0x10D48A85, + AA_MODE_SELECTOR_ID = 0x107EFC5B, + AA_MODE_SELECTOR_SLIAA_ID = 0x107AFC5B, + ANISO_MODE_LEVEL_ID = 0x101E61A9, + ANISO_MODE_SELECTOR_ID = 0x10D2BB16, + APPLICATION_PROFILE_NOTIFICATION_TIMEOUT_ID = 0x104554B6, + APPLICATION_STEAM_ID_ID = 0x107CDDBC, + CPL_HIDDEN_PROFILE_ID = 0x106D5CFF, + CUDA_EXCLUDED_GPUS_ID = 0x10354FF8, + D3DOGL_GPU_MAX_POWER_ID = 0x10D1EF29, + EXPORT_PERF_COUNTERS_ID = 0x108F0841, + FXAA_ALLOW_ID = 0x1034CB89, + FXAA_ENABLE_ID = 0x1074C972, + FXAA_INDICATOR_ENABLE_ID = 0x1068FB9C, + MCSFRSHOWSPLIT_ID = 0x10287051, + OPTIMUS_MAXAA_ID = 0x10F9DC83, + PHYSXINDICATOR_ID = 0x1094F16F, + PREFERRED_PSTATE_ID = 0x1057EB71, + PREVENT_UI_AF_OVERRIDE_ID = 0x103BCCB5, + PS_FRAMERATE_LIMITER_ID = 0x10834FEE, + PS_FRAMERATE_LIMITER_GPS_CTRL_ID = 0x10834F01, + SHIM_MAXRES_ID = 0x10F9DC82, + SHIM_MCCOMPAT_ID = 0x10F9DC80, + SHIM_RENDERING_MODE_ID = 0x10F9DC81, + SHIM_RENDERING_OPTIONS_ID = 0x10F9DC84, + SLI_GPU_COUNT_ID = 0x1033DCD1, + SLI_PREDEFINED_GPU_COUNT_ID = 0x1033DCD2, + SLI_PREDEFINED_GPU_COUNT_DX10_ID = 0x1033DCD3, + SLI_PREDEFINED_MODE_ID = 0x1033CEC1, + SLI_PREDEFINED_MODE_DX10_ID = 0x1033CEC2, + SLI_RENDERING_MODE_ID = 0x1033CED1, + VRRFEATUREINDICATOR_ID = 0x1094F157, + VRROVERLAYINDICATOR_ID = 0x1095F16F, + VRRREQUESTSTATE_ID = 0x1094F1F7, + VSYNCSMOOTHAFR_ID = 0x101AE763, + VSYNCVRRCONTROL_ID = 0x10A879CE, + VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, + WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, + WKS_API_STEREO_MODE_ID = 0x11E91A61, + WKS_MEMORY_ALLOCATION_POLICY_ID = 0x11112233, + WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, + WKS_STEREO_SUPPORT_ID = 0x11AA9E99, + WKS_STEREO_SWAP_MODE_ID = 0x11333333, + AO_MODE_ID = 0x00667329, + AO_MODE_ACTIVE_ID = 0x00664339, + AUTO_LODBIASADJUST_ID = 0x00638E8F, + ICAFE_LOGO_CONFIG_ID = 0x00DB1337, + LODBIASADJUST_ID = 0x00738E8F, + PRERENDERLIMIT_ID = 0x007BA09E, + PS_DYNAMIC_TILING_ID = 0x00E5C6C0, + PS_SHADERDISKCACHE_ID = 0x00198FFF, + PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, + PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, + PS_TEXFILTER_DISABLE_TRILIN_SLOPE_ID = 0x002ECAF2, + PS_TEXFILTER_NO_NEG_LODBIAS_ID = 0x0019BB68, + QUALITY_ENHANCEMENTS_ID = 0x00CE2691, + REFRESH_RATE_OVERRIDE_ID = 0x0064B541, + SET_POWER_THROTTLE_FOR_PCIe_COMPLIANCE_ID = 0x00AE785C, + SET_VAB_DATA_ID = 0x00AB8687, + VSYNCMODE_ID = 0x00A879CF, + VSYNCTEARCONTROL_ID = 0x005A375C, + TOTAL_DWORD_SETTING_NUM = 80, + TOTAL_WSTRING_SETTING_NUM = 4, + TOTAL_SETTING_NUM = 84, + INVALID_SETTING_ID = 0xFFFFFFFF + } + + internal enum NvShimSetting : uint + { + SHIM_RENDERING_MODE_INTEGRATED = 0x00000000, + SHIM_RENDERING_MODE_ENABLE = 0x00000001, + SHIM_RENDERING_MODE_USER_EDITABLE = 0x00000002, + SHIM_RENDERING_MODE_MASK = 0x00000003, + SHIM_RENDERING_MODE_VIDEO_MASK = 0x00000004, + SHIM_RENDERING_MODE_VARYING_BIT = 0x00000008, + SHIM_RENDERING_MODE_AUTO_SELECT = 0x00000010, + SHIM_RENDERING_MODE_OVERRIDE_BIT = 0x80000000, + SHIM_RENDERING_MODE_NUM_VALUES = 8, + SHIM_RENDERING_MODE_DEFAULT = SHIM_RENDERING_MODE_AUTO_SELECT + } + + internal enum NvThreadControlSetting : uint + { + OGL_THREAD_CONTROL_ENABLE = 0x00000001, + OGL_THREAD_CONTROL_DISABLE = 0x00000002, + OGL_THREAD_CONTROL_NUM_VALUES = 2, + OGL_THREAD_CONTROL_DEFAULT = 0 + } +} diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index a33e845f5b..b37b5cf6ca 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -30,6 +30,8 @@ namespace osu.Desktop [STAThread] public static void Main(string[] args) { + NVAPI.ThreadedOptimisations = true; + // run Squirrel first, as the app may exit after these run if (OperatingSystem.IsWindows()) { From d38f8d9c783049f0c6a577383f3097a923ba635c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2024 15:37:24 +0900 Subject: [PATCH 471/567] Change threaded optimisations setting to "Auto" on startup --- osu.Desktop/NVAPI.cs | 12 ++++++------ osu.Desktop/Program.cs | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/NVAPI.cs b/osu.Desktop/NVAPI.cs index 9648ea1072..e1c5971e28 100644 --- a/osu.Desktop/NVAPI.cs +++ b/osu.Desktop/NVAPI.cs @@ -153,30 +153,30 @@ namespace osu.Desktop } } - public static bool ThreadedOptimisations + public static NvThreadControlSetting ThreadedOptimisations { get { if (!Available) - return false; + return NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT; IntPtr profileHandle; if (!getProfile(out profileHandle, out _, out bool _)) - return false; + return NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT; // Get the threaded optimisations setting NvSetting setting; if (!getSetting(NvSettingID.OGL_THREAD_CONTROL_ID, profileHandle, out setting)) - return false; + return NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT; - return setting.U32CurrentValue != (uint)NvThreadControlSetting.OGL_THREAD_CONTROL_DISABLE; + return (NvThreadControlSetting)setting.U32CurrentValue; } set { if (!Available) return; - bool success = setSetting(NvSettingID.OGL_THREAD_CONTROL_ID, (uint)(value ? NvThreadControlSetting.OGL_THREAD_CONTROL_ENABLE : NvThreadControlSetting.OGL_THREAD_CONTROL_DISABLE)); + bool success = setSetting(NvSettingID.OGL_THREAD_CONTROL_ID, (uint)value); Logger.Log(success ? $"Threaded optimizations set to \"{value}\"!" : "Threaded optimizations set failed!"); } diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index b37b5cf6ca..a652e31f62 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -30,7 +30,10 @@ namespace osu.Desktop [STAThread] public static void Main(string[] args) { - NVAPI.ThreadedOptimisations = true; + // NVIDIA profiles are based on the executable name of a process. + // Lazer and stable share the same executable name. + // Stable sets this setting to "Off", which may not be what we want, so let's force it back to the default "Auto" on startup. + NVAPI.ThreadedOptimisations = NvThreadControlSetting.OGL_THREAD_CONTROL_DEFAULT; // run Squirrel first, as the app may exit after these run if (OperatingSystem.IsWindows()) From e686a6a1dddbe20c3c22dd1ec8cb572d7a9d8aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 3 Jan 2024 09:17:01 +0100 Subject: [PATCH 472/567] Fix player submission test intermittent failures due to audio playback discrepancy logic kicking in See https://github.com/ppy/osu/actions/runs/7384457927/job/20087439457#step:5:133. --- .../Visual/Gameplay/TestScenePlayerScoreSubmission.cs | 6 ++++++ osu.Game/Screens/Play/MasterGameplayClockContainer.cs | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs index f75a2656ef..96cfcd61c3 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs @@ -21,6 +21,7 @@ using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko; using osu.Game.Scoring; +using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; using osu.Game.Tests.Beatmaps; @@ -359,6 +360,11 @@ namespace osu.Game.Tests.Visual.Gameplay AllowImportCompletion = new SemaphoreSlim(1); } + protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart) + { + ShouldValidatePlaybackRate = false, + }; + protected override async Task ImportScore(Score score) { ScoreImportStarted = true; diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index a475f4823f..0d60ec4713 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -40,6 +40,12 @@ namespace osu.Game.Screens.Play Precision = 0.1, }; + /// + /// Whether the audio playback rate should be validated. + /// Mostly disabled for tests. + /// + internal bool ShouldValidatePlaybackRate { get; init; } + /// /// Whether the audio playback is within acceptable ranges. /// Will become false if audio playback is not going as expected. @@ -223,6 +229,9 @@ namespace osu.Game.Screens.Play private void checkPlaybackValidity() { + if (!ShouldValidatePlaybackRate) + return; + if (GameplayClock.IsRunning) { elapsedGameplayClockTime += GameplayClock.ElapsedFrameTime; From 474c416bd9985aab49f895054189ea5b61b40949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 3 Jan 2024 10:05:11 +0100 Subject: [PATCH 473/567] Make `dotnet format` shut up about naming --- osu.Desktop/NVAPI.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Desktop/NVAPI.cs b/osu.Desktop/NVAPI.cs index e1c5971e28..bb3a59cc7f 100644 --- a/osu.Desktop/NVAPI.cs +++ b/osu.Desktop/NVAPI.cs @@ -3,6 +3,8 @@ #nullable disable +#pragma warning disable IDE1006 // Naming rule violation + using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; From 04147eb68988e4ce7f94f5d36def2c8669821508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 3 Jan 2024 11:46:26 +0100 Subject: [PATCH 474/567] Fix lack of correct default value spec --- osu.Game/Screens/Play/MasterGameplayClockContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 0d60ec4713..8b8bf87436 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play /// Whether the audio playback rate should be validated. /// Mostly disabled for tests. /// - internal bool ShouldValidatePlaybackRate { get; init; } + internal bool ShouldValidatePlaybackRate { get; init; } = true; /// /// Whether the audio playback is within acceptable ranges. From 4312e9e9a9c70bd7a139833108edca8dd4ff63e3 Mon Sep 17 00:00:00 2001 From: CaffeeLake Date: Wed, 3 Jan 2024 20:17:05 +0900 Subject: [PATCH 475/567] Add Test: floating point errors --- osu.Game.Tests/Mods/ModUtilsTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Tests/Mods/ModUtilsTest.cs b/osu.Game.Tests/Mods/ModUtilsTest.cs index 4f10a0ea54..f1db146f3a 100644 --- a/osu.Game.Tests/Mods/ModUtilsTest.cs +++ b/osu.Game.Tests/Mods/ModUtilsTest.cs @@ -315,6 +315,10 @@ namespace osu.Game.Tests.Mods { Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.9999).ToString(), "0.99x"); Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.0001).ToString(), "1.01x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.899999999999999).ToString(), "0.90x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.099999999999999).ToString(), "1.10x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.900000000000001).ToString(), "0.90x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.100000000000001).ToString(), "1.10x"); } public abstract class CustomMod1 : Mod, IModCompatibilitySpecification From 92c45662874d2c4e3992124a8aeabcca90fa1862 Mon Sep 17 00:00:00 2001 From: wooster0 Date: Thu, 4 Jan 2024 12:20:05 +0900 Subject: [PATCH 476/567] Fix typo --- osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs index d4b6bc2b91..6c87553971 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs @@ -275,7 +275,7 @@ Phasellus eu nunc nec ligula semper fringilla. Aliquam magna neque, placerat sed AddStep("set content", () => { markdownContainer.Text = @" -This is a paragraph containing `inline code` synatax. +This is a paragraph containing `inline code` syntax. Oh wow I do love the `WikiMarkdownContainer`, it is very cool! This is a line before the fenced code block: From 659118c04353bca73182a82e6d48c533779f6777 Mon Sep 17 00:00:00 2001 From: wooster0 Date: Thu, 4 Jan 2024 12:20:51 +0900 Subject: [PATCH 477/567] Fix wiki link path inconsistencies If I access https://osu.ppy.sh/wiki/en/MAIN_PAGE or use any other capitalization my browser always redirects me to https://osu.ppy.sh/wiki/en/Main_page so I think Main_page is the correct capitalization. This might slightly reduce loading time? No idea though. Probably negligible if so. --- osu.Game/Overlays/Wiki/WikiHeader.cs | 2 +- osu.Game/Overlays/WikiOverlay.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Wiki/WikiHeader.cs b/osu.Game/Overlays/Wiki/WikiHeader.cs index 24eddeb0c2..55be05ed7a 100644 --- a/osu.Game/Overlays/Wiki/WikiHeader.cs +++ b/osu.Game/Overlays/Wiki/WikiHeader.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Wiki { public partial class WikiHeader : BreadcrumbControlOverlayHeader { - private const string index_path = "Main_Page"; + private const string index_path = "Main_page"; public static LocalisableString IndexPageString => LayoutStrings.HeaderHelpIndex; diff --git a/osu.Game/Overlays/WikiOverlay.cs b/osu.Game/Overlays/WikiOverlay.cs index c816eca776..440e451201 100644 --- a/osu.Game/Overlays/WikiOverlay.cs +++ b/osu.Game/Overlays/WikiOverlay.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays { public partial class WikiOverlay : OnlineOverlay { - private const string index_path = @"main_page"; + private const string index_path = "Main_page"; public string CurrentPath => path.Value; @@ -161,7 +161,7 @@ namespace osu.Game.Overlays path.Value = "error"; LoadDisplay(articlePage = new WikiArticlePage($@"{api.WebsiteRootUrl}/wiki/", - $"Something went wrong when trying to fetch page \"{originalPath}\".\n\n[Return to the main page](Main_Page).")); + $"Something went wrong when trying to fetch page \"{originalPath}\".\n\n[Return to the main page](Main_page).")); } private void showParentPage() From ddc8a647640ee1c6f4c2dcf005cb7dad0b9e4700 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 14:55:52 +0900 Subject: [PATCH 478/567] Reduce spinner glow It was horrible --- osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs index 88769442a1..76afeeb2c4 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Argon/ArgonSpinnerProgressArc.cs @@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon RelativeSizeAxes = Axes.Both, InnerRadius = arc_radius, RoundedCaps = true, - GlowColour = new Color4(171, 255, 255, 255) + GlowColour = new Color4(171, 255, 255, 180) } }; } From cf5f0a2bdc79e50b178f9b41d08a7ab52b1b5a9f Mon Sep 17 00:00:00 2001 From: wooster0 Date: Thu, 4 Jan 2024 15:01:27 +0900 Subject: [PATCH 479/567] Make chat commands case-insensitive Would be nice if I accidentally have caps lock enabled and write "/HELP" it still works. --- .../Chat/TestSceneChannelManager.cs | 19 ++++++++++++++++++- osu.Game/Online/Chat/ChannelManager.cs | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Chat/TestSceneChannelManager.cs b/osu.Game.Tests/Chat/TestSceneChannelManager.cs index 3a4c55c65c..eae12edebd 100644 --- a/osu.Game.Tests/Chat/TestSceneChannelManager.cs +++ b/osu.Game.Tests/Chat/TestSceneChannelManager.cs @@ -112,7 +112,7 @@ namespace osu.Game.Tests.Chat }); AddStep("post message", () => channelManager.PostMessage("Something interesting")); - AddUntilStep("message postesd", () => !channel.Messages.Any(m => m is LocalMessage)); + AddUntilStep("message posted", () => !channel.Messages.Any(m => m is LocalMessage)); AddStep("post /help command", () => channelManager.PostCommand("help", channel)); AddStep("post /me command with no action", () => channelManager.PostCommand("me", channel)); @@ -146,6 +146,23 @@ namespace osu.Game.Tests.Chat AddAssert("channel has no more messages", () => channel.Messages, () => Is.Empty); } + [Test] + public void TestCommandNameCaseInsensitivity() + { + Channel channel = null; + + AddStep("join channel and select it", () => + { + channelManager.JoinChannel(channel = createChannel(1, ChannelType.Public)); + channelManager.CurrentChannel.Value = channel; + }); + + AddStep("post /me command", () => channelManager.PostCommand("ME DANCES")); + AddUntilStep("/me command received", () => channel.Messages.Last().Content.Contains("DANCES")); + AddStep("post /help command", () => channelManager.PostCommand("HeLp")); + AddUntilStep("/help command received", () => channel.Messages.Last().Content.Contains("Supported commands")); + } + private void handlePostMessageRequest(PostMessageRequest request) { var message = new Message(++currentMessageId) diff --git a/osu.Game/Online/Chat/ChannelManager.cs b/osu.Game/Online/Chat/ChannelManager.cs index e95bc128c8..23989caae2 100644 --- a/osu.Game/Online/Chat/ChannelManager.cs +++ b/osu.Game/Online/Chat/ChannelManager.cs @@ -247,7 +247,7 @@ namespace osu.Game.Online.Chat string command = parameters[0]; string content = parameters.Length == 2 ? parameters[1] : string.Empty; - switch (command) + switch (command.ToLowerInvariant()) { case "np": AddInternal(new NowPlayingCommand(target)); From cd9bf0c753c0d4e6ca86c4ccc17fe1a668654e8e Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 3 Jan 2024 21:30:46 -0800 Subject: [PATCH 480/567] Flash blocking ongoing operations dialog when trying to force quit --- osu.Game/Screens/Menu/MainMenu.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 516b090a16..14c950d726 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; +using System.Linq; using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -25,6 +26,7 @@ using osu.Game.Input.Bindings; using osu.Game.IO; using osu.Game.Online.API; using osu.Game.Overlays; +using osu.Game.Overlays.Dialog; using osu.Game.Overlays.SkinEditor; using osu.Game.Rulesets; using osu.Game.Screens.Backgrounds; @@ -390,7 +392,12 @@ namespace osu.Game.Screens.Menu if (requiresConfirmation) { if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog) - exitDialog.PerformOkAction(); + { + if (exitDialog.Buttons.OfType().FirstOrDefault() != null) + exitDialog.PerformOkAction(); + else + exitDialog.Flash(); + } else { dialogOverlay.Push(new ConfirmExitDialog(() => From ea714c86d427cb6fa498b1d76a02e6ee389dae6f Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 3 Jan 2024 22:22:25 -0800 Subject: [PATCH 481/567] Fix potential null reference with flash sample when exiting rapidly Fixes `TestForceExitWithOperationInProgress()`. --- osu.Game/Overlays/Dialog/PopupDialog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index 4048b35e78..4ac37a63e2 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Dialog private readonly Vector2 ringMinifiedSize = new Vector2(20f); private readonly Box flashLayer; - private Sample flashSample = null!; + private Sample? flashSample; private readonly Container content; private readonly Container ring; @@ -267,7 +267,7 @@ namespace osu.Game.Overlays.Dialog flashLayer.FadeInFromZero(80, Easing.OutQuint) .Then() .FadeOutFromOne(1500, Easing.OutQuint); - flashSample.Play(); + flashSample?.Play(); } protected override bool OnKeyDown(KeyDownEvent e) From 1beb3f5462329262b902472227a3b6c097714092 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 15:45:13 +0900 Subject: [PATCH 482/567] Add failing test coverage of fast streams not working in editor --- .../TestSceneEditorAutoplayFastStreams.cs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 osu.Game.Rulesets.Osu.Tests/Editor/TestSceneEditorAutoplayFastStreams.cs diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneEditorAutoplayFastStreams.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneEditorAutoplayFastStreams.cs new file mode 100644 index 0000000000..cf5cd809ef --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneEditorAutoplayFastStreams.cs @@ -0,0 +1,51 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Linq; +using NUnit.Framework; +using osu.Framework.Testing; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Tests.Beatmaps; +using osu.Game.Tests.Visual; + +namespace osu.Game.Rulesets.Osu.Tests.Editor +{ + /// + /// This test covers autoplay working correctly in the editor on fast streams. + /// Might seem like a weird test, but frame stability being toggled can cause autoplay to operation incorrectly. + /// This is clearly a bug with the autoplay algorithm, but is worked around at an editor level for now. + /// + public partial class TestSceneEditorAutoplayFastStreams : EditorTestScene + { + protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) + { + var testBeatmap = new TestBeatmap(ruleset, false); + testBeatmap.HitObjects.AddRange(new[] + { + new HitCircle { StartTime = 500 }, + new HitCircle { StartTime = 530 }, + new HitCircle { StartTime = 560 }, + new HitCircle { StartTime = 590 }, + new HitCircle { StartTime = 620 }, + }); + + return testBeatmap; + } + + protected override Ruleset CreateEditorRuleset() => new OsuRuleset(); + + [Test] + public void TestAllHit() + { + AddStep("start playback", () => EditorClock.Start()); + AddUntilStep("wait for all hit", () => + { + DrawableHitCircle[] hitCircles = Editor.ChildrenOfType().OrderBy(s => s.HitObject.StartTime).ToArray(); + + return hitCircles.Length == 5 && hitCircles.All(h => h.IsHit); + }); + } + } +} From 65c29b4f09d49d772cfe2c9934c4d1ee65e9b384 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 13:18:41 +0900 Subject: [PATCH 483/567] Make editor remain frame stable during normal playback --- .../Edit/DrawableEditorRulesetWrapper.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/DrawableEditorRulesetWrapper.cs b/osu.Game/Rulesets/Edit/DrawableEditorRulesetWrapper.cs index 174b278d89..ebf06bcc4e 100644 --- a/osu.Game/Rulesets/Edit/DrawableEditorRulesetWrapper.cs +++ b/osu.Game/Rulesets/Edit/DrawableEditorRulesetWrapper.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.ObjectExtensions; @@ -26,6 +27,9 @@ namespace osu.Game.Rulesets.Edit [Resolved] private EditorBeatmap beatmap { get; set; } = null!; + [Resolved] + private EditorClock editorClock { get; set; } = null!; + public DrawableEditorRulesetWrapper(DrawableRuleset drawableRuleset) { this.drawableRuleset = drawableRuleset; @@ -38,7 +42,6 @@ namespace osu.Game.Rulesets.Edit [BackgroundDependencyLoader] private void load() { - drawableRuleset.FrameStablePlayback = false; Playfield.DisplayJudgements.Value = false; } @@ -65,6 +68,22 @@ namespace osu.Game.Rulesets.Edit Scheduler.AddOnce(regenerateAutoplay); } + protected override void Update() + { + base.Update(); + + // Whenever possible, we want to stay in frame stability playback. + // Without doing so, we run into bugs with some gameplay elements not behaving as expected. + // + // Note that this is not using EditorClock.IsSeeking as that would exit frame stability + // on all seeks. The intention here is to retain frame stability for small seeks. + // + // I still think no gameplay elements should require frame stability in the first place, but maybe that ship has sailed already.. + bool shouldBypassFrameStability = Math.Abs(drawableRuleset.FrameStableClock.CurrentTime - editorClock.CurrentTime) > 1000; + + drawableRuleset.FrameStablePlayback = !shouldBypassFrameStability; + } + private void regenerateAutoplay() { var autoplayMod = drawableRuleset.Mods.OfType().Single(); From 3419c59b062ba0ac9670d9279029d6fbb062aac0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 15:33:18 +0900 Subject: [PATCH 484/567] Fix failing tests due to frame stable seeks taking longer --- .../Editor/TestSceneOsuComposerSelection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneOsuComposerSelection.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneOsuComposerSelection.cs index 623cefff6b..366f17daee 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneOsuComposerSelection.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneOsuComposerSelection.cs @@ -46,10 +46,12 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor moveMouseToObject(() => slider); AddStep("seek after end", () => EditorClock.Seek(750)); + AddUntilStep("wait for seek", () => !EditorClock.IsSeeking); AddStep("left click", () => InputManager.Click(MouseButton.Left)); AddAssert("slider not selected", () => EditorBeatmap.SelectedHitObjects.Count == 0); AddStep("seek to visible", () => EditorClock.Seek(650)); + AddUntilStep("wait for seek", () => !EditorClock.IsSeeking); AddStep("left click", () => InputManager.Click(MouseButton.Left)); AddUntilStep("slider selected", () => EditorBeatmap.SelectedHitObjects.Single() == slider); } From b1813b17a2f84b5ee318a6db89fdff588356678b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 16:39:50 +0900 Subject: [PATCH 485/567] Few new rider inspection --- osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs b/osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs index 69070b0b64..76ed5063b0 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneDifficultySwitching.cs @@ -104,7 +104,7 @@ namespace osu.Game.Tests.Visual.Editing if (sameRuleset) { AddUntilStep("prompt for save dialog shown", () => DialogOverlay.CurrentDialog is PromptForSaveDialog); - AddStep("discard changes", () => ((PromptForSaveDialog)DialogOverlay.CurrentDialog).PerformOkAction()); + AddStep("discard changes", () => ((PromptForSaveDialog)DialogOverlay.CurrentDialog)?.PerformOkAction()); } // ensure editor loader didn't resume. From df99a37254b930b7369c754d09b3ad2ce9d115c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 17:04:36 +0900 Subject: [PATCH 486/567] Fix another realm null inspection --- osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs index bb4e06654a..015c2c62ed 100644 --- a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs +++ b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs @@ -132,8 +132,8 @@ namespace osu.Game.Tests.Beatmaps public AudioManager AudioManager => Audio; public IResourceStore Files => userSkinResourceStore; public new IResourceStore Resources => base.Resources; - public IResourceStore CreateTextureLoaderStore(IResourceStore underlyingStore) => null; - RealmAccess IStorageResourceProvider.RealmAccess => null; + public IResourceStore CreateTextureLoaderStore(IResourceStore underlyingStore) => throw new NotImplementedException(); + RealmAccess IStorageResourceProvider.RealmAccess => throw new NotImplementedException(); #endregion From f0aeeeea966f06add12cf2bca3dd48dac8573e82 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 17:13:21 +0900 Subject: [PATCH 487/567] ...in a safer way --- osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs index 015c2c62ed..1f491be7e3 100644 --- a/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs +++ b/osu.Game/Tests/Beatmaps/HitObjectSampleTest.cs @@ -132,8 +132,8 @@ namespace osu.Game.Tests.Beatmaps public AudioManager AudioManager => Audio; public IResourceStore Files => userSkinResourceStore; public new IResourceStore Resources => base.Resources; - public IResourceStore CreateTextureLoaderStore(IResourceStore underlyingStore) => throw new NotImplementedException(); - RealmAccess IStorageResourceProvider.RealmAccess => throw new NotImplementedException(); + public IResourceStore CreateTextureLoaderStore(IResourceStore underlyingStore) => null!; + RealmAccess IStorageResourceProvider.RealmAccess => null!; #endregion From 0bbc27e380b7fb2d430322edba27e8b0122f583f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 16:41:52 +0900 Subject: [PATCH 488/567] Add a gameplay configuration flag to disable fail animation --- .../Multiplayer/MultiplayerPlayer.cs | 4 +- osu.Game/Screens/Play/GameplayState.cs | 2 +- osu.Game/Screens/Play/Player.cs | 57 +++++++++++-------- osu.Game/Screens/Play/PlayerConfiguration.cs | 6 ++ 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs index e6d9dd4cd0..d9043df1d5 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs @@ -26,9 +26,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer { protected override bool PauseOnFocusLost => false; - // Disallow fails in multiplayer for now. - protected override bool CheckModsAllowFailure() => false; - protected override UserActivity InitialActivity => new UserActivity.InMultiplayerGame(Beatmap.Value.BeatmapInfo, Ruleset.Value); [Resolved] @@ -55,6 +52,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer { AllowPause = false, AllowRestart = false, + AllowFailAnimation = false, AllowSkipping = room.AutoSkip.Value, AutomaticallySkipIntro = room.AutoSkip.Value, AlwaysShowLeaderboard = true, diff --git a/osu.Game/Screens/Play/GameplayState.cs b/osu.Game/Screens/Play/GameplayState.cs index c2162d4df2..cc399a0fbe 100644 --- a/osu.Game/Screens/Play/GameplayState.cs +++ b/osu.Game/Screens/Play/GameplayState.cs @@ -46,7 +46,7 @@ namespace osu.Game.Screens.Play public bool HasPassed { get; set; } /// - /// Whether the user failed during gameplay. + /// Whether the user failed during gameplay. This is only set when the gameplay session has completed due to the fail. /// public bool HasFailed { get; set; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c960ac357f..df50e35986 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -735,7 +735,7 @@ namespace osu.Game.Screens.Play } // Only show the completion screen if the player hasn't failed - if (HealthProcessor.HasFailed) + if (GameplayState.HasFailed) return; GameplayState.HasPassed = true; @@ -924,37 +924,44 @@ namespace osu.Game.Screens.Play if (!CheckModsAllowFailure()) return false; - Debug.Assert(!GameplayState.HasFailed); - Debug.Assert(!GameplayState.HasPassed); - Debug.Assert(!GameplayState.HasQuit); + if (Configuration.AllowFailAnimation) + { + Debug.Assert(!GameplayState.HasFailed); + Debug.Assert(!GameplayState.HasPassed); + Debug.Assert(!GameplayState.HasQuit); - GameplayState.HasFailed = true; + GameplayState.HasFailed = true; - updateGameplayState(); + updateGameplayState(); - // There is a chance that we could be in a paused state as the ruleset's internal clock (see FrameStabilityContainer) - // could process an extra frame after the GameplayClock is stopped. - // In such cases we want the fail state to precede a user triggered pause. - if (PauseOverlay.State.Value == Visibility.Visible) - PauseOverlay.Hide(); + // There is a chance that we could be in a paused state as the ruleset's internal clock (see FrameStabilityContainer) + // could process an extra frame after the GameplayClock is stopped. + // In such cases we want the fail state to precede a user triggered pause. + if (PauseOverlay.State.Value == Visibility.Visible) + PauseOverlay.Hide(); - failAnimationContainer.Start(); + failAnimationContainer.Start(); - // Failures can be triggered either by a judgement, or by a mod. - // - // For the case of a judgement, due to ordering considerations, ScoreProcessor will not have received - // the final judgement which triggered the failure yet (see DrawableRuleset.NewResult handling above). - // - // A schedule here ensures that any lingering judgements from the current frame are applied before we - // finalise the score as "failed". - Schedule(() => + // Failures can be triggered either by a judgement, or by a mod. + // + // For the case of a judgement, due to ordering considerations, ScoreProcessor will not have received + // the final judgement which triggered the failure yet (see DrawableRuleset.NewResult handling above). + // + // A schedule here ensures that any lingering judgements from the current frame are applied before we + // finalise the score as "failed". + Schedule(() => + { + ScoreProcessor.FailScore(Score.ScoreInfo); + OnFail(); + + if (GameplayState.Mods.OfType().Any(m => m.RestartOnFail)) + Restart(true); + }); + } + else { ScoreProcessor.FailScore(Score.ScoreInfo); - OnFail(); - - if (GameplayState.Mods.OfType().Any(m => m.RestartOnFail)) - Restart(true); - }); + } return true; } diff --git a/osu.Game/Screens/Play/PlayerConfiguration.cs b/osu.Game/Screens/Play/PlayerConfiguration.cs index 122e25f406..466a691118 100644 --- a/osu.Game/Screens/Play/PlayerConfiguration.cs +++ b/osu.Game/Screens/Play/PlayerConfiguration.cs @@ -15,6 +15,12 @@ namespace osu.Game.Screens.Play /// public bool ShowResults { get; set; } = true; + /// + /// Whether the fail animation / screen should be triggered on failing. + /// If false, the score will still be marked as failed but gameplay will continue. + /// + public bool AllowFailAnimation { get; set; } = true; + /// /// Whether the player should be allowed to trigger a restart. /// From 705f25e4b990c0ab726c29d6541121f7eb47b034 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 16:42:05 +0900 Subject: [PATCH 489/567] Make `ScoreProcessor.Rank` read-only --- osu.Game/Rulesets/Mods/ModFlashlight.cs | 3 --- osu.Game/Rulesets/Mods/ModHidden.cs | 2 -- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 14 ++++++++------ osu.Game/Screens/Play/BreakOverlay.cs | 4 +++- osu.Game/Screens/Play/Player.cs | 2 -- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index 95406cc9e6..dc2ad6f47e 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -56,9 +56,6 @@ namespace osu.Game.Rulesets.Mods public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { Combo.BindTo(scoreProcessor.Combo); - - // Default value of ScoreProcessor's Rank in Flashlight Mod should be SS+ - scoreProcessor.Rank.Value = ScoreRank.XH; } public ScoreRank AdjustRank(ScoreRank rank, double accuracy) diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index 5a8226115f..8b25768575 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Mods public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) { - // Default value of ScoreProcessor's Rank in Hidden Mod should be SS+ - scoreProcessor.Rank.Value = ScoreRank.XH; } public ScoreRank AdjustRank(ScoreRank rank, double accuracy) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 837bb4080e..4ef65c55ab 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -86,7 +86,9 @@ namespace osu.Game.Rulesets.Scoring /// /// The current rank. /// - public readonly Bindable Rank = new Bindable(ScoreRank.X); + public IBindable Rank => rank; + + private readonly Bindable rank = new Bindable(ScoreRank.X); /// /// The highest combo achieved by this score. @@ -186,9 +188,9 @@ namespace osu.Game.Rulesets.Scoring Combo.ValueChanged += combo => HighestCombo.Value = Math.Max(HighestCombo.Value, combo.NewValue); Accuracy.ValueChanged += accuracy => { - Rank.Value = RankFromAccuracy(accuracy.NewValue); + rank.Value = RankFromAccuracy(accuracy.NewValue); foreach (var mod in Mods.Value.OfType()) - Rank.Value = mod.AdjustRank(Rank.Value, accuracy.NewValue); + rank.Value = mod.AdjustRank(Rank.Value, accuracy.NewValue); }; Mods.ValueChanged += mods => @@ -411,8 +413,8 @@ namespace osu.Game.Rulesets.Scoring TotalScore.Value = 0; Accuracy.Value = 1; Combo.Value = 0; - Rank.Disabled = false; - Rank.Value = ScoreRank.X; + rank.Disabled = false; + rank.Value = ScoreRank.X; HighestCombo.Value = 0; } @@ -448,7 +450,7 @@ namespace osu.Game.Rulesets.Scoring return; score.Passed = false; - Rank.Value = ScoreRank.F; + rank.Value = ScoreRank.F; PopulateScore(score); } diff --git a/osu.Game/Screens/Play/BreakOverlay.cs b/osu.Game/Screens/Play/BreakOverlay.cs index 3ca82ec00b..e18612c955 100644 --- a/osu.Game/Screens/Play/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreakOverlay.cs @@ -4,12 +4,14 @@ #nullable disable using System.Collections.Generic; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Beatmaps.Timing; using osu.Game.Rulesets.Scoring; +using osu.Game.Scoring; using osu.Game.Screens.Play.Break; namespace osu.Game.Screens.Play @@ -113,7 +115,7 @@ namespace osu.Game.Screens.Play if (scoreProcessor != null) { info.AccuracyDisplay.Current.BindTo(scoreProcessor.Accuracy); - info.GradeDisplay.Current.BindTo(scoreProcessor.Rank); + ((IBindable)info.GradeDisplay.Current).BindTo(scoreProcessor.Rank); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index df50e35986..b87306b9a2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -801,8 +801,6 @@ namespace osu.Game.Screens.Play // This player instance may already be in the process of exiting. return; - Debug.Assert(ScoreProcessor.Rank.Value != ScoreRank.F); - this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely())); }, Time.Current + delay, 50); From a4dee1a01af5c572f4fdd48c58caa754e542a32b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 16:51:25 +0900 Subject: [PATCH 490/567] Don't unset `Disabled` on rank (never actually disabled?) --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 4ef65c55ab..6d2b43a3e7 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -413,7 +413,6 @@ namespace osu.Game.Rulesets.Scoring TotalScore.Value = 0; Accuracy.Value = 1; Combo.Value = 0; - rank.Disabled = false; rank.Value = ScoreRank.X; HighestCombo.Value = 0; } From b12011d501ab28a34932176ab72854f4ed19fa52 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 17:04:45 +0900 Subject: [PATCH 491/567] Avoid rank updates after failing --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 6d2b43a3e7..13c5d523da 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -188,6 +188,10 @@ namespace osu.Game.Rulesets.Scoring Combo.ValueChanged += combo => HighestCombo.Value = Math.Max(HighestCombo.Value, combo.NewValue); Accuracy.ValueChanged += accuracy => { + // Once failed, we shouldn't update the rank anymore. + if (rank.Value == ScoreRank.F) + return; + rank.Value = RankFromAccuracy(accuracy.NewValue); foreach (var mod in Mods.Value.OfType()) rank.Value = mod.AdjustRank(Rank.Value, accuracy.NewValue); From 44d35020d16a1f445abd65758dd37a939de44b3b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 17:54:52 +0900 Subject: [PATCH 492/567] Add test coverage of failed multiplayer score --- osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs index 16030d568b..462286335a 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs @@ -29,6 +29,7 @@ using osu.Game.Rulesets.Catch; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Scoring; using osu.Game.Screens.OnlinePlay.Components; using osu.Game.Screens.OnlinePlay.Lounge; using osu.Game.Screens.OnlinePlay.Lounge.Components; @@ -690,6 +691,13 @@ namespace osu.Game.Tests.Visual.Multiplayer } AddUntilStep("wait for results", () => multiplayerComponents.CurrentScreen is ResultsScreen); + + AddAssert("check is fail", () => + { + var scoreInfo = ((ResultsScreen)multiplayerComponents.CurrentScreen).Score; + + return !scoreInfo.Passed && scoreInfo.Rank == ScoreRank.F; + }); } [Test] From fc1a2c594cbf53322b8e10aea3ce173dd6d9d82d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 18:02:37 +0900 Subject: [PATCH 493/567] Add a bit more test coverage --- osu.Game.Tests/Mods/ModUtilsTest.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Mods/ModUtilsTest.cs b/osu.Game.Tests/Mods/ModUtilsTest.cs index f1db146f3a..13da69871e 100644 --- a/osu.Game.Tests/Mods/ModUtilsTest.cs +++ b/osu.Game.Tests/Mods/ModUtilsTest.cs @@ -314,11 +314,20 @@ namespace osu.Game.Tests.Mods public void TestFormatScoreMultiplier() { Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.9999).ToString(), "0.99x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.0).ToString(), "1.00x"); Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.0001).ToString(), "1.01x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.899999999999999).ToString(), "0.90x"); - Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.099999999999999).ToString(), "1.10x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.9).ToString(), "0.90x"); Assert.AreEqual(ModUtils.FormatScoreMultiplier(0.900000000000001).ToString(), "0.90x"); + + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.099999999999999).ToString(), "1.10x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.1).ToString(), "1.10x"); Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.100000000000001).ToString(), "1.10x"); + + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.045).ToString(), "1.05x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.05).ToString(), "1.05x"); + Assert.AreEqual(ModUtils.FormatScoreMultiplier(1.055).ToString(), "1.06x"); } public abstract class CustomMod1 : Mod, IModCompatibilitySpecification From adac3b65cea7a896907ed5451abedc1e241e866f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 18:48:13 +0900 Subject: [PATCH 494/567] Fix beatmap carousel not preloading panels when off-screen --- osu.Game/Screens/Select/BeatmapCarousel.cs | 4 +- .../Carousel/DrawableCarouselBeatmapSet.cs | 73 +++++++++++++------ 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 89911c9a69..3353aeed7d 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -96,12 +96,12 @@ namespace osu.Game.Screens.Select /// /// Extend the range to retain already loaded pooled drawables. /// - private const float distance_offscreen_before_unload = 1024; + private const float distance_offscreen_before_unload = 2048; /// /// Extend the range to update positions / retrieve pooled drawables outside of visible range. /// - private const float distance_offscreen_to_preload = 512; // todo: adjust this appropriately once we can make set panel contents load while off-screen. + private const float distance_offscreen_to_preload = 768; /// /// Whether carousel items have completed asynchronously loaded. diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index f16e92a82a..c24e09582e 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Threading; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -46,6 +47,8 @@ namespace osu.Game.Screens.Select.Carousel private MenuItem[]? mainMenuItems; + private double timeSinceUnpool; + [Resolved] private BeatmapManager manager { get; set; } = null!; @@ -54,6 +57,7 @@ namespace osu.Game.Screens.Select.Carousel base.FreeAfterUse(); Item = null; + timeSinceUnpool = 0; ClearTransforms(); } @@ -92,13 +96,21 @@ namespace osu.Game.Screens.Select.Carousel // algorithm for this is taken from ScrollContainer. // while it doesn't necessarily need to match 1:1, as we are emulating scroll in some cases this feels most correct. Y = (float)Interpolation.Lerp(targetY, Y, Math.Exp(-0.01 * Time.Elapsed)); + + loadContentIfRequired(); } + private CancellationTokenSource? loadCancellation; + protected override void UpdateItem() { + loadCancellation?.Cancel(); + loadCancellation = null; + base.UpdateItem(); Content.Clear(); + Header.Clear(); beatmapContainer = null; beatmapsLoadTask = null; @@ -107,32 +119,8 @@ namespace osu.Game.Screens.Select.Carousel return; beatmapSet = ((CarouselBeatmapSet)Item).BeatmapSet; - - DelayedLoadWrapper background; - DelayedLoadWrapper mainFlow; - - Header.Children = new Drawable[] - { - // Choice of background image matches BSS implementation (always uses the lowest `beatmap_id` from the set). - background = new DelayedLoadWrapper(() => new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) - { - RelativeSizeAxes = Axes.Both, - }, 200) - { - RelativeSizeAxes = Axes.Both - }, - mainFlow = new DelayedLoadWrapper(() => new SetPanelContent((CarouselBeatmapSet)Item), 50) - { - RelativeSizeAxes = Axes.Both - }, - }; - - background.DelayedLoadComplete += fadeContentIn; - mainFlow.DelayedLoadComplete += fadeContentIn; } - private void fadeContentIn(Drawable d) => d.FadeInFromZero(150); - protected override void Deselected() { base.Deselected(); @@ -190,6 +178,43 @@ namespace osu.Game.Screens.Select.Carousel } } + private void loadContentIfRequired() + { + // Using DelayedLoadWrappers would only allow us to load content when on screen, but we want to preload while off-screen + // to provide a better user experience. + + // This is tracking time that this drawable is updating since the last pool. + // This is intended to provide a debounce so very fast scrolls (from one end to the other of the carousel) + // don't cause huge overheads. + const double time_updating_before_load = 150; + + Debug.Assert(Item != null); + + if (loadCancellation == null && (timeSinceUnpool += Time.Elapsed) > time_updating_before_load) + { + loadCancellation = new CancellationTokenSource(); + + LoadComponentAsync(new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) + { + RelativeSizeAxes = Axes.Both, + }, background => + { + Header.Add(background); + background.FadeInFromZero(150); + }, loadCancellation.Token); + + LoadComponentAsync(new SetPanelContent((CarouselBeatmapSet)Item) + { + Depth = float.MinValue, + RelativeSizeAxes = Axes.Both, + }, mainFlow => + { + Header.Add(mainFlow); + mainFlow.FadeInFromZero(150); + }, loadCancellation.Token); + } + } + private void updateBeatmapYPositions() { if (beatmapContainer == null) From 81c6fd5589751e125a8728ad57eb286dc4b146f1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 19:13:36 +0900 Subject: [PATCH 495/567] Load items closer to the centre of the screen as a priority --- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +- .../Carousel/DrawableCarouselBeatmapSet.cs | 41 +++++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 3353aeed7d..4408634787 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -108,6 +108,7 @@ namespace osu.Game.Screens.Select /// public bool BeatmapSetsLoaded { get; private set; } + [Cached] protected readonly CarouselScrollContainer Scroll; private readonly NoResultsPlaceholder noResultsPlaceholder; @@ -1251,7 +1252,7 @@ namespace osu.Game.Screens.Select } } - protected partial class CarouselScrollContainer : UserTrackingScrollContainer + public partial class CarouselScrollContainer : UserTrackingScrollContainer { private bool rightMouseScrollBlocked; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index c24e09582e..61658526db 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -8,9 +8,11 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using osu.Framework.Allocation; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Framework.Utils; using osu.Game.Beatmaps; @@ -178,39 +180,44 @@ namespace osu.Game.Screens.Select.Carousel } } + [Resolved] + private BeatmapCarousel.CarouselScrollContainer scrollContainer { get; set; } = null!; + private void loadContentIfRequired() { + Quad containingSsdq = scrollContainer.ScreenSpaceDrawQuad; + // Using DelayedLoadWrappers would only allow us to load content when on screen, but we want to preload while off-screen // to provide a better user experience. // This is tracking time that this drawable is updating since the last pool. // This is intended to provide a debounce so very fast scrolls (from one end to the other of the carousel) // don't cause huge overheads. - const double time_updating_before_load = 150; + // + // We increase the delay based on distance from centre, so the beatmaps the user is currently looking at load first. + float timeUpdatingBeforeLoad = 50 + Math.Abs(containingSsdq.Centre.Y - ScreenSpaceDrawQuad.Centre.Y) / containingSsdq.Height * 100; Debug.Assert(Item != null); - if (loadCancellation == null && (timeSinceUnpool += Time.Elapsed) > time_updating_before_load) + if (loadCancellation == null && (timeSinceUnpool += Time.Elapsed) > timeUpdatingBeforeLoad) { loadCancellation = new CancellationTokenSource(); - LoadComponentAsync(new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) + LoadComponentsAsync(new CompositeDrawable[] { - RelativeSizeAxes = Axes.Both, - }, background => + new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) + { + RelativeSizeAxes = Axes.Both, + }, + new SetPanelContent((CarouselBeatmapSet)Item) + { + Depth = float.MinValue, + RelativeSizeAxes = Axes.Both, + } + }, drawables => { - Header.Add(background); - background.FadeInFromZero(150); - }, loadCancellation.Token); - - LoadComponentAsync(new SetPanelContent((CarouselBeatmapSet)Item) - { - Depth = float.MinValue, - RelativeSizeAxes = Axes.Both, - }, mainFlow => - { - Header.Add(mainFlow); - mainFlow.FadeInFromZero(150); + Header.AddRange(drawables); + drawables.ForEach(d => d.FadeInFromZero(150)); }, loadCancellation.Token); } } From 085f5acd1abaf8cf309c5e2ccb12df367a19cc33 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2024 19:26:28 +0900 Subject: [PATCH 496/567] Fix another rider inspection (why do these keep coming up at random) --- osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs index 8c32135cfd..8691f46605 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs @@ -368,7 +368,7 @@ namespace osu.Game.Tests.Visual.Online { var cardContainer = this.ChildrenOfType>().Single().Parent; var expandedContent = this.ChildrenOfType().Single(); - return expandedContent.ScreenSpaceDrawQuad.GetVertices().ToArray().All(v => cardContainer.ScreenSpaceDrawQuad.Contains(v)); + return expandedContent.ScreenSpaceDrawQuad.GetVertices().ToArray().All(v => cardContainer!.ScreenSpaceDrawQuad.Contains(v)); }); } From 9b734bac2515c5a8cf61ca3cc7576bf1e012a4b9 Mon Sep 17 00:00:00 2001 From: Zachary Date: Fri, 5 Jan 2024 01:14:34 +1000 Subject: [PATCH 497/567] Allow track control after intro screen finishes. --- osu.Game/Overlays/MusicController.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 0986c0513c..01086d3e33 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays /// /// Whether user control of the global track should be allowed. /// - public readonly BindableBool AllowTrackControl = new BindableBool(true); + public readonly BindableBool AllowTrackControl = new BindableBool(false); /// /// Fired when the global has changed. diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 516b090a16..ffb68367c2 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -241,6 +241,8 @@ namespace osu.Game.Screens.Menu { var track = musicController.CurrentTrack; + musicController.AllowTrackControl.Value = true; + // presume the track is the current beatmap's track. not sure how correct this assumption is but it has worked until now. if (!track.IsRunning) { From 91bb3f6c57d7263876d5de57bab01c5d4b444b9c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 01:24:00 +0900 Subject: [PATCH 498/567] Cache argon character glyph lookups to reduce string allocations --- .../Play/HUD/ArgonCounterTextComponent.cs | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index 2a3f4365cb..266dfb3301 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -2,6 +2,8 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using osu.Framework.Allocation; @@ -137,33 +139,48 @@ namespace osu.Game.Screens.Play.HUD [BackgroundDependencyLoader] private void load(TextureStore textures) { + const string font_name = @"argon-counter"; + Spacing = new Vector2(-2f, 0f); - Font = new FontUsage(@"argon-counter", 1); - glyphStore = new GlyphStore(textures, getLookup); + Font = new FontUsage(font_name, 1); + glyphStore = new GlyphStore(font_name, textures, getLookup); } protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore); private class GlyphStore : ITexturedGlyphLookupStore { + private readonly string fontName; private readonly TextureStore textures; private readonly Func getLookup; - public GlyphStore(TextureStore textures, Func getLookup) + private readonly Dictionary cache = new Dictionary(); + + public GlyphStore(string fontName, TextureStore textures, Func getLookup) { + this.fontName = fontName; this.textures = textures; this.getLookup = getLookup; } public ITexturedCharacterGlyph? Get(string? fontName, char character) { + // We only service one font. + Debug.Assert(fontName == this.fontName); + + if (cache.TryGetValue(character, out var cached)) + return cached; + string lookup = getLookup(character); var texture = textures.Get($"Gameplay/Fonts/{fontName}-{lookup}"); - if (texture == null) - return null; + TexturedCharacterGlyph? glyph = null; - return new TexturedCharacterGlyph(new CharacterGlyph(character, 0, 0, texture.Width, texture.Height, null), texture, 0.125f); + if (texture != null) + glyph = new TexturedCharacterGlyph(new CharacterGlyph(character, 0, 0, texture.Width, texture.Height, null), texture, 0.125f); + + cache[character] = glyph; + return glyph; } public Task GetAsync(string fontName, char character) => Task.Run(() => Get(fontName, character)); From b190333c17f3e0209e7f04ad1463b272b957c774 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Thu, 4 Jan 2024 09:00:24 -0800 Subject: [PATCH 499/567] Use repeat step for more delay between the two exits --- .../Visual/Navigation/TestSceneScreenNavigation.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index d8dc512787..a0069f55c7 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -799,11 +799,7 @@ namespace osu.Game.Tests.Visual.Navigation }); }); - AddStep("attempt exit", () => - { - for (int i = 0; i < 2; ++i) - Game.ScreenStack.CurrentScreen.Exit(); - }); + AddRepeatStep("attempt force exit", () => Game.ScreenStack.CurrentScreen.Exit(), 2); AddUntilStep("stopped at exit confirm", () => Game.ChildrenOfType().Single().CurrentDialog is ConfirmExitDialog); } From 5b55ca66920b40b394b0403f92b7f371c35cf6b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 02:26:26 +0900 Subject: [PATCH 500/567] Cache legacy skin character glyph lookups to reduce string allocations --- osu.Game/Skinning/LegacySpriteText.cs | 35 +++++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/osu.Game/Skinning/LegacySpriteText.cs b/osu.Game/Skinning/LegacySpriteText.cs index 8aefa50252..81db5fdf36 100644 --- a/osu.Game/Skinning/LegacySpriteText.cs +++ b/osu.Game/Skinning/LegacySpriteText.cs @@ -2,6 +2,8 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; +using System.Diagnostics; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; @@ -44,10 +46,11 @@ namespace osu.Game.Skinning [BackgroundDependencyLoader] private void load(ISkinSource skin) { - base.Font = new FontUsage(skin.GetFontPrefix(font), 1, fixedWidth: FixedWidth); + string fontPrefix = skin.GetFontPrefix(font); + base.Font = new FontUsage(fontPrefix, 1, fixedWidth: FixedWidth); Spacing = new Vector2(-skin.GetFontOverlap(font), 0); - glyphStore = new LegacyGlyphStore(skin, MaxSizePerGlyph); + glyphStore = new LegacyGlyphStore(fontPrefix, skin, MaxSizePerGlyph); } protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore); @@ -57,25 +60,41 @@ namespace osu.Game.Skinning private readonly ISkin skin; private readonly Vector2? maxSize; - public LegacyGlyphStore(ISkin skin, Vector2? maxSize) + private readonly string fontName; + + private readonly Dictionary cache = new Dictionary(); + + public LegacyGlyphStore(string fontName, ISkin skin, Vector2? maxSize) { + this.fontName = fontName; this.skin = skin; this.maxSize = maxSize; } public ITexturedCharacterGlyph? Get(string? fontName, char character) { + // We only service one font. + Debug.Assert(fontName == this.fontName); + + if (cache.TryGetValue(character, out var cached)) + return cached; + string lookup = getLookupName(character); var texture = skin.GetTexture($"{fontName}-{lookup}"); - if (texture == null) - return null; + TexturedCharacterGlyph? glyph = null; - if (maxSize != null) - texture = texture.WithMaximumSize(maxSize.Value); + if (texture != null) + { + if (maxSize != null) + texture = texture.WithMaximumSize(maxSize.Value); - return new TexturedCharacterGlyph(new CharacterGlyph(character, 0, 0, texture.Width, texture.Height, null), texture, 1f / texture.ScaleAdjust); + glyph = new TexturedCharacterGlyph(new CharacterGlyph(character, 0, 0, texture.Width, texture.Height, null), texture, 1f / texture.ScaleAdjust); + } + + cache[character] = glyph; + return glyph; } private static string getLookupName(char character) From e9289cfbe78f318d00c9b77065daca6fa824cb09 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 01:51:20 +0900 Subject: [PATCH 501/567] Reduce precision of audio balance adjustments during slider sliding --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 1daaa24d57..bce28361cb 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -599,7 +599,9 @@ namespace osu.Game.Rulesets.Objects.Drawables float balanceAdjustAmount = positionalHitsoundsLevel.Value * 2; double returnedValue = balanceAdjustAmount * (position - 0.5f); - return returnedValue; + // Rounded to reduce the overhead of audio adjustments (which are currently bindable heavy). + // Balance is very hard to perceive in small increments anyways. + return Math.Round(returnedValue, 2); } /// From 091241634c08aaea3b6d3e34762fb2f1cb459295 Mon Sep 17 00:00:00 2001 From: Zachary Date: Fri, 5 Jan 2024 23:55:17 +1000 Subject: [PATCH 502/567] Make IntroScreen set `AllowTrackControl` to false instead --- osu.Game/Overlays/MusicController.cs | 2 +- osu.Game/Screens/Menu/IntroScreen.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 01086d3e33..0986c0513c 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays /// /// Whether user control of the global track should be allowed. /// - public readonly BindableBool AllowTrackControl = new BindableBool(false); + public readonly BindableBool AllowTrackControl = new BindableBool(true); /// /// Fired when the global has changed. diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index de7732dd5e..a81e24ee88 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -109,6 +109,8 @@ namespace osu.Game.Screens.Menu // prevent user from changing beatmap while the intro is still running. beatmap = Beatmap.BeginLease(false); + musicController.AllowTrackControl.Value = false; + MenuVoice = config.GetBindable(OsuSetting.MenuVoice); MenuMusic = config.GetBindable(OsuSetting.MenuMusic); From 8295ad1feb19c30ae944e2f8ea9bd3c5df6d04ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 2 Jan 2024 21:58:44 +0100 Subject: [PATCH 503/567] Change catch scoring to match score V2 --- .../Scoring/CatchScoreProcessor.cs | 60 ++++++++++++++++++- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 24 ++++---- 2 files changed, 69 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 4b3d378889..161a59c5fd 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; @@ -20,20 +21,73 @@ namespace osu.Game.Rulesets.Catch.Scoring private const int combo_cap = 200; private const double combo_base = 4; + private double fruitTinyScale; + public CatchScoreProcessor() : base(new CatchRuleset()) { } + protected override void Reset(bool storeResults) + { + base.Reset(storeResults); + + // large ticks are *purposefully* not counted to match stable + int fruitTinyScaleDivisor = MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) + MaximumResultCounts.GetValueOrDefault(HitResult.Great); + fruitTinyScale = fruitTinyScaleDivisor == 0 + ? 0 + : (double)MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) / fruitTinyScaleDivisor; + } + protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 600000 * comboProgress - + 400000 * Accuracy.Value * accuracyProgress + const int max_tiny_droplets_portion = 400000; + + double comboPortion = 1000000 - max_tiny_droplets_portion + max_tiny_droplets_portion * (1 - fruitTinyScale); + double dropletsPortion = max_tiny_droplets_portion * fruitTinyScale; + double dropletsHit = MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) == 0 + ? 0 + : (double)ScoreResultCounts.GetValueOrDefault(HitResult.SmallTickHit) / MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit); + + return comboPortion * comboProgress + + dropletsPortion * dropletsHit + bonusPortion; } + public override int GetBaseScoreForResult(HitResult result) + { + switch (result) + { + // dirty hack to emulate accuracy on stable weighting every object equally in accuracy portion + case HitResult.Great: + case HitResult.LargeTickHit: + case HitResult.SmallTickHit: + return 300; + + case HitResult.LargeBonus: + return 200; + } + + return base.GetBaseScoreForResult(result); + } + protected override double GetComboScoreChange(JudgementResult result) - => GetBaseScoreForResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); + { + double baseIncrease = 0; + + switch (result.Type) + { + case HitResult.Great: + baseIncrease = 300; + break; + + case HitResult.LargeTickHit: + baseIncrease = 100; + break; + } + + return baseIncrease * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)); + } public override ScoreRank RankFromAccuracy(double accuracy) { diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 837bb4080e..869ad2c4ae 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -167,14 +167,14 @@ namespace osu.Game.Rulesets.Scoring if (!beatmapApplied) throw new InvalidOperationException($"Cannot access maximum statistics before calling {nameof(ApplyBeatmap)}."); - return new Dictionary(maximumResultCounts); + return new Dictionary(MaximumResultCounts); } } private bool beatmapApplied; - private readonly Dictionary scoreResultCounts = new Dictionary(); - private readonly Dictionary maximumResultCounts = new Dictionary(); + protected readonly Dictionary ScoreResultCounts = new Dictionary(); + protected readonly Dictionary MaximumResultCounts = new Dictionary(); private readonly List hitEvents = new List(); private HitObject? lastHitObject; @@ -216,7 +216,7 @@ namespace osu.Game.Rulesets.Scoring if (result.FailedAtJudgement) return; - scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1; + ScoreResultCounts[result.Type] = ScoreResultCounts.GetValueOrDefault(result.Type) + 1; if (result.Type.IncreasesCombo()) Combo.Value++; @@ -272,7 +272,7 @@ namespace osu.Game.Rulesets.Scoring if (result.FailedAtJudgement) return; - scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) - 1; + ScoreResultCounts[result.Type] = ScoreResultCounts.GetValueOrDefault(result.Type) - 1; if (result.Judgement.MaxResult.AffectsAccuracy()) { @@ -394,13 +394,13 @@ namespace osu.Game.Rulesets.Scoring maximumComboPortion = currentComboPortion; maximumAccuracyJudgementCount = currentAccuracyJudgementCount; - maximumResultCounts.Clear(); - maximumResultCounts.AddRange(scoreResultCounts); + MaximumResultCounts.Clear(); + MaximumResultCounts.AddRange(ScoreResultCounts); MaximumTotalScore = TotalScore.Value; } - scoreResultCounts.Clear(); + ScoreResultCounts.Clear(); currentBaseScore = 0; currentMaximumBaseScore = 0; @@ -430,10 +430,10 @@ namespace osu.Game.Rulesets.Scoring score.MaximumStatistics.Clear(); foreach (var result in HitResultExtensions.ALL_TYPES) - score.Statistics[result] = scoreResultCounts.GetValueOrDefault(result); + score.Statistics[result] = ScoreResultCounts.GetValueOrDefault(result); foreach (var result in HitResultExtensions.ALL_TYPES) - score.MaximumStatistics[result] = maximumResultCounts.GetValueOrDefault(result); + score.MaximumStatistics[result] = MaximumResultCounts.GetValueOrDefault(result); // Populate total score after everything else. score.TotalScore = TotalScore.Value; @@ -464,8 +464,8 @@ namespace osu.Game.Rulesets.Scoring HighestCombo.Value = frame.Header.MaxCombo; TotalScore.Value = frame.Header.TotalScore; - scoreResultCounts.Clear(); - scoreResultCounts.AddRange(frame.Header.Statistics); + ScoreResultCounts.Clear(); + ScoreResultCounts.AddRange(frame.Header.Statistics); SetScoreProcessorStatistics(frame.Header.ScoreProcessorStatistics); From ea7078fab52bc1db38f4311c8822e99fa6e82e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 3 Jan 2024 15:03:06 +0100 Subject: [PATCH 504/567] Implement approximate score conversion algorithm matching score V2 --- .../StandardisedScoreMigrationTools.cs | 113 +++++++++++++++++- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 +- 2 files changed, 113 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 9cfb9ea957..f029d85aed 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -437,9 +437,30 @@ namespace osu.Game.Database break; case 2: + // compare logic in `CatchScoreProcessor`. + + // this could technically be slightly incorrect in the case of stable scores. + // because large droplet misses are counted as full misses in stable scores, + // `score.MaximumStatistics.GetValueOrDefault(Great)` will be equal to the count of fruits *and* large droplets + // rather than just fruits (which was the intent). + // this is not fixable without introducing an extra legacy score attribute dedicated for catch, + // and this is a ballpark conversion process anyway, so attempt to trudge on. + int fruitTinyScaleDivisor = score.MaximumStatistics.GetValueOrDefault(HitResult.SmallTickHit) + score.MaximumStatistics.GetValueOrDefault(HitResult.Great); + double fruitTinyScale = fruitTinyScaleDivisor == 0 + ? 0 + : (double)score.MaximumStatistics.GetValueOrDefault(HitResult.SmallTickHit) / fruitTinyScaleDivisor; + + const int max_tiny_droplets_portion = 400000; + + double comboPortion = 1000000 - max_tiny_droplets_portion + max_tiny_droplets_portion * (1 - fruitTinyScale); + double dropletsPortion = max_tiny_droplets_portion * fruitTinyScale; + double dropletsHit = score.MaximumStatistics.GetValueOrDefault(HitResult.SmallTickHit) == 0 + ? 0 + : (double)score.Statistics.GetValueOrDefault(HitResult.SmallTickHit) / score.MaximumStatistics.GetValueOrDefault(HitResult.SmallTickHit); + convertedTotalScore = (long)Math.Round(( - 600000 * comboProportion - + 400000 * score.Accuracy + comboPortion * estimateComboProportionForCatch(attributes.MaxCombo, score.MaxCombo, score.Statistics.GetValueOrDefault(HitResult.Miss)) + + dropletsPortion * dropletsHit + bonusProportion) * modMultiplier); break; @@ -461,6 +482,94 @@ namespace osu.Game.Database return convertedTotalScore; } + /// + /// + /// For catch, the general method of calculating the combo proportion used for other rulesets is generally useless. + /// This is because in stable score V1, catch has quadratic score progression, + /// while in stable score V2, score progression is logarithmic up to 200 combo and then linear. + /// + /// + /// This means that applying the naive rescale method to scores with lots of short combos (think 10x 100-long combos on a 1000-object map) + /// by linearly rescaling the combo portion as given by score V1 leads to horribly underestimating it. + /// Therefore this method attempts to counteract this by calculating the best case estimate for the combo proportion that takes all of the above into account. + /// + /// + /// The general idea is that aside from the which the player is known to have hit, + /// the remaining misses are evenly distributed across the rest of the objects that give combo. + /// This is therefore a worst-case estimate. + /// + /// + private static double estimateComboProportionForCatch(int beatmapMaxCombo, int scoreMaxCombo, int scoreMissCount) + { + if (beatmapMaxCombo == 0) + return 1; + + if (scoreMaxCombo == 0) + return 0; + + if (beatmapMaxCombo == scoreMaxCombo) + return 1; + + double estimatedBestCaseTotal = estimateBestCaseComboTotal(beatmapMaxCombo); + + int remainingCombo = beatmapMaxCombo - (scoreMaxCombo + scoreMissCount); + double totalDroppedScore = 0; + + int assumedLengthOfRemainingCombos = (int)Math.Floor((double)remainingCombo / scoreMissCount); + + if (assumedLengthOfRemainingCombos > 0) + { + while (remainingCombo > 0) + { + int comboLength = Math.Min(assumedLengthOfRemainingCombos, remainingCombo); + + remainingCombo -= comboLength; + totalDroppedScore += estimateDroppedComboScoreAfterMiss(comboLength); + } + } + else + { + // there are so many misses that attempting to evenly divide remaining combo results in 0 length per combo, + // i.e. all remaining judgements are combo breaks. + // in that case, presume every single remaining object is a miss and did not give any combo score. + totalDroppedScore = estimatedBestCaseTotal - estimateBestCaseComboTotal(scoreMaxCombo); + } + + return estimatedBestCaseTotal == 0 + ? 1 + : 1 - Math.Clamp(totalDroppedScore / estimatedBestCaseTotal, 0, 1); + + double estimateBestCaseComboTotal(int maxCombo) + { + if (maxCombo == 0) + return 1; + + double estimatedTotal = 0.5 * Math.Min(maxCombo, 2); + + if (maxCombo <= 2) + return estimatedTotal; + + // int_2^x log_4(t) dt + estimatedTotal += (Math.Min(maxCombo, 200) * (Math.Log(Math.Min(maxCombo, 200)) - 1) + 2 - Math.Log(4)) / Math.Log(4); + + if (maxCombo <= 200) + return estimatedTotal; + + estimatedTotal += (maxCombo - 200) * Math.Log(200) / Math.Log(4); + return estimatedTotal; + } + + double estimateDroppedComboScoreAfterMiss(int lengthOfComboAfterMiss) + { + if (lengthOfComboAfterMiss >= 200) + lengthOfComboAfterMiss = 200; + + // int_0^x (log_4(200) - log_4(t)) dt + // note that this is an pessimistic estimate, i.e. it may subtract too much if the miss happened before reaching 200 combo + return lengthOfComboAfterMiss * (1 + Math.Log(200) - Math.Log(lengthOfComboAfterMiss)) / Math.Log(4); + } + } + public static double ComputeAccuracy(ScoreInfo scoreInfo) { Ruleset ruleset = scoreInfo.Ruleset.CreateInstance(); diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index cf0a7bd54f..495edaf49c 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -36,9 +36,10 @@ namespace osu.Game.Scoring.Legacy /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. /// 30000008: Add accuracy conversion. Reconvert all scores. /// 30000009: Fix edge cases in conversion for scores which have 0.0x mod multiplier on stable. Reconvert all scores. + /// 30000010: Re-do catch scoring to mirror stable Score V2 as closely as feasible. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000009; + public const int LATEST_VERSION = 30000010; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From e2769dbda14b21e550c3bafa9446af1e406e2966 Mon Sep 17 00:00:00 2001 From: Zachary Date: Sat, 6 Jan 2024 19:29:41 +1000 Subject: [PATCH 505/567] Attempt at creating a test. --- .../TestSceneIntroMusicActionHandling.cs | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs diff --git a/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs new file mode 100644 index 0000000000..cc2b16a842 --- /dev/null +++ b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs @@ -0,0 +1,47 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Linq; +using NUnit.Framework; +using osu.Framework.Testing; +using osu.Game.Input.Bindings; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual.Menus +{ + public partial class TestSceneIntroMusicActionHandling : OsuTestScene + { + private OsuGameTestScene.TestOsuGame? game; + + private GlobalActionContainer globalActionContainer => game.ChildrenOfType().First(); + + [Test] + public void TestPauseDuringIntro() + { + AddStep("Create new game instance", () => + { + if (game?.Parent != null) + Remove(game, true); + + RecycleLocalStorage(false); + + AddGame(game = new OsuGameTestScene.TestOsuGame(LocalStorage, API)); + }); + + AddUntilStep("Wait for load", () => game?.IsLoaded ?? false); + AddUntilStep("Wait for intro", () => game?.ScreenStack.CurrentScreen is IntroScreen); + AddUntilStep("Wait for music", () => game?.MusicController.IsPlaying == true); + + // Check that pause dosesn't work during intro sequence. + AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); + AddAssert("Still playing before menu", () => game?.MusicController.IsPlaying == true); + AddUntilStep("Wait for main menu", () => game?.ScreenStack.CurrentScreen is MainMenu menu && menu.IsLoaded); + + // Check that toggling after intro still works. + AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); + AddUntilStep("Music paused", () => game?.MusicController.IsPlaying == false && game?.MusicController.UserPauseRequested == true); + AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); + AddUntilStep("Music resumed", () => game?.MusicController.IsPlaying == true && game?.MusicController.UserPauseRequested == false); + } + } +} From 14a43375a70104094f7a9d23cf091c18d1223ad3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 6 Jan 2024 20:25:03 +0900 Subject: [PATCH 506/567] Fix overall ranking text overlapping at some aspect ratios Can't confirm on the actual ranking screen due to stuff not working. Maybe it'll work tomorrow. Closes https://github.com/ppy/osu/issues/26341. --- osu.Game/Screens/Ranking/Statistics/SoloStatisticsPanel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/Statistics/SoloStatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/SoloStatisticsPanel.cs index 73b9897096..762be61853 100644 --- a/osu.Game/Screens/Ranking/Statistics/SoloStatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/SoloStatisticsPanel.cs @@ -37,7 +37,6 @@ namespace osu.Game.Screens.Ranking.Statistics RelativeSizeAxes = Axes.X, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Width = 0.5f, StatisticsUpdate = { BindTarget = StatisticsUpdate } })).ToArray(); } From d3710f0bfd0e8fb457ffbde1fb14dce853ad4f14 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 6 Jan 2024 20:44:07 +0900 Subject: [PATCH 507/567] Remove scores from song select leaderboard when leaving the screen --- osu.Game/Online/Leaderboards/Leaderboard.cs | 13 ++++++++++--- osu.Game/Screens/Select/PlaySongSelect.cs | 8 ++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/Leaderboards/Leaderboard.cs b/osu.Game/Online/Leaderboards/Leaderboard.cs index 93aa0b95a7..67f2590ad8 100644 --- a/osu.Game/Online/Leaderboards/Leaderboard.cs +++ b/osu.Game/Online/Leaderboards/Leaderboard.cs @@ -152,6 +152,15 @@ namespace osu.Game.Online.Leaderboards /// public void RefetchScores() => Scheduler.AddOnce(refetchScores); + /// + /// Clear all scores from the display. + /// + public void ClearScores() + { + cancelPendingWork(); + SetScores(null); + } + /// /// Call when a retrieval or display failure happened to show a relevant message to the user. /// @@ -220,9 +229,7 @@ namespace osu.Game.Online.Leaderboards { Debug.Assert(ThreadSafety.IsUpdateThread); - cancelPendingWork(); - - SetScores(null); + ClearScores(); setState(LeaderboardState.Retrieving); currentFetchCancellationSource = new CancellationTokenSource(); diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 7b7b8857f3..4951504ff5 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -146,6 +146,14 @@ namespace osu.Game.Screens.Select } } + public override void OnSuspending(ScreenTransitionEvent e) + { + // Scores will be refreshed on arriving at this screen. + // Clear them to avoid animation overload on returning to song select. + playBeatmapDetailArea.Leaderboard.ClearScores(); + base.OnSuspending(e); + } + public override void OnResuming(ScreenTransitionEvent e) { base.OnResuming(e); From b809d4c068f77558e30e80e0a9a8846cd41af5c9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 02:14:03 +0900 Subject: [PATCH 508/567] Remove delegate overhead from argon health display's animation updates --- osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs | 16 ++++++++++++---- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index 8acc43c091..7721f9c0c0 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Caching; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; @@ -68,11 +69,11 @@ namespace osu.Game.Screens.Play.HUD get => glowBarValue; set { - if (glowBarValue == value) + if (Precision.AlmostEquals(glowBarValue, value, 0.0001)) return; glowBarValue = value; - Scheduler.AddOnce(updatePathVertices); + pathVerticesCache.Invalidate(); } } @@ -83,11 +84,11 @@ namespace osu.Game.Screens.Play.HUD get => healthBarValue; set { - if (healthBarValue == value) + if (Precision.AlmostEquals(healthBarValue, value, 0.0001)) return; healthBarValue = value; - Scheduler.AddOnce(updatePathVertices); + pathVerticesCache.Invalidate(); } } @@ -100,6 +101,8 @@ namespace osu.Game.Screens.Play.HUD private readonly LayoutValue drawSizeLayout = new LayoutValue(Invalidation.DrawSize); + private readonly Cached pathVerticesCache = new Cached(); + public ArgonHealthDisplay() { AddLayout(drawSizeLayout); @@ -208,6 +211,9 @@ namespace osu.Game.Screens.Play.HUD drawSizeLayout.Validate(); } + if (!pathVerticesCache.IsValid) + updatePathVertices(); + mainBar.Alpha = (float)Interpolation.DampContinuously(mainBar.Alpha, Current.Value > 0 ? 1 : 0, 40, Time.Elapsed); glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, GlowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); } @@ -346,6 +352,8 @@ namespace osu.Game.Screens.Play.HUD mainBar.Vertices = healthBarVertices.Select(v => v - healthBarVertices[0]).ToList(); mainBar.Position = healthBarVertices[0]; + + pathVerticesCache.Validate(); } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index 7747036826..54aba6b8da 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -30,7 +30,7 @@ namespace osu.Game.Screens.Play.HUD public Bindable Current { get; } = new BindableDouble { MinValue = 0, - MaxValue = 1 + MaxValue = 1, }; private BindableNumber health = null!; From 9d9e6fcfdbc3c21faa7e637375ac4a9e4cdf0c51 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 03:22:19 +0900 Subject: [PATCH 509/567] Remove LINQ calls in hot paths --- osu.Game/Skinning/SkinnableSound.cs | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/SkinnableSound.cs b/osu.Game/Skinning/SkinnableSound.cs index f866a4f8ec..f153f4f8d3 100644 --- a/osu.Game/Skinning/SkinnableSound.cs +++ b/osu.Game/Skinning/SkinnableSound.cs @@ -194,9 +194,33 @@ namespace osu.Game.Skinning /// /// Whether any samples are currently playing. /// - public bool IsPlaying => samplesContainer.Any(s => s.Playing); + public bool IsPlaying + { + get + { + foreach (PoolableSkinnableSample s in samplesContainer) + { + if (s.Playing) + return true; + } - public bool IsPlayed => samplesContainer.Any(s => s.Played); + return false; + } + } + + public bool IsPlayed + { + get + { + foreach (PoolableSkinnableSample s in samplesContainer) + { + if (s.Played) + return true; + } + + return false; + } + } public IBindable AggregateVolume => samplesContainer.AggregateVolume; From 35eff639cb936188f73c34dc71e67ea4d93a061d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 03:25:00 +0900 Subject: [PATCH 510/567] Remove unnecessary second iteration over `NestedHitObjects` --- .../Objects/Drawables/DrawableSlider.cs | 7 ++----- .../Objects/Drawables/DrawableSliderRepeat.cs | 2 +- .../Objects/Drawables/ITrackSnaking.cs | 15 --------------- 3 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index b306fd38c1..0f8c9a4d36 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -246,11 +246,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Ball.UpdateProgress(completionProgress); SliderBody?.UpdateProgress(HeadCircle.IsHit ? completionProgress : 0); - foreach (DrawableHitObject hitObject in NestedHitObjects) - { - if (hitObject is ITrackSnaking s) - s.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0)); - } + foreach (DrawableSliderRepeat repeat in repeatContainer) + repeat.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0)); Size = SliderBody?.Size ?? Vector2.Zero; OriginPosition = SliderBody?.PathOffset ?? Vector2.Zero; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs index c6d4f7c4ca..3239565528 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs @@ -17,7 +17,7 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public partial class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking + public partial class DrawableSliderRepeat : DrawableOsuHitObject { public new SliderRepeat HitObject => (SliderRepeat)base.HitObject; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs deleted file mode 100644 index cae2a7c36d..0000000000 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osuTK; - -namespace osu.Game.Rulesets.Osu.Objects.Drawables -{ - /// - /// A component which tracks the current end snaking position of a slider. - /// - public interface ITrackSnaking - { - void UpdateSnakingPosition(Vector2 start, Vector2 end); - } -} From 5cc4a586acf40fd3d9be3425f875e54406a38c4d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2024 03:26:58 +0900 Subject: [PATCH 511/567] Avoid iteration over `NestedHitObjects` in silder's `Update` unless necessary --- .../Objects/Drawables/DrawableSlider.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 0f8c9a4d36..c5194025c1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -36,6 +36,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private ShakeContainer shakeContainer; + private Vector2? childAnchorPosition; + protected override IEnumerable DimmablePieces => new Drawable[] { HeadCircle, @@ -254,10 +256,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (DrawSize != Vector2.Zero) { - var childAnchorPosition = Vector2.Divide(OriginPosition, DrawSize); - foreach (var obj in NestedHitObjects) - obj.RelativeAnchorPosition = childAnchorPosition; - Ball.RelativeAnchorPosition = childAnchorPosition; + Vector2 pos = Vector2.Divide(OriginPosition, DrawSize); + + if (pos != childAnchorPosition) + { + childAnchorPosition = pos; + foreach (var obj in NestedHitObjects) + obj.RelativeAnchorPosition = pos; + Ball.RelativeAnchorPosition = pos; + } } } From 16ea7f9b7787462aa1506bac4ecb0c57090c630d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 7 Jan 2024 13:10:50 +0900 Subject: [PATCH 512/567] Avoid completely unnecessary string allocations in `ArgonCounterTextComponent` --- .../Screens/Play/HUD/ArgonCounterTextComponent.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index 266dfb3301..9d364acd59 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Bindables; @@ -35,14 +34,7 @@ namespace osu.Game.Screens.Play.HUD public LocalisableString Text { get => textPart.Text; - set - { - int remainingCount = RequiredDisplayDigits.Value - value.ToString().Count(char.IsDigit); - string remainingText = remainingCount > 0 ? new string('#', remainingCount) : string.Empty; - - wireframesPart.Text = remainingText + value; - textPart.Text = value; - } + set => textPart.Text = value; } public ArgonCounterTextComponent(Anchor anchor, LocalisableString? label = null) @@ -83,6 +75,8 @@ namespace osu.Game.Screens.Play.HUD } } }; + + RequiredDisplayDigits.BindValueChanged(digits => wireframesPart.Text = new string('#', digits.NewValue)); } private string textLookup(char c) From dc31c66f6229445dd0ebd0d6a6a52c7241da59f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 7 Jan 2024 19:49:42 +0900 Subject: [PATCH 513/567] Return null on font lookup failure instead of asserting Fallback weirdness. --- osu.Game/Skinning/LegacySpriteText.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LegacySpriteText.cs b/osu.Game/Skinning/LegacySpriteText.cs index 81db5fdf36..581e7534e4 100644 --- a/osu.Game/Skinning/LegacySpriteText.cs +++ b/osu.Game/Skinning/LegacySpriteText.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; @@ -74,7 +73,8 @@ namespace osu.Game.Skinning public ITexturedCharacterGlyph? Get(string? fontName, char character) { // We only service one font. - Debug.Assert(fontName == this.fontName); + if (fontName != this.fontName) + return null; if (cache.TryGetValue(character, out var cached)) return cached; From 962c8ba4acfc8920633f99c022824d4d58564ef9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 7 Jan 2024 20:55:28 +0900 Subject: [PATCH 514/567] Reset child anchor position cache on hitobject position change --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index c5194025c1..6cc8b8e935 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -121,7 +121,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } }); - PositionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); + PositionBindable.BindValueChanged(_ => + { + Position = HitObject.StackedPosition; + childAnchorPosition = null; + }); StackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); ScaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue)); From 7b663a27bd4d37334e428f1afc3179bc8f9da7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 10:47:22 +0100 Subject: [PATCH 515/567] Fix score conversion incorrectly assuming zero combo score in certain cases --- .../StandardisedScoreMigrationTools.cs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 9cfb9ea957..24fe147593 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -311,13 +311,22 @@ namespace osu.Game.Database long maximumLegacyBonusScore = attributes.BonusScore; double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy; - // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. - // Note that `maximumLegacyComboScore + maximumLegacyBonusScore` can actually be 0 - // when playing a beatmap with no bonus objects, with mods that have a 0.0x multiplier on stable (relax/autopilot). - // In such cases, just assume 0. - double comboProportion = maximumLegacyComboScore + maximumLegacyBonusScore > 0 - ? Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore) - : 0; + + double comboProportion; + + if (maximumLegacyComboScore + maximumLegacyBonusScore > 0) + { + // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. + comboProportion = Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore); + } + else + { + // Two possible causes: + // the beatmap has no bonus objects *AND* + // either the active mods have a zero mod multiplier, in which case assume 0, + // or the *beatmap* has a zero `difficultyPeppyStars` (or just no combo-giving objects), in which case assume 1. + comboProportion = legacyModMultiplier == 0 ? 0 : 1; + } // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; From 50eba9ebdb92790c10fda1904219525029abe0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 12:52:14 +0100 Subject: [PATCH 516/567] Reduce code duplication in test --- .../TestSceneIntroMusicActionHandling.cs | 32 +++++++------------ osu.Game/Tests/Visual/OsuGameTestScene.cs | 8 +++-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs index cc2b16a842..00c14dc797 100644 --- a/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs +++ b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs @@ -9,39 +9,31 @@ using osu.Game.Screens.Menu; namespace osu.Game.Tests.Visual.Menus { - public partial class TestSceneIntroMusicActionHandling : OsuTestScene + public partial class TestSceneIntroMusicActionHandling : OsuGameTestScene { - private OsuGameTestScene.TestOsuGame? game; + private GlobalActionContainer globalActionContainer => Game.ChildrenOfType().First(); - private GlobalActionContainer globalActionContainer => game.ChildrenOfType().First(); + public override void SetUpSteps() + { + CreateNewGame(); + // we do not want to progress to main menu immediately, hence the override and lack of `ConfirmAtMainMenu()` call here. + } [Test] public void TestPauseDuringIntro() { - AddStep("Create new game instance", () => - { - if (game?.Parent != null) - Remove(game, true); - - RecycleLocalStorage(false); - - AddGame(game = new OsuGameTestScene.TestOsuGame(LocalStorage, API)); - }); - - AddUntilStep("Wait for load", () => game?.IsLoaded ?? false); - AddUntilStep("Wait for intro", () => game?.ScreenStack.CurrentScreen is IntroScreen); - AddUntilStep("Wait for music", () => game?.MusicController.IsPlaying == true); + AddUntilStep("Wait for music", () => Game?.MusicController.IsPlaying == true); // Check that pause dosesn't work during intro sequence. AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); - AddAssert("Still playing before menu", () => game?.MusicController.IsPlaying == true); - AddUntilStep("Wait for main menu", () => game?.ScreenStack.CurrentScreen is MainMenu menu && menu.IsLoaded); + AddAssert("Still playing before menu", () => Game?.MusicController.IsPlaying == true); + AddUntilStep("Wait for main menu", () => Game?.ScreenStack.CurrentScreen is MainMenu menu && menu.IsLoaded); // Check that toggling after intro still works. AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); - AddUntilStep("Music paused", () => game?.MusicController.IsPlaying == false && game?.MusicController.UserPauseRequested == true); + AddUntilStep("Music paused", () => Game?.MusicController.IsPlaying == false && Game?.MusicController.UserPauseRequested == true); AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); - AddUntilStep("Music resumed", () => game?.MusicController.IsPlaying == true && game?.MusicController.UserPauseRequested == false); + AddUntilStep("Music resumed", () => Game?.MusicController.IsPlaying == true && Game?.MusicController.UserPauseRequested == false); } } } diff --git a/osu.Game/Tests/Visual/OsuGameTestScene.cs b/osu.Game/Tests/Visual/OsuGameTestScene.cs index 94be4a375d..947305439e 100644 --- a/osu.Game/Tests/Visual/OsuGameTestScene.cs +++ b/osu.Game/Tests/Visual/OsuGameTestScene.cs @@ -58,6 +58,12 @@ namespace osu.Game.Tests.Visual [SetUpSteps] public virtual void SetUpSteps() + { + CreateNewGame(); + ConfirmAtMainMenu(); + } + + protected void CreateNewGame() { AddStep("Create new game instance", () => { @@ -71,8 +77,6 @@ namespace osu.Game.Tests.Visual AddUntilStep("Wait for load", () => Game.IsLoaded); AddUntilStep("Wait for intro", () => Game.ScreenStack.CurrentScreen is IntroScreen); - - ConfirmAtMainMenu(); } [TearDownSteps] From b869be2f463b41781bfaefd2926c54925a33ac03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 12:52:23 +0100 Subject: [PATCH 517/567] Fix typo --- .../Visual/Menus/TestSceneIntroMusicActionHandling.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs index 00c14dc797..01aeaff1db 100644 --- a/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs +++ b/osu.Game.Tests/Visual/Menus/TestSceneIntroMusicActionHandling.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual.Menus { AddUntilStep("Wait for music", () => Game?.MusicController.IsPlaying == true); - // Check that pause dosesn't work during intro sequence. + // Check that pause doesn't work during intro sequence. AddStep("Toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay)); AddAssert("Still playing before menu", () => Game?.MusicController.IsPlaying == true); AddUntilStep("Wait for main menu", () => Game?.ScreenStack.CurrentScreen is MainMenu menu && menu.IsLoaded); From b6ce57b777983af3808b9736d86d1aba4b6faf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 12:54:16 +0100 Subject: [PATCH 518/567] Use override that was intended to steer global track control rather than local sets --- osu.Game/Screens/Menu/IntroScreen.cs | 4 ++-- osu.Game/Screens/Menu/MainMenu.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroScreen.cs b/osu.Game/Screens/Menu/IntroScreen.cs index a81e24ee88..ac7dffc241 100644 --- a/osu.Game/Screens/Menu/IntroScreen.cs +++ b/osu.Game/Screens/Menu/IntroScreen.cs @@ -95,6 +95,8 @@ namespace osu.Game.Screens.Menu Colour = Color4.Black }; + public override bool? AllowGlobalTrackControl => false; + protected IntroScreen([CanBeNull] Func createNextScreen = null) { this.createNextScreen = createNextScreen; @@ -109,8 +111,6 @@ namespace osu.Game.Screens.Menu // prevent user from changing beatmap while the intro is still running. beatmap = Beatmap.BeginLease(false); - musicController.AllowTrackControl.Value = false; - MenuVoice = config.GetBindable(OsuSetting.MenuVoice); MenuMusic = config.GetBindable(OsuSetting.MenuMusic); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index ffb68367c2..b264341cc5 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -49,6 +49,8 @@ namespace osu.Game.Screens.Menu public override bool AllowExternalScreenChange => true; + public override bool? AllowGlobalTrackControl => true; + private Screen songSelect; private MenuSideFlashes sideFlashes; @@ -241,8 +243,6 @@ namespace osu.Game.Screens.Menu { var track = musicController.CurrentTrack; - musicController.AllowTrackControl.Value = true; - // presume the track is the current beatmap's track. not sure how correct this assumption is but it has worked until now. if (!track.IsRunning) { From 8c82bb006cc5f842f943c513d70ab33d9d7234f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 09:43:53 +0100 Subject: [PATCH 519/567] Fix mania score conversion using score V1 accuracy Partially addresses https://github.com/ppy/osu/discussions/26416 As pointed out in the discussion thread above, the total score conversion process for mania was using accuracy directly from the replay. In mania accuracy is calculated differently in score V1 than in score V2, which meant that scores coming from stable were treated more favourably (due to weighting GREAT and PERFECT equally). To fix, recompute accuracy locally and use that for the accuracy portion. Note that this will still not be (and cannot be made) 100% accurate, as in stable score V2, as well as in lazer, hold notes are *two* judgements, not one as in stable score V1, meaning that full and correct score statistics are not available without playing back the replay. The effects of the change can be previewed on the following spreadsheet: https://docs.google.com/spreadsheets/d/1wxD4UwLjwcr7n9y5Yq7EN0lgiLBN93kpd4gBnAlG-E0/edit#gid=1711190356 Top 5 changed scores with replays: | score | master | this PR | replay | | :------------------------------------------------------------------------------------------------------------------------------- | ------: | ------: | ------: | | [Outlasted on Uwa!! So Holiday by toby fox [[4K] easy] (0.71\*)](https://osu.ppy.sh/scores/mania/460404716) | 935,917 | 927,269 | 920,579 | | [ag0 on Emotional Uplifting Orchestral by bradbreeck [[4K] Rocket's Normal] (0.76\*)](https://osu.ppy.sh/scores/mania/453133066) | 921,636 | 913,535 | 875,549 | | [rlarkgus on Zen Zen Zense by Gom (HoneyWorks) [[5K] Normal] (1.68\*)](https://osu.ppy.sh/scores/mania/458368312) | 934,340 | 926,787 | 918,855 | | [YuJJun on Harumachi Clover by R3 Music Box [4K Catastrophe] (1.80\*)](https://osu.ppy.sh/scores/mania/548215786) | 918,606 | 911,111 | 885,454 | | [Fritte on 45-byou by respon feat. Hatsune Miku & Megpoid [[5K] Normal] (1.52\*)](https://osu.ppy.sh/scores/mania/516079410) | 900,024 | 892,569 | 907,456 | --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 7 ++++++- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 9cfb9ea957..1ef7355027 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -444,9 +444,14 @@ namespace osu.Game.Database break; case 3: + // in the mania case accuracy actually changes between score V1 and score V2 / standardised + // (PERFECT weighting changes from 300 to 305), + // so for better accuracy recompute accuracy locally based on hit statistics and use that instead, + double scoreV2Accuracy = ComputeAccuracy(score); + convertedTotalScore = (long)Math.Round(( 850000 * comboProportion - + 150000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + + 150000 * Math.Pow(scoreV2Accuracy, 2 + 2 * scoreV2Accuracy) + bonusProportion) * modMultiplier); break; diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index cf0a7bd54f..95f2ee0552 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -36,9 +36,10 @@ namespace osu.Game.Scoring.Legacy /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. /// 30000008: Add accuracy conversion. Reconvert all scores. /// 30000009: Fix edge cases in conversion for scores which have 0.0x mod multiplier on stable. Reconvert all scores. + /// 30000010: Fix mania score V1 conversion using score V1 accuracy rather than V2 accuracy. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000009; + public const int LATEST_VERSION = 30000010; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From e77d203a24088174a47810a70112e2a4cda46fc7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 01:08:17 +0900 Subject: [PATCH 520/567] Refactor delayed load logic to hopefully read better --- .../Carousel/DrawableCarouselBeatmapSet.cs | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index 61658526db..b70278c9bb 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -199,27 +199,34 @@ namespace osu.Game.Screens.Select.Carousel Debug.Assert(Item != null); - if (loadCancellation == null && (timeSinceUnpool += Time.Elapsed) > timeUpdatingBeforeLoad) - { - loadCancellation = new CancellationTokenSource(); + // A load is already in progress if the cancellation token is non-null. + if (loadCancellation != null) + return; - LoadComponentsAsync(new CompositeDrawable[] + timeSinceUnpool += Time.Elapsed; + + // We only trigger a load after this set has been in an updating state for a set amount of time. + if (timeSinceUnpool <= timeUpdatingBeforeLoad) + return; + + loadCancellation = new CancellationTokenSource(); + + LoadComponentsAsync(new CompositeDrawable[] + { + new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) { - new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) - { - RelativeSizeAxes = Axes.Both, - }, - new SetPanelContent((CarouselBeatmapSet)Item) - { - Depth = float.MinValue, - RelativeSizeAxes = Axes.Both, - } - }, drawables => + RelativeSizeAxes = Axes.Both, + }, + new SetPanelContent((CarouselBeatmapSet)Item) { - Header.AddRange(drawables); - drawables.ForEach(d => d.FadeInFromZero(150)); - }, loadCancellation.Token); - } + Depth = float.MinValue, + RelativeSizeAxes = Axes.Both, + } + }, drawables => + { + Header.AddRange(drawables); + drawables.ForEach(d => d.FadeInFromZero(150)); + }, loadCancellation.Token); } private void updateBeatmapYPositions() From 51bd32bf7e94e74967d6852ead980b71bed6a8e6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 01:08:47 +0900 Subject: [PATCH 521/567] Restore comment regarding usage of `MinBy` --- osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index b70278c9bb..369db37e63 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -213,6 +213,7 @@ namespace osu.Game.Screens.Select.Carousel LoadComponentsAsync(new CompositeDrawable[] { + // Choice of background image matches BSS implementation (always uses the lowest `beatmap_id` from the set). new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.MinBy(b => b.OnlineID))) { RelativeSizeAxes = Axes.Both, From c4ac53002c04567f29b9bd0efe9a7ac16e72a4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 19:49:22 +0100 Subject: [PATCH 522/567] Remove loop in combo score loss estimation calculation --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index f029d85aed..07b4fe7f40 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -519,13 +519,13 @@ namespace osu.Game.Database if (assumedLengthOfRemainingCombos > 0) { - while (remainingCombo > 0) - { - int comboLength = Math.Min(assumedLengthOfRemainingCombos, remainingCombo); + int assumedCombosCount = (int)Math.Floor((double)remainingCombo / assumedLengthOfRemainingCombos); + totalDroppedScore += assumedCombosCount * estimateDroppedComboScoreAfterMiss(assumedLengthOfRemainingCombos); - remainingCombo -= comboLength; - totalDroppedScore += estimateDroppedComboScoreAfterMiss(comboLength); - } + remainingCombo -= assumedCombosCount * assumedLengthOfRemainingCombos; + + if (remainingCombo > 0) + totalDroppedScore += estimateDroppedComboScoreAfterMiss(remainingCombo); } else { From 8a87301c55262f888017cb2ce5ed23d04429ab05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 21:33:25 +0100 Subject: [PATCH 523/567] Add test for crashing scenario --- .../Navigation/TestSceneScreenNavigation.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index a0069f55c7..8cb993eff2 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -938,6 +938,35 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("touch device mod still active", () => Game.SelectedMods.Value, () => Has.One.InstanceOf()); } + [Test] + public void TestExitSongSelectAndImmediatelyClickLogo() + { + Screens.Select.SongSelect songSelect = null; + PushAndConfirm(() => songSelect = new TestPlaySongSelect()); + AddUntilStep("wait for song select", () => songSelect.BeatmapSetsLoaded); + + AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely()); + + AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault); + + AddStep("press escape and then click logo immediately", () => + { + InputManager.Key(Key.Escape); + clickLogoWhenNotCurrent(); + }); + + void clickLogoWhenNotCurrent() + { + if (songSelect.IsCurrentScreen()) + Scheduler.AddOnce(clickLogoWhenNotCurrent); + else + { + InputManager.MoveMouseTo(Game.ChildrenOfType().Single()); + InputManager.Click(MouseButton.Left); + } + } + } + private Func playToResults() { var player = playToCompletion(); From 58db39ec3206a34e1b8a0cbdbe196059dd4b8306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 21:37:25 +0100 Subject: [PATCH 524/567] Fix crash when clicking osu! logo in song select immediately after exiting Closes https://github.com/ppy/osu/issues/26415. The crash report with incomplete log was backwards, the exit comes first. Sentry events and the reproducing test in 8a87301c55262f888017cb2ce5ed23d04429ab05 confirm this. --- osu.Game/Screens/Select/PlaySongSelect.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 4951504ff5..3cf8de5267 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -92,6 +92,9 @@ namespace osu.Game.Screens.Select { if (playerLoader != null) return false; + if (!this.IsCurrentScreen()) + return false; + modsAtGameplayStart = Mods.Value; // Ctrl+Enter should start map with autoplay enabled. From 67df7b33fb6c355ad41382fae8323c5c9e3d0c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 21:51:01 +0100 Subject: [PATCH 525/567] Add failing test coverage for not attempting to upgrade custom ruleset scores --- .../BackgroundDataStoreProcessorTests.cs | 30 +++++++++++++++++++ osu.Game/BackgroundDataStoreProcessor.cs | 4 ++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs index 43ce7200d2..9dbfde7bce 100644 --- a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs +++ b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; @@ -182,9 +183,38 @@ namespace osu.Game.Tests.Database AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000002)); } + [Test] + public void TestCustomRulesetScoreNotSubjectToUpgrades([Values] bool available) + { + RulesetInfo rulesetInfo = null!; + ScoreInfo scoreInfo = null!; + TestBackgroundDataStoreProcessor processor = null!; + + AddStep("Add unavailable ruleset", () => Realm.Write(r => r.Add(rulesetInfo = new RulesetInfo + { + ShortName = Guid.NewGuid().ToString(), + Available = available + }))); + + AddStep("Add score for unavailable ruleset", () => Realm.Write(r => r.Add(scoreInfo = new ScoreInfo( + ruleset: rulesetInfo, + beatmap: r.All().First()) + { + TotalScoreVersion = 30000001 + }))); + + AddStep("Run background processor", () => Add(processor = new TestBackgroundDataStoreProcessor())); + AddUntilStep("Wait for completion", () => processor.Completed); + + AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False); + AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000001)); + } + public partial class TestBackgroundDataStoreProcessor : BackgroundDataStoreProcessor { protected override int TimeToSleepDuringGameplay => 10; + + public bool Completed => ProcessingTask.IsCompleted; } } } diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index a748a7422a..969062be57 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -28,6 +28,8 @@ namespace osu.Game /// public partial class BackgroundDataStoreProcessor : Component { + protected Task ProcessingTask = null!; + [Resolved] private RulesetStore rulesetStore { get; set; } = null!; @@ -61,7 +63,7 @@ namespace osu.Game { base.LoadComplete(); - Task.Factory.StartNew(() => + ProcessingTask = Task.Factory.StartNew(() => { Logger.Log("Beginning background data store processing.."); From 388f6599e0264d640d4da1fda0e27441212ca389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 21:54:10 +0100 Subject: [PATCH 526/567] Add failing test for not attempting to upgrade non-legacy scores This was a source of confusion for users previously, wondering why their non-legacy (non-stable) scores weren't being converted in line with new scoring changes, when it was never actually our intention to support anything of the sort. --- .../BackgroundDataStoreProcessorTests.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs index 9dbfde7bce..8b066f860f 100644 --- a/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs +++ b/osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs @@ -210,6 +210,31 @@ namespace osu.Game.Tests.Database AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000001)); } + [Test] + public void TestNonLegacyScoreNotSubjectToUpgrades() + { + ScoreInfo scoreInfo = null!; + TestBackgroundDataStoreProcessor processor = null!; + + AddStep("Add score which requires upgrade (and has beatmap)", () => + { + Realm.Write(r => + { + r.Add(scoreInfo = new ScoreInfo(ruleset: r.All().First(), beatmap: r.All().First()) + { + TotalScoreVersion = 30000005, + LegacyTotalScore = 123456, + }); + }); + }); + + AddStep("Run background processor", () => Add(processor = new TestBackgroundDataStoreProcessor())); + AddUntilStep("Wait for completion", () => processor.Completed); + + AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False); + AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000005)); + } + public partial class TestBackgroundDataStoreProcessor : BackgroundDataStoreProcessor { protected override int TimeToSleepDuringGameplay => 10; From aa83b84bb225781adccc15f4276a74901ed03397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 22:34:41 +0100 Subject: [PATCH 527/567] Fix Cinema mod being compatible with mods that can force failure Addresses https://github.com/ppy/osu/pull/26080#issuecomment-1868833214. --- osu.Game/Rulesets/Mods/ModCinema.cs | 2 +- osu.Game/Rulesets/Mods/ModFailCondition.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index dbb37e0af6..7c88a8a588 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage? Icon => OsuIcon.ModCinema; public override LocalisableString Description => "Watch the video without visual distractions."; - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail) }).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModFailCondition) }).ToArray(); public void ApplyToHUD(HUDOverlay overlay) { diff --git a/osu.Game/Rulesets/Mods/ModFailCondition.cs b/osu.Game/Rulesets/Mods/ModFailCondition.cs index 471c3bfe8d..0b229766c1 100644 --- a/osu.Game/Rulesets/Mods/ModFailCondition.cs +++ b/osu.Game/Rulesets/Mods/ModFailCondition.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods { public abstract class ModFailCondition : Mod, IApplicableToHealthProcessor, IApplicableFailOverride { - public override Type[] IncompatibleMods => new[] { typeof(ModNoFail) }; + public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModCinema) }; [SettingSource("Restart on fail", "Automatically restarts when failed.")] public BindableBool Restart { get; } = new BindableBool(); From 4f7dcb3a5022cb533cc467d974a7f382d1cf285e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jan 2024 22:07:33 +0100 Subject: [PATCH 528/567] Do not attempt to recalculate non-legacy scores or scores set on custom rulesets Addresses discussions such as https://github.com/ppy/osu/discussions/26407 or https://github.com/ppy/osu/discussions/25914 wherein: - the game would attempt to convert scores for custom rulesets, which makes no sense, especially so when they're not there, - the game would also "recalculate" lazer scores, but that was never the intention or was never supported; the game would just increment the score version on those but still include them in the converted tally. --- osu.Game/BackgroundDataStoreProcessor.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs index 969062be57..fc7db13d41 100644 --- a/osu.Game/BackgroundDataStoreProcessor.cs +++ b/osu.Game/BackgroundDataStoreProcessor.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.Online.API; using osu.Game.Overlays; using osu.Game.Overlays.Notifications; @@ -28,7 +29,7 @@ namespace osu.Game /// public partial class BackgroundDataStoreProcessor : Component { - protected Task ProcessingTask = null!; + protected Task ProcessingTask { get; private set; } = null!; [Resolved] private RulesetStore rulesetStore { get; set; } = null!; @@ -316,10 +317,17 @@ namespace osu.Game { Logger.Log("Querying for scores that need total score conversion..."); - HashSet scoreIds = realmAccess.Run(r => new HashSet(r.All() - .Where(s => !s.BackgroundReprocessingFailed && s.BeatmapInfo != null - && s.TotalScoreVersion < LegacyScoreEncoder.LATEST_VERSION) - .AsEnumerable().Select(s => s.ID))); + HashSet scoreIds = realmAccess.Run(r => new HashSet( + r.All() + .Where(s => !s.BackgroundReprocessingFailed + && s.BeatmapInfo != null + && s.IsLegacyScore + && s.TotalScoreVersion < LegacyScoreEncoder.LATEST_VERSION) + .AsEnumerable() + // must be done after materialisation, as realm doesn't want to support + // nested property predicates + .Where(s => s.Ruleset.IsLegacyRuleset()) + .Select(s => s.ID))); Logger.Log($"Found {scoreIds.Count} scores which require total score conversion."); From 58619f168458ead922914536a651951595f33875 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 8 Jan 2024 14:16:05 -0800 Subject: [PATCH 529/567] Fix wiki main page not displaying custom layout --- osu.Game/Overlays/WikiOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/WikiOverlay.cs b/osu.Game/Overlays/WikiOverlay.cs index 440e451201..a8d9cdcdb2 100644 --- a/osu.Game/Overlays/WikiOverlay.cs +++ b/osu.Game/Overlays/WikiOverlay.cs @@ -137,7 +137,7 @@ namespace osu.Game.Overlays wikiData.Value = response; path.Value = response.Path; - if (response.Layout == index_path) + if (response.Layout == index_path.ToLowerInvariant()) { LoadDisplay(new WikiMainPage { From d6ba7a9c6eeab7c2c4889249df4f7280f28515d2 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 8 Jan 2024 14:24:56 -0800 Subject: [PATCH 530/567] Centralise `INDEX_PATH` to `WikiOverlay` --- osu.Game/Overlays/Wiki/WikiHeader.cs | 4 +--- osu.Game/Overlays/WikiOverlay.cs | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Wiki/WikiHeader.cs b/osu.Game/Overlays/Wiki/WikiHeader.cs index 55be05ed7a..d64d6b934a 100644 --- a/osu.Game/Overlays/Wiki/WikiHeader.cs +++ b/osu.Game/Overlays/Wiki/WikiHeader.cs @@ -17,8 +17,6 @@ namespace osu.Game.Overlays.Wiki { public partial class WikiHeader : BreadcrumbControlOverlayHeader { - private const string index_path = "Main_page"; - public static LocalisableString IndexPageString => LayoutStrings.HeaderHelpIndex; public readonly Bindable WikiPageData = new Bindable(); @@ -45,7 +43,7 @@ namespace osu.Game.Overlays.Wiki TabControl.AddItem(IndexPageString); - if (e.NewValue.Path == index_path) + if (e.NewValue.Path == WikiOverlay.INDEX_PATH) { Current.Value = IndexPageString; return; diff --git a/osu.Game/Overlays/WikiOverlay.cs b/osu.Game/Overlays/WikiOverlay.cs index a8d9cdcdb2..3777e83cde 100644 --- a/osu.Game/Overlays/WikiOverlay.cs +++ b/osu.Game/Overlays/WikiOverlay.cs @@ -19,11 +19,11 @@ namespace osu.Game.Overlays { public partial class WikiOverlay : OnlineOverlay { - private const string index_path = "Main_page"; + public const string INDEX_PATH = @"Main_page"; public string CurrentPath => path.Value; - private readonly Bindable path = new Bindable(index_path); + private readonly Bindable path = new Bindable(INDEX_PATH); private readonly Bindable wikiData = new Bindable(); @@ -43,7 +43,7 @@ namespace osu.Game.Overlays { } - public void ShowPage(string pagePath = index_path) + public void ShowPage(string pagePath = INDEX_PATH) { path.Value = pagePath.Trim('/'); Show(); @@ -137,7 +137,7 @@ namespace osu.Game.Overlays wikiData.Value = response; path.Value = response.Path; - if (response.Layout == index_path.ToLowerInvariant()) + if (response.Layout == INDEX_PATH.ToLowerInvariant()) { LoadDisplay(new WikiMainPage { @@ -161,7 +161,7 @@ namespace osu.Game.Overlays path.Value = "error"; LoadDisplay(articlePage = new WikiArticlePage($@"{api.WebsiteRootUrl}/wiki/", - $"Something went wrong when trying to fetch page \"{originalPath}\".\n\n[Return to the main page](Main_page).")); + $"Something went wrong when trying to fetch page \"{originalPath}\".\n\n[Return to the main page]({INDEX_PATH}).")); } private void showParentPage() From b03813d3b40e0a279bb8ef6800cd587162adf0f2 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 8 Jan 2024 14:36:08 -0800 Subject: [PATCH 531/567] Update casing of hardcoded "Main_page" string in tests --- osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs | 4 ++-- osu.Game.Tests/Visual/Online/TestSceneWikiMainPage.cs | 2 +- .../Visual/Online/TestSceneWikiMarkdownContainer.cs | 4 ++-- osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs index 4e71c5977e..40eda3f3dc 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs @@ -24,8 +24,8 @@ namespace osu.Game.Tests.Visual.Online [Cached] private readonly Bindable wikiPageData = new Bindable(new APIWikiPage { - Title = "Main Page", - Path = "Main_Page", + Title = "Main page", + Path = "Main_page", }); private TestHeader header; diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiMainPage.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiMainPage.cs index 9967be73e8..7b4eadd46d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiMainPage.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiMainPage.cs @@ -36,7 +36,7 @@ namespace osu.Game.Tests.Visual.Online }; } - // From https://osu.ppy.sh/api/v2/wiki/en/Main_Page + // From https://osu.ppy.sh/api/v2/wiki/en/Main_page private const string main_page_markdown = "---\nlayout: main_page\n---\n\n\n\n
\nWelcome to the osu! wiki, a project containing a wide range of osu! related information.\n
\n\n
\n
\n\n# Getting started\n\n[Welcome](/wiki/Welcome) • [Installation](/wiki/Installation) • [Registration](/wiki/Registration) • [Help Centre](/wiki/Help_Centre) • [FAQ](/wiki/FAQ)\n\n
\n
\n\n# Game client\n\n[Interface](/wiki/Interface) • [Options](/wiki/Options) • [Visual settings](/wiki/Visual_Settings) • [Shortcut key reference](/wiki/Shortcut_key_reference) • [Configuration file](/wiki/osu!_Program_Files/User_Configuration_File) • [Program files](/wiki/osu!_Program_Files)\n\n[File formats](/wiki/osu!_File_Formats): [.osz](/wiki/osu!_File_Formats/Osz_(file_format)) • [.osk](/wiki/osu!_File_Formats/Osk_(file_format)) • [.osr](/wiki/osu!_File_Formats/Osr_(file_format)) • [.osu](/wiki/osu!_File_Formats/Osu_(file_format)) • [.osb](/wiki/osu!_File_Formats/Osb_(file_format)) • [.db](/wiki/osu!_File_Formats/Db_(file_format))\n\n
\n
\n\n# Gameplay\n\n[Game modes](/wiki/Game_mode): [osu!](/wiki/Game_mode/osu!) • [osu!taiko](/wiki/Game_mode/osu!taiko) • [osu!catch](/wiki/Game_mode/osu!catch) • [osu!mania](/wiki/Game_mode/osu!mania)\n\n[Beatmap](/wiki/Beatmap) • [Hit object](/wiki/Hit_object) • [Mods](/wiki/Game_modifier) • [Score](/wiki/Score) • [Replay](/wiki/Replay) • [Multi](/wiki/Multi)\n\n
\n
\n\n# [Beatmap editor](/wiki/Beatmap_Editor)\n\nSections: [Compose](/wiki/Beatmap_Editor/Compose) • [Design](/wiki/Beatmap_Editor/Design) • [Timing](/wiki/Beatmap_Editor/Timing) • [Song setup](/wiki/Beatmap_Editor/Song_Setup)\n\nComponents: [AiMod](/wiki/Beatmap_Editor/AiMod) • [Beat snap divisor](/wiki/Beatmap_Editor/Beat_Snap_Divisor) • [Distance snap](/wiki/Beatmap_Editor/Distance_Snap) • [Menu](/wiki/Beatmap_Editor/Menu) • [SB load](/wiki/Beatmap_Editor/SB_Load) • [Timelines](/wiki/Beatmap_Editor/Timelines)\n\n[Beatmapping](/wiki/Beatmapping) • [Difficulty](/wiki/Beatmap/Difficulty) • [Mapping techniques](/wiki/Mapping_Techniques) • [Storyboarding](/wiki/Storyboarding)\n\n
\n
\n\n# Beatmap submission and ranking\n\n[Submission](/wiki/Submission) • [Modding](/wiki/Modding) • [Ranking procedure](/wiki/Beatmap_ranking_procedure) • [Mappers' Guild](/wiki/Mappers_Guild) • [Project Loved](/wiki/Project_Loved)\n\n[Ranking criteria](/wiki/Ranking_Criteria): [osu!](/wiki/Ranking_Criteria/osu!) • [osu!taiko](/wiki/Ranking_Criteria/osu!taiko) • [osu!catch](/wiki/Ranking_Criteria/osu!catch) • [osu!mania](/wiki/Ranking_Criteria/osu!mania)\n\n
\n
\n\n# Community\n\n[Tournaments](/wiki/Tournaments) • [Skinning](/wiki/Skinning) • [Projects](/wiki/Projects) • [Guides](/wiki/Guides) • [osu!dev Discord server](/wiki/osu!dev_Discord_server) • [How you can help](/wiki/How_You_Can_Help!) • [Glossary](/wiki/Glossary)\n\n
\n
\n\n# People\n\n[The Team](/wiki/People/The_Team): [Developers](/wiki/People/The_Team/Developers) • [Global Moderation Team](/wiki/People/The_Team/Global_Moderation_Team) • [Support Team](/wiki/People/The_Team/Support_Team) • [Nomination Assessment Team](/wiki/People/The_Team/Nomination_Assessment_Team) • [Beatmap Nominators](/wiki/People/The_Team/Beatmap_Nominators) • [osu! Alumni](/wiki/People/The_Team/osu!_Alumni) • [Project Loved Team](/wiki/People/The_Team/Project_Loved_Team)\n\nOrganisations: [osu! UCI](/wiki/Organisations/osu!_UCI)\n\n[Community Contributors](/wiki/People/Community_Contributors) • [Users with unique titles](/wiki/People/Users_with_unique_titles)\n\n
\n
\n\n# For developers\n\n[API](/wiki/osu!api) • [Bot account](/wiki/Bot_account) • [Brand identity guidelines](/wiki/Brand_identity_guidelines)\n\n
\n
\n\n# About the wiki\n\n[Sitemap](/wiki/Sitemap) • [Contribution guide](/wiki/osu!_wiki_Contribution_Guide) • [Article styling criteria](/wiki/Article_Styling_Criteria) • [News styling criteria](/wiki/News_Styling_Criteria)\n\n
\n
\n"; } diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs index 6c87553971..8909305602 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiMarkdownContainer.cs @@ -69,8 +69,8 @@ namespace osu.Game.Tests.Visual.Online { AddStep("set current path", () => markdownContainer.CurrentPath = $"{API.WebsiteRootUrl}/wiki/Article_styling_criteria/"); - AddStep("set '/wiki/Main_Page''", () => markdownContainer.Text = "[wiki main page](/wiki/Main_Page)"); - AddAssert("check url", () => markdownContainer.Link.Url == $"{API.WebsiteRootUrl}/wiki/Main_Page"); + AddStep("set '/wiki/Main_page''", () => markdownContainer.Text = "[wiki main page](/wiki/Main_page)"); + AddAssert("check url", () => markdownContainer.Link.Url == $"{API.WebsiteRootUrl}/wiki/Main_page"); AddStep("set '../FAQ''", () => markdownContainer.Text = "[FAQ](../FAQ)"); AddAssert("check url", () => markdownContainer.Link.Url == $"{API.WebsiteRootUrl}/wiki/FAQ"); diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs index 79c7e3a22e..352f100f3b 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs @@ -107,12 +107,12 @@ namespace osu.Game.Tests.Visual.Online }; }); - // From https://osu.ppy.sh/api/v2/wiki/en/Main_Page + // From https://osu.ppy.sh/api/v2/wiki/en/Main_page private APIWikiPage responseMainPage => new APIWikiPage { - Title = "Main Page", + Title = "Main page", Layout = "main_page", - Path = "Main_Page", + Path = "Main_page", Locale = "en", Subtitle = null, Markdown = From 7d57a668aba2032be4c000561be60f17674c4732 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 13:12:54 +0900 Subject: [PATCH 532/567] Use main page constant in more places --- osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs | 2 +- osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs index 40eda3f3dc..d259322d4a 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiHeader.cs @@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Online private readonly Bindable wikiPageData = new Bindable(new APIWikiPage { Title = "Main page", - Path = "Main_page", + Path = WikiOverlay.INDEX_PATH, }); private TestHeader header; diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs index 352f100f3b..8765d8485a 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs @@ -11,6 +11,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; +using osu.Game.Overlays.Wiki; namespace osu.Game.Tests.Visual.Online { @@ -111,8 +112,8 @@ namespace osu.Game.Tests.Visual.Online private APIWikiPage responseMainPage => new APIWikiPage { Title = "Main page", - Layout = "main_page", - Path = "Main_page", + Layout = WikiOverlay.INDEX_PATH.ToLowerInvariant(), // custom classes are always lower snake. + Path = WikiOverlay.INDEX_PATH, Locale = "en", Subtitle = null, Markdown = From 172fe53099bf4e2e26e7acc9dc0dc7708b0ea39d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 13:13:32 +0900 Subject: [PATCH 533/567] Use better method of ignore case comparison --- osu.Game/Overlays/WikiOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/WikiOverlay.cs b/osu.Game/Overlays/WikiOverlay.cs index 3777e83cde..ffbc168fb7 100644 --- a/osu.Game/Overlays/WikiOverlay.cs +++ b/osu.Game/Overlays/WikiOverlay.cs @@ -137,7 +137,7 @@ namespace osu.Game.Overlays wikiData.Value = response; path.Value = response.Path; - if (response.Layout == INDEX_PATH.ToLowerInvariant()) + if (response.Layout.Equals(INDEX_PATH, StringComparison.OrdinalIgnoreCase)) { LoadDisplay(new WikiMainPage { From 3f5899dae041e66d8292acc757e25556a2172926 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 14:05:59 +0900 Subject: [PATCH 534/567] Fix incorrect implementation of wireframe digits --- .../Play/HUD/ArgonCounterTextComponent.cs | 1 - .../Screens/Play/HUD/ArgonScoreCounter.cs | 36 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index 9d364acd59..f88874f872 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs b/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs index 005f7e36a7..f7ca218767 100644 --- a/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonScoreCounter.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Bindables; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; @@ -15,6 +16,8 @@ namespace osu.Game.Screens.Play.HUD { public partial class ArgonScoreCounter : GameplayScoreCounter, ISerialisableDrawable { + private ArgonScoreTextComponent scoreText = null!; + protected override double RollingDuration => 500; protected override Easing RollingEasing => Easing.OutQuint; @@ -33,13 +36,42 @@ namespace osu.Game.Screens.Play.HUD protected override LocalisableString FormatCount(long count) => count.ToLocalisableString(); - protected override IHasText CreateText() => new ArgonScoreTextComponent(Anchor.TopRight, BeatmapsetsStrings.ShowScoreboardHeadersScore.ToUpper()) + protected override IHasText CreateText() => scoreText = new ArgonScoreTextComponent(Anchor.TopRight, BeatmapsetsStrings.ShowScoreboardHeadersScore.ToUpper()) { - RequiredDisplayDigits = { BindTarget = RequiredDisplayDigits }, WireframeOpacity = { BindTarget = WireframeOpacity }, ShowLabel = { BindTarget = ShowLabel }, }; + public ArgonScoreCounter() + { + RequiredDisplayDigits.BindValueChanged(_ => updateWireframe()); + } + + public override long DisplayedCount + { + get => base.DisplayedCount; + set + { + base.DisplayedCount = value; + updateWireframe(); + } + } + + private void updateWireframe() + { + scoreText.RequiredDisplayDigits.Value = + Math.Max(RequiredDisplayDigits.Value, getDigitsRequiredForDisplayCount()); + } + + private int getDigitsRequiredForDisplayCount() + { + int digitsRequired = 1; + long c = DisplayedCount; + while ((c /= 10) > 0) + digitsRequired++; + return digitsRequired; + } + private partial class ArgonScoreTextComponent : ArgonCounterTextComponent { public ArgonScoreTextComponent(Anchor anchor, LocalisableString? label = null) From 765d41faa9940e8ae5878babe326cc76f39ba930 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 14:06:59 +0900 Subject: [PATCH 535/567] Change second occurrence of debug.assert with early return for fallback safety --- osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index f88874f872..a11f2f01cd 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -159,7 +159,8 @@ namespace osu.Game.Screens.Play.HUD public ITexturedCharacterGlyph? Get(string? fontName, char character) { // We only service one font. - Debug.Assert(fontName == this.fontName); + if (fontName != this.fontName) + return null; if (cache.TryGetValue(character, out var cached)) return cached; From 5970a68e2d12f4f8fc3a118cf68da7a69c1f1fcf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 14:17:33 +0900 Subject: [PATCH 536/567] Use invalidation based logic for child anchor position updpates in `DrawableSlider` --- .../Objects/Drawables/DrawableSlider.cs | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 6cc8b8e935..4099d47d61 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -11,6 +11,7 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Layout; using osu.Game.Audio; using osu.Game.Graphics.Containers; using osu.Game.Rulesets.Objects; @@ -36,8 +37,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private ShakeContainer shakeContainer; - private Vector2? childAnchorPosition; - protected override IEnumerable DimmablePieces => new Drawable[] { HeadCircle, @@ -68,6 +67,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Container repeatContainer; private PausableSkinnableSound slidingSample; + private readonly LayoutValue drawSizeLayout; + public DrawableSlider() : this(null) { @@ -84,6 +85,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AlwaysPresent = true, Alpha = 0 }; + AddLayout(drawSizeLayout = new LayoutValue(Invalidation.DrawSize | Invalidation.MiscGeometry)); } [BackgroundDependencyLoader] @@ -121,11 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } }); - PositionBindable.BindValueChanged(_ => - { - Position = HitObject.StackedPosition; - childAnchorPosition = null; - }); + PositionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); StackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); ScaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue)); @@ -258,17 +256,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Size = SliderBody?.Size ?? Vector2.Zero; OriginPosition = SliderBody?.PathOffset ?? Vector2.Zero; - if (DrawSize != Vector2.Zero) + if (!drawSizeLayout.IsValid) { Vector2 pos = Vector2.Divide(OriginPosition, DrawSize); + foreach (var obj in NestedHitObjects) + obj.RelativeAnchorPosition = pos; + Ball.RelativeAnchorPosition = pos; - if (pos != childAnchorPosition) - { - childAnchorPosition = pos; - foreach (var obj in NestedHitObjects) - obj.RelativeAnchorPosition = pos; - Ball.RelativeAnchorPosition = pos; - } + drawSizeLayout.Validate(); } } From 79ff767eba341cba9e4c81e3410eacf75eb4cd07 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 14:51:30 +0900 Subject: [PATCH 537/567] Remove unused using --- osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs index 8765d8485a..e70d35f74a 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneWikiOverlay.cs @@ -11,7 +11,6 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; -using osu.Game.Overlays.Wiki; namespace osu.Game.Tests.Visual.Online { From 19d1fff5362b3652eb70c366f7ea361f89af4737 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 15:37:29 +0900 Subject: [PATCH 538/567] Use native query to avoid huge overheads when cleaning up realm files --- osu.Game/Database/RealmFileStore.cs | 9 +++------ osu.Game/Models/RealmFile.cs | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game/Database/RealmFileStore.cs b/osu.Game/Database/RealmFileStore.cs index 1da64d5be8..f1ed3f4b63 100644 --- a/osu.Game/Database/RealmFileStore.cs +++ b/osu.Game/Database/RealmFileStore.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Diagnostics; using System.IO; using System.Linq; using osu.Framework.Extensions; @@ -98,15 +99,11 @@ namespace osu.Game.Database // can potentially be run asynchronously, although we will need to consider operation order for disk deletion vs realm removal. realm.Write(r => { - // TODO: consider using a realm native query to avoid iterating all files (https://github.com/realm/realm-dotnet/issues/2659#issuecomment-927823707) - var files = r.All().ToList(); - - foreach (var file in files) + foreach (var file in r.All().Filter("Usages.@count = 0")) { totalFiles++; - if (file.BacklinksCount > 0) - continue; + Debug.Assert(file.BacklinksCount == 0); try { diff --git a/osu.Game/Models/RealmFile.cs b/osu.Game/Models/RealmFile.cs index 2faa3f0ca6..4d1642fb5f 100644 --- a/osu.Game/Models/RealmFile.cs +++ b/osu.Game/Models/RealmFile.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Linq; using osu.Game.IO; using Realms; @@ -11,5 +12,8 @@ namespace osu.Game.Models { [PrimaryKey] public string Hash { get; set; } = string.Empty; + + [Backlink(nameof(RealmNamedFileUsage.File))] + public IQueryable Usages { get; } = null!; } } From 1837b31f9b5e1d3a2b829fe97105a0abcc882e8b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 16:38:02 +0900 Subject: [PATCH 539/567] Remove usage of `HealthDisplay.BindValueChanged` Health updates very often when using HP drain. Let's avoid bindable overheads. --- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 29 ++++++++--- osu.Game/Skinning/LegacyHealthDisplay.cs | 56 ++++++++++------------ 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index 7747036826..a20121b20b 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -56,13 +56,6 @@ namespace osu.Game.Screens.Play.HUD // Don't bind directly so we can animate the startup procedure. health = HealthProcessor.Health.GetBoundCopy(); - health.BindValueChanged(h => - { - if (initialIncrease != null) - FinishInitialAnimation(h.OldValue); - - Current.Value = h.NewValue; - }); if (hudOverlay != null) showHealthBar.BindTo(hudOverlay.ShowHealthBar); @@ -76,6 +69,28 @@ namespace osu.Game.Screens.Play.HUD Current.Value = health.Value; } + protected override void Update() + { + base.Update(); + + // Health changes every frame in draining situations. + // Manually handle value changes to avoid bindable event flow overhead. + if (health.Value != Current.Value) + { + if (initialIncrease != null) + FinishInitialAnimation(Current.Value); + + Current.Value = health.Value; + + if (health.Value > Current.Value) + HealthIncreased(); + } + } + + protected virtual void HealthIncreased() + { + } + private void startInitialAnimation() { if (Current.Value >= health.Value) diff --git a/osu.Game/Skinning/LegacyHealthDisplay.cs b/osu.Game/Skinning/LegacyHealthDisplay.cs index 845fc77394..00e19c4f76 100644 --- a/osu.Game/Skinning/LegacyHealthDisplay.cs +++ b/osu.Game/Skinning/LegacyHealthDisplay.cs @@ -79,7 +79,13 @@ namespace osu.Game.Skinning marker.Position = fill.Position + new Vector2(fill.DrawWidth, isNewStyle ? fill.DrawHeight / 2 : 0); } - protected override void Flash() => marker.Flash(); + protected override void HealthIncreased() + { + marker.Bulge(); + base.HealthIncreased(); + } + + protected override void Flash() => marker.Flash(Current.Value >= epic_cutoff); private static Texture getTexture(ISkin skin, string name) => skin?.GetTexture($"scorebar-{name}"); @@ -113,19 +119,16 @@ namespace osu.Game.Skinning Origin = Anchor.Centre, }; - protected override void LoadComplete() + protected override void Update() { - base.LoadComplete(); + base.Update(); - Current.BindValueChanged(hp => - { - if (hp.NewValue < 0.2f) - Main.Texture = superDangerTexture; - else if (hp.NewValue < epic_cutoff) - Main.Texture = dangerTexture; - else - Main.Texture = normalTexture; - }); + if (Current.Value < 0.2f) + Main.Texture = superDangerTexture; + else if (Current.Value < epic_cutoff) + Main.Texture = dangerTexture; + else + Main.Texture = normalTexture; } } @@ -226,37 +229,30 @@ namespace osu.Game.Skinning public abstract Sprite CreateSprite(); - protected override void LoadComplete() + public override void Flash(bool isEpic) { - base.LoadComplete(); - - Current.BindValueChanged(val => - { - if (val.NewValue > val.OldValue) - bulgeMain(); - }); - } - - public override void Flash() - { - bulgeMain(); - - bool isEpic = Current.Value >= epic_cutoff; - + Bulge(); explode.Blending = isEpic ? BlendingParameters.Additive : BlendingParameters.Inherit; explode.ScaleTo(1).Then().ScaleTo(isEpic ? 2 : 1.6f, 120); explode.FadeOutFromOne(120); } - private void bulgeMain() => + public override void Bulge() + { + base.Bulge(); Main.ScaleTo(1.4f).Then().ScaleTo(1, 200, Easing.Out); + } } public partial class LegacyHealthPiece : CompositeDrawable { public Bindable Current { get; } = new Bindable(); - public virtual void Flash() + public virtual void Bulge() + { + } + + public virtual void Flash(bool isEpic) { } } From d83b8dbdaf489320b1ef2632e7b9fba5a3d7c26a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 16:50:27 +0900 Subject: [PATCH 540/567] Refactor `ArgonHealthDisplay` to user interpolation and less bindable events --- .../Screens/Play/HUD/ArgonHealthDisplay.cs | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index 8acc43c091..f15789601c 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -158,7 +158,6 @@ namespace osu.Game.Screens.Play.HUD base.LoadComplete(); HealthProcessor.NewJudgement += onNewJudgement; - Current.BindValueChanged(onCurrentChanged, true); // we're about to set `RelativeSizeAxes` depending on the value of `UseRelativeSize`. // setting `RelativeSizeAxes` internally transforms absolute sizing to relative and back to keep the size the same, @@ -173,31 +172,6 @@ namespace osu.Game.Screens.Play.HUD private void onNewJudgement(JudgementResult result) => pendingMissAnimation |= !result.IsHit; - private void onCurrentChanged(ValueChangedEvent valueChangedEvent) - // schedule display updates one frame later to ensure we know the judgement result causing this change (if there is one). - => Scheduler.AddOnce(updateDisplay); - - private void updateDisplay() - { - double newHealth = Current.Value; - - if (newHealth >= GlowBarValue) - finishMissDisplay(); - - double time = newHealth > GlowBarValue ? 500 : 250; - - // TODO: this should probably use interpolation in update. - this.TransformTo(nameof(HealthBarValue), newHealth, time, Easing.OutQuint); - - if (pendingMissAnimation && newHealth < GlowBarValue) - triggerMissDisplay(); - - pendingMissAnimation = false; - - if (!displayingMiss) - this.TransformTo(nameof(GlowBarValue), newHealth, time, Easing.OutQuint); - } - protected override void Update() { base.Update(); @@ -210,6 +184,19 @@ namespace osu.Game.Screens.Play.HUD mainBar.Alpha = (float)Interpolation.DampContinuously(mainBar.Alpha, Current.Value > 0 ? 1 : 0, 40, Time.Elapsed); glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, GlowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); + + double newHealth = Current.Value; + + if (newHealth >= GlowBarValue) + finishMissDisplay(); + + if (pendingMissAnimation && newHealth < GlowBarValue) + triggerMissDisplay(); + pendingMissAnimation = false; + + HealthBarValue = Interpolation.DampContinuously(HealthBarValue, newHealth, 50, Time.Elapsed); + if (!displayingMiss) + GlowBarValue = Interpolation.DampContinuously(GlowBarValue, newHealth, 50, Time.Elapsed); } protected override void FinishInitialAnimation(double value) From f1b4c305b02df1d0495f30f2390bd168cdbf8249 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 17:09:19 +0900 Subject: [PATCH 541/567] Change skinnable health test scene to drain --- .../Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs index 15a7b48323..f215a5d528 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs @@ -35,6 +35,13 @@ namespace osu.Game.Tests.Visual.Gameplay }); } + protected override void Update() + { + base.Update(); + + healthProcessor.Health.Value -= 0.0001f * Time.Elapsed; + } + [Test] public void TestHealthDisplayIncrementing() { From b3533d270c0c9ad70cb89919a3c55d3899be2fd3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 17:20:49 +0900 Subject: [PATCH 542/567] Remove delegate overhead of `HealthBarValue`/`GlowBarValue` --- .../Screens/Play/HUD/ArgonHealthDisplay.cs | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index f15789601c..43de99b4b5 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -63,34 +63,8 @@ namespace osu.Game.Screens.Play.HUD private double glowBarValue; - public double GlowBarValue - { - get => glowBarValue; - set - { - if (glowBarValue == value) - return; - - glowBarValue = value; - Scheduler.AddOnce(updatePathVertices); - } - } - private double healthBarValue; - public double HealthBarValue - { - get => healthBarValue; - set - { - if (healthBarValue == value) - return; - - healthBarValue = value; - Scheduler.AddOnce(updatePathVertices); - } - } - public const float MAIN_PATH_RADIUS = 10f; private const float curve_start_offset = 70; @@ -183,27 +157,29 @@ namespace osu.Game.Screens.Play.HUD } mainBar.Alpha = (float)Interpolation.DampContinuously(mainBar.Alpha, Current.Value > 0 ? 1 : 0, 40, Time.Elapsed); - glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, GlowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); + glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, glowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); double newHealth = Current.Value; - if (newHealth >= GlowBarValue) + if (newHealth >= glowBarValue) finishMissDisplay(); - if (pendingMissAnimation && newHealth < GlowBarValue) + if (pendingMissAnimation && newHealth < glowBarValue) triggerMissDisplay(); pendingMissAnimation = false; - HealthBarValue = Interpolation.DampContinuously(HealthBarValue, newHealth, 50, Time.Elapsed); + healthBarValue = Interpolation.DampContinuously(healthBarValue, newHealth, 50, Time.Elapsed); if (!displayingMiss) - GlowBarValue = Interpolation.DampContinuously(GlowBarValue, newHealth, 50, Time.Elapsed); + glowBarValue = Interpolation.DampContinuously(glowBarValue, newHealth, 50, Time.Elapsed); + + updatePathVertices(); } protected override void FinishInitialAnimation(double value) { base.FinishInitialAnimation(value); - this.TransformTo(nameof(HealthBarValue), value, 500, Easing.OutQuint); - this.TransformTo(nameof(GlowBarValue), value, 250, Easing.OutQuint); + this.TransformTo(nameof(healthBarValue), value, 500, Easing.OutQuint); + this.TransformTo(nameof(glowBarValue), value, 250, Easing.OutQuint); } protected override void Flash() @@ -232,7 +208,7 @@ namespace osu.Game.Screens.Play.HUD this.Delay(500).Schedule(() => { - this.TransformTo(nameof(GlowBarValue), Current.Value, 300, Easing.OutQuint); + this.TransformTo(nameof(glowBarValue), Current.Value, 300, Easing.OutQuint); finishMissDisplay(); }, out resetMissBarDelegate); From 12a59eb34cb44322315ec3608de8c112b2b217ac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 17:30:13 +0900 Subject: [PATCH 543/567] Remove vertex update overheads --- .../Screens/Play/HUD/ArgonHealthDisplay.cs | 50 ++++++++++--------- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 9 ++-- osu.Game/Skinning/LegacyHealthDisplay.cs | 7 +-- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index 43de99b4b5..e22f45b40d 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Extensions.Color4Extensions; @@ -58,8 +57,7 @@ namespace osu.Game.Screens.Play.HUD private bool displayingMiss => resetMissBarDelegate != null; - private readonly List missBarVertices = new List(); - private readonly List healthBarVertices = new List(); + private readonly List vertices = new List(); private double glowBarValue; @@ -156,23 +154,27 @@ namespace osu.Game.Screens.Play.HUD drawSizeLayout.Validate(); } + healthBarValue = Interpolation.DampContinuously(healthBarValue, Current.Value, 50, Time.Elapsed); + if (!displayingMiss) + glowBarValue = Interpolation.DampContinuously(glowBarValue, Current.Value, 50, Time.Elapsed); + mainBar.Alpha = (float)Interpolation.DampContinuously(mainBar.Alpha, Current.Value > 0 ? 1 : 0, 40, Time.Elapsed); glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, glowBarValue > 0 ? 1 : 0, 40, Time.Elapsed); - double newHealth = Current.Value; + updatePathVertices(); + } - if (newHealth >= glowBarValue) + protected override void HealthChanged(bool increase) + { + if (Current.Value >= glowBarValue) finishMissDisplay(); - if (pendingMissAnimation && newHealth < glowBarValue) + if (pendingMissAnimation && Current.Value < glowBarValue) triggerMissDisplay(); + pendingMissAnimation = false; - healthBarValue = Interpolation.DampContinuously(healthBarValue, newHealth, 50, Time.Elapsed); - if (!displayingMiss) - glowBarValue = Interpolation.DampContinuously(glowBarValue, newHealth, 50, Time.Elapsed); - - updatePathVertices(); + base.HealthChanged(increase); } protected override void FinishInitialAnimation(double value) @@ -265,7 +267,6 @@ namespace osu.Game.Screens.Play.HUD if (DrawWidth - padding < rescale_cutoff) rescalePathProportionally(); - List vertices = new List(); barPath.GetPathToProgress(vertices, 0.0, 1.0); background.Vertices = vertices; @@ -295,20 +296,23 @@ namespace osu.Game.Screens.Play.HUD private void updatePathVertices() { - barPath.GetPathToProgress(healthBarVertices, 0.0, healthBarValue); - barPath.GetPathToProgress(missBarVertices, healthBarValue, Math.Max(glowBarValue, healthBarValue)); + barPath.GetPathToProgress(vertices, 0.0, healthBarValue); + if (vertices.Count == 0) vertices.Add(Vector2.Zero); + Vector2 initialVertex = vertices[0]; + for (int i = 0; i < vertices.Count; i++) + vertices[i] -= initialVertex; - if (healthBarVertices.Count == 0) - healthBarVertices.Add(Vector2.Zero); + mainBar.Vertices = vertices; + mainBar.Position = initialVertex; - if (missBarVertices.Count == 0) - missBarVertices.Add(Vector2.Zero); + barPath.GetPathToProgress(vertices, healthBarValue, Math.Max(glowBarValue, healthBarValue)); + if (vertices.Count == 0) vertices.Add(Vector2.Zero); + initialVertex = vertices[0]; + for (int i = 0; i < vertices.Count; i++) + vertices[i] -= initialVertex; - glowBar.Vertices = missBarVertices.Select(v => v - missBarVertices[0]).ToList(); - glowBar.Position = missBarVertices[0]; - - mainBar.Vertices = healthBarVertices.Select(v => v - healthBarVertices[0]).ToList(); - mainBar.Position = healthBarVertices[0]; + glowBar.Vertices = vertices; + glowBar.Position = initialVertex; } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index a20121b20b..d5b238cd50 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -8,6 +8,7 @@ using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Threading; +using osu.Framework.Utils; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; @@ -75,19 +76,17 @@ namespace osu.Game.Screens.Play.HUD // Health changes every frame in draining situations. // Manually handle value changes to avoid bindable event flow overhead. - if (health.Value != Current.Value) + if (!Precision.AlmostEquals(health.Value, Current.Value, 0.001f)) { if (initialIncrease != null) FinishInitialAnimation(Current.Value); + HealthChanged(Current.Value > health.Value); Current.Value = health.Value; - - if (health.Value > Current.Value) - HealthIncreased(); } } - protected virtual void HealthIncreased() + protected virtual void HealthChanged(bool increase) { } diff --git a/osu.Game/Skinning/LegacyHealthDisplay.cs b/osu.Game/Skinning/LegacyHealthDisplay.cs index 00e19c4f76..9c06cbbfb5 100644 --- a/osu.Game/Skinning/LegacyHealthDisplay.cs +++ b/osu.Game/Skinning/LegacyHealthDisplay.cs @@ -79,10 +79,11 @@ namespace osu.Game.Skinning marker.Position = fill.Position + new Vector2(fill.DrawWidth, isNewStyle ? fill.DrawHeight / 2 : 0); } - protected override void HealthIncreased() + protected override void HealthChanged(bool increase) { - marker.Bulge(); - base.HealthIncreased(); + if (increase) + marker.Bulge(); + base.HealthChanged(increase); } protected override void Flash() => marker.Flash(Current.Value >= epic_cutoff); From b6505ba0634887d1d48db6aaa880a55622b3f715 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 18:16:53 +0900 Subject: [PATCH 544/567] Reduce colour tween overhead and mark other calls of concern --- osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index e22f45b40d..f1653c8742 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -188,15 +188,9 @@ namespace osu.Game.Screens.Play.HUD { base.Flash(); - mainBar.TransformTo(nameof(BarPath.GlowColour), main_bar_glow_colour.Opacity(0.8f)) - .TransformTo(nameof(BarPath.GlowColour), main_bar_glow_colour, 300, Easing.OutQuint); - if (!displayingMiss) { - glowBar.TransformTo(nameof(BarPath.BarColour), Colour4.White, 30, Easing.OutQuint) - .Then() - .TransformTo(nameof(BarPath.BarColour), main_bar_colour, 1000, Easing.OutQuint); - + // TODO: REMOVE THIS. It's recreating textures. glowBar.TransformTo(nameof(BarPath.GlowColour), Colour4.White, 30, Easing.OutQuint) .Then() .TransformTo(nameof(BarPath.GlowColour), main_bar_glow_colour, 300, Easing.OutQuint); @@ -214,9 +208,11 @@ namespace osu.Game.Screens.Play.HUD finishMissDisplay(); }, out resetMissBarDelegate); + // TODO: REMOVE THIS. It's recreating textures. glowBar.TransformTo(nameof(BarPath.BarColour), new Colour4(255, 147, 147, 255), 100, Easing.OutQuint).Then() .TransformTo(nameof(BarPath.BarColour), new Colour4(255, 93, 93, 255), 800, Easing.OutQuint); + // TODO: REMOVE THIS. It's recreating textures. glowBar.TransformTo(nameof(BarPath.GlowColour), new Colour4(253, 0, 0, 255).Lighten(0.2f)) .TransformTo(nameof(BarPath.GlowColour), new Colour4(253, 0, 0, 255), 800, Easing.OutQuint); } @@ -228,6 +224,7 @@ namespace osu.Game.Screens.Play.HUD if (Current.Value > 0) { + // TODO: REMOVE THIS. It's recreating textures. glowBar.TransformTo(nameof(BarPath.BarColour), main_bar_colour, 300, Easing.In); glowBar.TransformTo(nameof(BarPath.GlowColour), main_bar_glow_colour, 300, Easing.In); } From 80892f316754c4004112f9be1dbe4dc4a8723191 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 18:18:11 +0900 Subject: [PATCH 545/567] Fix misses not displaying properly --- osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index f1653c8742..78720ec087 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -169,10 +169,11 @@ namespace osu.Game.Screens.Play.HUD if (Current.Value >= glowBarValue) finishMissDisplay(); - if (pendingMissAnimation && Current.Value < glowBarValue) + if (pendingMissAnimation) + { triggerMissDisplay(); - - pendingMissAnimation = false; + pendingMissAnimation = false; + } base.HealthChanged(increase); } From 9c7e555237b29e241e22b0c40e14e94afdbec4bc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 18:27:37 +0900 Subject: [PATCH 546/567] Fix initial animation not playing correctly --- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index d5b238cd50..cd4d050b52 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -36,6 +36,8 @@ namespace osu.Game.Screens.Play.HUD private BindableNumber health = null!; + protected bool InitialAnimationPlaying => initialIncrease != null; + private ScheduledDelegate? initialIncrease; /// @@ -64,25 +66,35 @@ namespace osu.Game.Screens.Play.HUD // this probably shouldn't be operating on `this.` showHealthBar.BindValueChanged(healthBar => this.FadeTo(healthBar.NewValue ? 1 : 0, HUDOverlay.FADE_DURATION, HUDOverlay.FADE_EASING), true); + initialHealthValue = health.Value; + if (PlayInitialIncreaseAnimation) startInitialAnimation(); else Current.Value = health.Value; } + private double lastValue; + private double initialHealthValue; + protected override void Update() { base.Update(); - // Health changes every frame in draining situations. - // Manually handle value changes to avoid bindable event flow overhead. - if (!Precision.AlmostEquals(health.Value, Current.Value, 0.001f)) + if (!InitialAnimationPlaying || health.Value != initialHealthValue) { + Current.Value = health.Value; + if (initialIncrease != null) FinishInitialAnimation(Current.Value); + } - HealthChanged(Current.Value > health.Value); - Current.Value = health.Value; + // Health changes every frame in draining situations. + // Manually handle value changes to avoid bindable event flow overhead. + if (!Precision.AlmostEquals(lastValue, Current.Value, 0.001f)) + { + HealthChanged(Current.Value > lastValue); + lastValue = Current.Value; } } From 6ac1c799bde83a8fb49ad44e37de703421a4097c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 18:34:20 +0900 Subject: [PATCH 547/567] Fix `SettingsToolboxGroup` allocating excessively due to missing cache validation --- osu.Game/Overlays/SettingsToolboxGroup.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/SettingsToolboxGroup.cs b/osu.Game/Overlays/SettingsToolboxGroup.cs index c0948c1eab..de13bd96d4 100644 --- a/osu.Game/Overlays/SettingsToolboxGroup.cs +++ b/osu.Game/Overlays/SettingsToolboxGroup.cs @@ -151,9 +151,12 @@ namespace osu.Game.Overlays base.Update(); if (!headerTextVisibilityCache.IsValid) + { // These toolbox grouped may be contracted to only show icons. // For now, let's hide the header to avoid text truncation weirdness in such cases. headerText.FadeTo(headerText.DrawWidth < DrawWidth ? 1 : 0, 150, Easing.OutQuint); + headerTextVisibilityCache.Validate(); + } } protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source) From 66b3945cd644abd7704adde5284211768981a36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 9 Jan 2024 10:44:30 +0100 Subject: [PATCH 548/567] Move current screen check to better place --- osu.Game/Screens/Select/PlaySongSelect.cs | 3 --- osu.Game/Screens/Select/SongSelect.cs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 3cf8de5267..4951504ff5 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -92,9 +92,6 @@ namespace osu.Game.Screens.Select { if (playerLoader != null) return false; - if (!this.IsCurrentScreen()) - return false; - modsAtGameplayStart = Mods.Value; // Ctrl+Enter should start map with autoplay enabled. diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 2d5c44e5a5..bf1724995a 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -660,7 +660,8 @@ namespace osu.Game.Screens.Select logo.Action = () => { - FinaliseSelection(); + if (this.IsCurrentScreen()) + FinaliseSelection(); return false; }; } From cac0b0de6dba025e99692d208cd56f545bb05660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 9 Jan 2024 11:38:01 +0100 Subject: [PATCH 549/567] Remove unused using directive --- osu.Game/Database/RealmFileStore.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Database/RealmFileStore.cs b/osu.Game/Database/RealmFileStore.cs index f1ed3f4b63..1bd22af4c7 100644 --- a/osu.Game/Database/RealmFileStore.cs +++ b/osu.Game/Database/RealmFileStore.cs @@ -4,7 +4,6 @@ using System; using System.Diagnostics; using System.IO; -using System.Linq; using osu.Framework.Extensions; using osu.Framework.IO.Stores; using osu.Framework.Logging; From a8a70be04ab13f0ad4c565b86ee206c19ba01d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 9 Jan 2024 11:49:42 +0100 Subject: [PATCH 550/567] Reference property via `nameof` rather than hardcoding --- osu.Game/Database/RealmFileStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/RealmFileStore.cs b/osu.Game/Database/RealmFileStore.cs index 1bd22af4c7..9683baec69 100644 --- a/osu.Game/Database/RealmFileStore.cs +++ b/osu.Game/Database/RealmFileStore.cs @@ -98,7 +98,7 @@ namespace osu.Game.Database // can potentially be run asynchronously, although we will need to consider operation order for disk deletion vs realm removal. realm.Write(r => { - foreach (var file in r.All().Filter("Usages.@count = 0")) + foreach (var file in r.All().Filter(@$"{nameof(RealmFile.Usages)}.@count = 0")) { totalFiles++; From 4110adc4c0a9fdc763ec73061169a5e4e8952a7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2024 20:16:27 +0900 Subject: [PATCH 551/567] Fix missing wireframe on argon combo counter --- .../Screens/Play/HUD/ArgonAccuracyCounter.cs | 1 + .../Screens/Play/HUD/ArgonComboCounter.cs | 24 +++++++++++++++++++ osu.Game/Screens/Play/HUD/ComboCounter.cs | 5 ---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs index 521ad63426..5284e3167a 100644 --- a/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs @@ -83,6 +83,7 @@ namespace osu.Game.Screens.Play.HUD }, fractionPart = new ArgonCounterTextComponent(Anchor.TopLeft) { + RequiredDisplayDigits = { Value = 2 }, WireframeOpacity = { BindTarget = WireframeOpacity }, Scale = new Vector2(0.5f), }, diff --git a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs index 5ea7fd0b82..af884aa441 100644 --- a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs @@ -57,6 +57,30 @@ namespace osu.Game.Screens.Play.HUD }); } + public override int DisplayedCount + { + get => base.DisplayedCount; + set + { + base.DisplayedCount = value; + updateWireframe(); + } + } + + private void updateWireframe() + { + text.RequiredDisplayDigits.Value = getDigitsRequiredForDisplayCount(); + } + + private int getDigitsRequiredForDisplayCount() + { + int digitsRequired = 1; + long c = DisplayedCount; + while ((c /= 10) > 0) + digitsRequired++; + return digitsRequired; + } + protected override LocalisableString FormatCount(int count) => $@"{count}x"; protected override IHasText CreateText() => text = new ArgonCounterTextComponent(Anchor.TopLeft, MatchesStrings.MatchScoreStatsCombo.ToUpper()) diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index 17531281aa..93802e11c2 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -11,11 +11,6 @@ namespace osu.Game.Screens.Play.HUD { public bool UsesFixedAnchor { get; set; } - protected ComboCounter() - { - Current.Value = DisplayedCount = 0; - } - protected override double GetProportionalDuration(int currentValue, int newValue) { return Math.Abs(currentValue - newValue) * RollingDuration * 100.0f; From 77bf6e3244111b026f930a75fbb35dd497d9c921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 9 Jan 2024 13:59:27 +0100 Subject: [PATCH 552/567] Fix missing wireframe behind "x" sign on combo counter display --- osu.Game/Screens/Play/HUD/ArgonComboCounter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs index af884aa441..1d6ca3c893 100644 --- a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs @@ -74,7 +74,8 @@ namespace osu.Game.Screens.Play.HUD private int getDigitsRequiredForDisplayCount() { - int digitsRequired = 1; + // one for the single presumed starting digit, one for the "x" at the end. + int digitsRequired = 2; long c = DisplayedCount; while ((c /= 10) > 0) digitsRequired++; From 92ba77031403632ad03b86efcbd2754a47b6c646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 9 Jan 2024 14:00:58 +0100 Subject: [PATCH 553/567] Fix missing wireframe behind percent sign on accuracy counter --- osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs index 5284e3167a..171aa3f44b 100644 --- a/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonAccuracyCounter.cs @@ -90,6 +90,7 @@ namespace osu.Game.Screens.Play.HUD percentText = new ArgonCounterTextComponent(Anchor.TopLeft) { Text = @"%", + RequiredDisplayDigits = { Value = 1 }, WireframeOpacity = { BindTarget = WireframeOpacity } }, } From 91677158a058e03bae2bace8d236c1ef12a5e66e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2024 22:33:00 +0900 Subject: [PATCH 554/567] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index b179b8b837..56931bbcb4 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index 7e03ab50e2..c180baeab7 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From 49d13cda6b80fcd439a7d40723e2635c7792eee2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2024 23:09:43 +0900 Subject: [PATCH 555/567] Fix failing test by setting health on source of truth --- .../Visual/Gameplay/TestSceneFailingLayer.cs | 18 ++++++++++-------- osu.Game/Screens/Play/HUD/FailingLayer.cs | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneFailingLayer.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneFailingLayer.cs index 235ada2d63..684d263a58 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneFailingLayer.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneFailingLayer.cs @@ -22,6 +22,8 @@ namespace osu.Game.Tests.Visual.Gameplay private readonly Bindable showHealth = new Bindable(); + private HealthProcessor healthProcessor; + [Resolved] private OsuConfigManager config { get; set; } @@ -29,7 +31,7 @@ namespace osu.Game.Tests.Visual.Gameplay { AddStep("create layer", () => { - Child = new HealthProcessorContainer(healthProcessor) + Child = new HealthProcessorContainer(this.healthProcessor = healthProcessor) { RelativeSizeAxes = Axes.Both, Child = layer = new FailingLayer() @@ -50,12 +52,12 @@ namespace osu.Game.Tests.Visual.Gameplay AddSliderStep("current health", 0.0, 1.0, 1.0, val => { if (layer != null) - layer.Current.Value = val; + healthProcessor.Health.Value = val; }); - AddStep("set health to 0.10", () => layer.Current.Value = 0.1); + AddStep("set health to 0.10", () => healthProcessor.Health.Value = 0.1); AddUntilStep("layer fade is visible", () => layer.ChildrenOfType().First().Alpha > 0.1f); - AddStep("set health to 1", () => layer.Current.Value = 1f); + AddStep("set health to 1", () => healthProcessor.Health.Value = 1f); AddUntilStep("layer fade is invisible", () => !layer.ChildrenOfType().First().IsPresent); } @@ -65,7 +67,7 @@ namespace osu.Game.Tests.Visual.Gameplay create(new DrainingHealthProcessor(0)); AddUntilStep("layer is visible", () => layer.IsPresent); AddStep("disable layer", () => config.SetValue(OsuSetting.FadePlayfieldWhenHealthLow, false)); - AddStep("set health to 0.10", () => layer.Current.Value = 0.1); + AddStep("set health to 0.10", () => healthProcessor.Health.Value = 0.1); AddUntilStep("layer is not visible", () => !layer.IsPresent); } @@ -74,7 +76,7 @@ namespace osu.Game.Tests.Visual.Gameplay { create(new AccumulatingHealthProcessor(1)); AddUntilStep("layer is not visible", () => !layer.IsPresent); - AddStep("set health to 0.10", () => layer.Current.Value = 0.1); + AddStep("set health to 0.10", () => healthProcessor.Health.Value = 0.1); AddUntilStep("layer is not visible", () => !layer.IsPresent); } @@ -82,7 +84,7 @@ namespace osu.Game.Tests.Visual.Gameplay public void TestLayerVisibilityWithDrainingProcessor() { create(new DrainingHealthProcessor(0)); - AddStep("set health to 0.10", () => layer.Current.Value = 0.1); + AddStep("set health to 0.10", () => healthProcessor.Health.Value = 0.1); AddWaitStep("wait for potential fade", 10); AddAssert("layer is still visible", () => layer.IsPresent); } @@ -92,7 +94,7 @@ namespace osu.Game.Tests.Visual.Gameplay { create(new DrainingHealthProcessor(0)); - AddStep("set health to 0.10", () => layer.Current.Value = 0.1); + AddStep("set health to 0.10", () => healthProcessor.Health.Value = 0.1); AddStep("don't show health", () => showHealth.Value = false); AddStep("disable FadePlayfieldWhenHealthLow", () => config.SetValue(OsuSetting.FadePlayfieldWhenHealthLow, false)); diff --git a/osu.Game/Screens/Play/HUD/FailingLayer.cs b/osu.Game/Screens/Play/HUD/FailingLayer.cs index 3954e23cbe..2bac7660b3 100644 --- a/osu.Game/Screens/Play/HUD/FailingLayer.cs +++ b/osu.Game/Screens/Play/HUD/FailingLayer.cs @@ -100,11 +100,11 @@ namespace osu.Game.Screens.Play.HUD protected override void Update() { + base.Update(); + double target = Math.Clamp(max_alpha * (1 - Current.Value / low_health_threshold), 0, max_alpha); boxes.Alpha = (float)Interpolation.Lerp(boxes.Alpha, target, Clock.ElapsedFrameTime * 0.01f); - - base.Update(); } } } From 84f704a6c2747360d89b5c241fa09ecb5b3a60e8 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 10 Jan 2024 17:15:27 +0300 Subject: [PATCH 556/567] Add failing test case --- .../Resources/mania-skin-broken-array.ini | 3 +++ .../Skins/LegacyManiaSkinDecoderTest.cs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 osu.Game.Tests/Resources/mania-skin-broken-array.ini diff --git a/osu.Game.Tests/Resources/mania-skin-broken-array.ini b/osu.Game.Tests/Resources/mania-skin-broken-array.ini new file mode 100644 index 0000000000..5a6d37eef6 --- /dev/null +++ b/osu.Game.Tests/Resources/mania-skin-broken-array.ini @@ -0,0 +1,3 @@ +[Mania] +Keys: 4 +ColumnLineWidth: 3,,3,3,3 \ No newline at end of file diff --git a/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs b/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs index b96bf09255..c4117014db 100644 --- a/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs +++ b/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs @@ -114,5 +114,24 @@ namespace osu.Game.Tests.Skins Assert.That(configs[0].MinimumColumnWidth, Is.EqualTo(16)); } } + + [Test] + public void TestParseArrayWithSomeEmptyElements() + { + var decoder = new LegacyManiaSkinDecoder(); + + using (var resStream = TestResources.OpenResource("mania-skin-broken-array.ini")) + using (var stream = new LineBufferedReader(resStream)) + { + var configs = decoder.Decode(stream); + + Assert.That(configs.Count, Is.EqualTo(1)); + Assert.That(configs[0].ColumnLineWidth[0], Is.EqualTo(3)); + Assert.That(configs[0].ColumnLineWidth[1], Is.EqualTo(0)); // malformed entry, should be parsed as zero + Assert.That(configs[0].ColumnLineWidth[2], Is.EqualTo(3)); + Assert.That(configs[0].ColumnLineWidth[3], Is.EqualTo(3)); + Assert.That(configs[0].ColumnLineWidth[4], Is.EqualTo(3)); + } + } } } From 698ae66a494a899bfeb4159d72db665a7f514a8a Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 10 Jan 2024 17:41:58 +0300 Subject: [PATCH 557/567] Fix mania skin array decoder not handling malformed entries rigorously --- osu.Game/Skinning/LegacyManiaSkinDecoder.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs index b472afb74f..720b05a0b1 100644 --- a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs +++ b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs @@ -155,7 +155,15 @@ namespace osu.Game.Skinning if (i >= output.Length) break; - output[i] = float.Parse(values[i], CultureInfo.InvariantCulture) * (applyScaleFactor ? LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR : 1); + if (!float.TryParse(values[i], NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out float parsedValue)) + // some skins may provide incorrect entries in array values. to match stable behaviour, read such entries as zero. + // see: https://github.com/ppy/osu/issues/26464, stable code: https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Skinning/Components/Section.cs#L134-L137 + parsedValue = 0; + + if (applyScaleFactor) + parsedValue *= LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR; + + output[i] = parsedValue; } } } From 7ca4d854416ae663825bfc7d84c5df0288a7ce41 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 10 Jan 2024 17:48:47 +0300 Subject: [PATCH 558/567] Remove unnecessary `AllowThousands` flag The flag is there to match `float.Parse` behaviour, but it's too illogical and unnecessary to have it. --- osu.Game/Skinning/LegacyManiaSkinDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs index 720b05a0b1..ff6e7fc38e 100644 --- a/osu.Game/Skinning/LegacyManiaSkinDecoder.cs +++ b/osu.Game/Skinning/LegacyManiaSkinDecoder.cs @@ -155,7 +155,7 @@ namespace osu.Game.Skinning if (i >= output.Length) break; - if (!float.TryParse(values[i], NumberStyles.Float | NumberStyles.AllowThousands, CultureInfo.InvariantCulture, out float parsedValue)) + if (!float.TryParse(values[i], NumberStyles.Float, CultureInfo.InvariantCulture, out float parsedValue)) // some skins may provide incorrect entries in array values. to match stable behaviour, read such entries as zero. // see: https://github.com/ppy/osu/issues/26464, stable code: https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Skinning/Components/Section.cs#L134-L137 parsedValue = 0; From 7b848e1458c484cad520ce8ceee4d4fab64fa726 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 10 Jan 2024 17:51:27 +0300 Subject: [PATCH 559/567] Assert column line width length for extra safety --- osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs b/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs index c4117014db..d577e0fedf 100644 --- a/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs +++ b/osu.Game.Tests/Skins/LegacyManiaSkinDecoderTest.cs @@ -126,6 +126,7 @@ namespace osu.Game.Tests.Skins var configs = decoder.Decode(stream); Assert.That(configs.Count, Is.EqualTo(1)); + Assert.That(configs[0].ColumnLineWidth.Length, Is.EqualTo(5)); Assert.That(configs[0].ColumnLineWidth[0], Is.EqualTo(3)); Assert.That(configs[0].ColumnLineWidth[1], Is.EqualTo(0)); // malformed entry, should be parsed as zero Assert.That(configs[0].ColumnLineWidth[2], Is.EqualTo(3)); From c2706ca91be7293a47142c0ae184774a17b263f6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2024 23:48:16 +0900 Subject: [PATCH 560/567] Also show drain on argon health display test --- .../Visual/Gameplay/TestSceneArgonHealthDisplay.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs index 30fb4412f4..06d199513c 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs @@ -159,5 +159,11 @@ namespace osu.Game.Tests.Visual.Gameplay Type = HitResult.Perfect }); } + + protected override void Update() + { + base.Update(); + healthProcessor.Health.Value -= 0.0001f * Time.Elapsed; + } } } From 5d6f767dbdc613ca54bbfdb98880c33517769b1c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2024 23:52:39 +0900 Subject: [PATCH 561/567] Reduce excessive `Color4` allocations during path colour updates --- osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index afc64b0b84..236bd3366d 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -328,14 +328,17 @@ namespace osu.Game.Screens.Play.HUD private partial class BackgroundPath : SmoothPath { + private static readonly Color4 colour_white = Color4.White.Opacity(0.8f); + private static readonly Color4 colour_black = Color4.Black.Opacity(0.2f); + protected override Color4 ColourAt(float position) { if (position <= 0.16f) - return Color4.White.Opacity(0.8f); + return colour_white; return Interpolation.ValueAt(position, - Color4.White.Opacity(0.8f), - Color4.Black.Opacity(0.2f), + colour_white, + colour_black, -0.5f, 1f, Easing.OutQuint); } } @@ -374,12 +377,14 @@ namespace osu.Game.Screens.Play.HUD public float GlowPortion { get; init; } + private static readonly Colour4 transparent_black = Colour4.Black.Opacity(0.0f); + protected override Color4 ColourAt(float position) { if (position >= GlowPortion) return BarColour; - return Interpolation.ValueAt(position, Colour4.Black.Opacity(0.0f), GlowColour, 0.0, GlowPortion, Easing.InQuint); + return Interpolation.ValueAt(position, transparent_black, GlowColour, 0.0, GlowPortion, Easing.InQuint); } } } From 7c9adc7ad3c1d4c72620d92cb44bd665c6e8a28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 10 Jan 2024 16:51:40 +0100 Subject: [PATCH 562/567] Fix incorrect score conversion on selected beatmaps due to incorrect `difficultyPeppyStars` rounding Fixes issue that occurs on *about* 246 beatmaps and was first described by me on discord: https://discord.com/channels/188630481301012481/188630652340404224/1154367700378865715 and then rediscovered again during work on https://github.com/ppy/osu/pull/26405: https://gist.github.com/bdach/414d5289f65b0399fa8f9732245a4f7c#venenog-on-ultmate-end-by-blacky-overdose-631 It so happens that in stable, due to .NET Framework internals, float math would be performed using x87 registers and opcodes. .NET (Core) however uses SSE instructions on 32- and 64-bit words. x87 registers are _80 bits_ wide. Which is notably wider than _both_ float and double. Therefore, on a significant number of beatmaps, the rounding would not produce correct values due to insufficient precision. See following gist for corroboration of the above: https://gist.github.com/bdach/dcde58d5a3607b0408faa3aa2b67bf10 Thus, to crudely - but, seemingly accurately, after checking across all ranked maps - emulate this, use `decimal`, which is slow, but has bigger precision than `double`. The single known exception beatmap in whose case this results in an incorrect result is https://osu.ppy.sh/beatmapsets/1156087#osu/2625853 which is considered an "acceptable casualty" of sorts. Doing this requires some fooling of the compiler / runtime (see second inline comment in new method). To corroborate that this is required, you can try the following code snippet: Console.WriteLine(string.Join(' ', BitConverter.GetBytes(1.3f).Select(x => x.ToString("X2")))); Console.WriteLine(string.Join(' ', BitConverter.GetBytes(1.3).Select(x => x.ToString("X2")))); Console.WriteLine(); decimal d1 = (decimal)1.3f; decimal d2 = (decimal)1.3; decimal d3 = (decimal)(double)1.3f; Console.WriteLine(string.Join(' ', decimal.GetBits(d1).SelectMany(BitConverter.GetBytes).Select(x => x.ToString("X2")))); Console.WriteLine(string.Join(' ', decimal.GetBits(d2).SelectMany(BitConverter.GetBytes).Select(x => x.ToString("X2")))); Console.WriteLine(string.Join(' ', decimal.GetBits(d3).SelectMany(BitConverter.GetBytes).Select(x => x.ToString("X2")))); which will print 66 66 A6 3F CD CC CC CC CC CC F4 3F 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 8C 5D 89 FB 3B 76 00 00 00 00 00 00 00 00 0E 00 Note that despite `d1` being converted from a less-precise floating- -point value than `d2`, it still is represented 100% accurately as a decimal number. After applying this change, recomputation of legacy scoring attributes for *all* rulesets will be required. --- .../Difficulty/CatchLegacyScoreSimulator.cs | 9 ++--- .../Difficulty/OsuLegacyScoreSimulator.cs | 9 ++--- .../Difficulty/TaikoLegacyScoreSimulator.cs | 7 ++-- .../Objects/Legacy/LegacyRulesetExtensions.cs | 35 +++++++++++++++++++ osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 7 +++- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index f65b6ef381..f931795ff2 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -10,6 +10,7 @@ using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Scoring; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring.Legacy; @@ -62,13 +63,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty drainLength = ((int)Math.Round(baseBeatmap.HitObjects[^1].StartTime) - (int)Math.Round(baseBeatmap.HitObjects[0].StartTime) - breakLength) / 1000; } - int difficultyPeppyStars = (int)Math.Round( - (baseBeatmap.Difficulty.DrainRate - + baseBeatmap.Difficulty.OverallDifficulty - + baseBeatmap.Difficulty.CircleSize - + Math.Clamp((float)objectCount / drainLength * 8, 0, 16)) / 38 * 5); - - scoreMultiplier = difficultyPeppyStars; + scoreMultiplier = LegacyRulesetExtensions.CalculateDifficultyPeppyStars(baseBeatmap.Difficulty, objectCount, drainLength); LegacyScoreAttributes attributes = new LegacyScoreAttributes(); diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs index a76054b42c..b808deab5c 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs @@ -7,6 +7,7 @@ using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Objects; @@ -62,13 +63,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty drainLength = ((int)Math.Round(baseBeatmap.HitObjects[^1].StartTime) - (int)Math.Round(baseBeatmap.HitObjects[0].StartTime) - breakLength) / 1000; } - int difficultyPeppyStars = (int)Math.Round( - (baseBeatmap.Difficulty.DrainRate - + baseBeatmap.Difficulty.OverallDifficulty - + baseBeatmap.Difficulty.CircleSize - + Math.Clamp((float)objectCount / drainLength * 8, 0, 16)) / 38 * 5); - - scoreMultiplier = difficultyPeppyStars; + scoreMultiplier = LegacyRulesetExtensions.CalculateDifficultyPeppyStars(baseBeatmap.Difficulty, objectCount, drainLength); LegacyScoreAttributes attributes = new LegacyScoreAttributes(); diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index b20aa4f2b6..66ff0fc3d9 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -7,6 +7,7 @@ using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring.Legacy; @@ -65,11 +66,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty drainLength = ((int)Math.Round(baseBeatmap.HitObjects[^1].StartTime) - (int)Math.Round(baseBeatmap.HitObjects[0].StartTime) - breakLength) / 1000; } - difficultyPeppyStars = (int)Math.Round( - (baseBeatmap.Difficulty.DrainRate - + baseBeatmap.Difficulty.OverallDifficulty - + baseBeatmap.Difficulty.CircleSize - + Math.Clamp((float)objectCount / drainLength * 8, 0, 16)) / 38 * 5); + difficultyPeppyStars = LegacyRulesetExtensions.CalculateDifficultyPeppyStars(baseBeatmap.Difficulty, objectCount, drainLength); LegacyScoreAttributes attributes = new LegacyScoreAttributes(); diff --git a/osu.Game/Rulesets/Objects/Legacy/LegacyRulesetExtensions.cs b/osu.Game/Rulesets/Objects/Legacy/LegacyRulesetExtensions.cs index 53cf835248..2a5a11161b 100644 --- a/osu.Game/Rulesets/Objects/Legacy/LegacyRulesetExtensions.cs +++ b/osu.Game/Rulesets/Objects/Legacy/LegacyRulesetExtensions.cs @@ -57,5 +57,40 @@ namespace osu.Game.Rulesets.Objects.Legacy return (float)(1.0f - 0.7f * IBeatmapDifficultyInfo.DifficultyRange(circleSize)) / 2 * (applyFudge ? broken_gamefield_rounding_allowance : 1); } + + public static int CalculateDifficultyPeppyStars(BeatmapDifficulty difficulty, int objectCount, int drainLength) + { + /* + * WARNING: DO NOT TOUCH IF YOU DO NOT KNOW WHAT YOU ARE DOING + * + * It so happens that in stable, due to .NET Framework internals, float math would be performed + * using x87 registers and opcodes. + * .NET (Core) however uses SSE instructions on 32- and 64-bit words. + * x87 registers are _80 bits_ wide. Which is notably wider than _both_ float and double. + * Therefore, on a significant number of beatmaps, the rounding would not produce correct values. + * + * Thus, to crudely - but, seemingly *mostly* accurately, after checking across all ranked maps - emulate this, + * use `decimal`, which is slow, but has bigger precision than `double`. + * At the time of writing, there is _one_ ranked exception to this - namely https://osu.ppy.sh/beatmapsets/1156087#osu/2625853 - + * but it is considered an "acceptable casualty", since in that case scores aren't inflated by _that_ much compared to others. + */ + + decimal objectToDrainRatio = drainLength != 0 + ? Math.Clamp((decimal)objectCount / drainLength * 8, 0, 16) + : 16; + + /* + * Notably, THE `double` CASTS BELOW ARE IMPORTANT AND MUST REMAIN. + * Their goal is to trick the compiler / runtime into NOT promoting from single-precision float, as doing so would prompt it + * to attempt to "silently" fix the single-precision values when converting to decimal, + * which is NOT what the x87 FPU does. + */ + + decimal drainRate = (decimal)(double)difficulty.DrainRate; + decimal overallDifficulty = (decimal)(double)difficulty.OverallDifficulty; + decimal circleSize = (decimal)(double)difficulty.CircleSize; + + return (int)Math.Round((drainRate + overallDifficulty + circleSize + objectToDrainRatio) / 38 * 5); + } } } diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 110cf63e5c..389b20b5c8 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -13,6 +13,7 @@ using osu.Game.Extensions; using osu.Game.IO.Legacy; using osu.Game.IO.Serialization; using osu.Game.Replays.Legacy; +using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Replays.Types; using SharpCompress.Compressors.LZMA; @@ -38,9 +39,13 @@ namespace osu.Game.Scoring.Legacy /// 30000009: Fix edge cases in conversion for scores which have 0.0x mod multiplier on stable. Reconvert all scores. /// 30000010: Fix mania score V1 conversion using score V1 accuracy rather than V2 accuracy. Reconvert all scores. /// 30000011: Re-do catch scoring to mirror stable Score V2 as closely as feasible. Reconvert all scores. + /// + /// 30000012: Fix incorrect total score conversion on selected beatmaps after implementing the more correct + /// method. Reconvert all scores. + /// /// /// - public const int LATEST_VERSION = 30000011; + public const int LATEST_VERSION = 30000012; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays. From 861080d3ae42de1b57e4471abc2f4f43a3026fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 11 Jan 2024 10:04:37 +0100 Subject: [PATCH 563/567] Move simulated drain to separate test case Having it on at all times was causing other tests to fail. --- .../Visual/Gameplay/TestSceneArgonHealthDisplay.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs index 06d199513c..5d2921107e 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs @@ -7,6 +7,7 @@ using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Testing; +using osu.Framework.Threading; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Judgements; @@ -160,10 +161,14 @@ namespace osu.Game.Tests.Visual.Gameplay }); } - protected override void Update() + [Test] + public void TestSimulateDrain() { - base.Update(); - healthProcessor.Health.Value -= 0.0001f * Time.Elapsed; + ScheduledDelegate del = null!; + + AddStep("simulate drain", () => del = Scheduler.AddDelayed(() => healthProcessor.Health.Value -= 0.00025f * Time.Elapsed, 0, true)); + AddUntilStep("wait until zero", () => healthProcessor.Health.Value == 0); + AddStep("cancel drain", () => del.Cancel()); } } } From 600e4b6ef3c930ad8dc82f513c870582747e5bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 11 Jan 2024 10:17:32 +0100 Subject: [PATCH 564/567] Adjust skinnable health display test scene for usability --- .../Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs index f215a5d528..1849e8abd0 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneSkinnableHealthDisplay.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual.Gameplay [Cached(typeof(HealthProcessor))] private HealthProcessor healthProcessor = new DrainingHealthProcessor(0); - protected override Drawable CreateArgonImplementation() => new ArgonHealthDisplay { Scale = new Vector2(0.6f), Width = 1f }; + protected override Drawable CreateArgonImplementation() => new ArgonHealthDisplay { Scale = new Vector2(0.6f), Width = 600, UseRelativeSize = { Value = false } }; protected override Drawable CreateDefaultImplementation() => new DefaultHealthDisplay { Scale = new Vector2(0.6f) }; protected override Drawable CreateLegacyImplementation() => new LegacyHealthDisplay { Scale = new Vector2(0.6f) }; From 6572fa4378811663971527a80ea86b9db1c94103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 12 Jan 2024 14:59:15 +0100 Subject: [PATCH 565/567] Only validate playback rate when in submission context Temporary workaround for https://github.com/ppy/osu/issues/26404. It appears that some audio files do not behave well with BASS, leading BASS to report a contradictory state of affairs (i.e. a track that is in playing state but also not progressing). This appears to be related to seeking specifically, therefore only enable the validation of playback rate in the most sensitive contexts, namely when any sort of score submission is involved. --- .../Visual/Gameplay/TestScenePlayerScoreSubmission.cs | 6 ------ osu.Game/Screens/Play/MasterGameplayClockContainer.cs | 2 +- osu.Game/Screens/Play/SubmittingPlayer.cs | 5 +++++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs index 96cfcd61c3..f75a2656ef 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePlayerScoreSubmission.cs @@ -21,7 +21,6 @@ using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko; using osu.Game.Scoring; -using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; using osu.Game.Tests.Beatmaps; @@ -360,11 +359,6 @@ namespace osu.Game.Tests.Visual.Gameplay AllowImportCompletion = new SemaphoreSlim(1); } - protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart) - { - ShouldValidatePlaybackRate = false, - }; - protected override async Task ImportScore(Score score) { ScoreImportStarted = true; diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 8b8bf87436..0d60ec4713 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play /// Whether the audio playback rate should be validated. /// Mostly disabled for tests. /// - internal bool ShouldValidatePlaybackRate { get; init; } = true; + internal bool ShouldValidatePlaybackRate { get; init; } /// /// Whether the audio playback is within acceptable ranges. diff --git a/osu.Game/Screens/Play/SubmittingPlayer.cs b/osu.Game/Screens/Play/SubmittingPlayer.cs index fb3481cbc4..04abb6162f 100644 --- a/osu.Game/Screens/Play/SubmittingPlayer.cs +++ b/osu.Game/Screens/Play/SubmittingPlayer.cs @@ -61,6 +61,11 @@ namespace osu.Game.Screens.Play AddInternal(new PlayerTouchInputDetector()); } + protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) => new MasterGameplayClockContainer(beatmap, gameplayStart) + { + ShouldValidatePlaybackRate = true, + }; + protected override void LoadAsyncComplete() { base.LoadAsyncComplete(); From 58ade18c06524365545aa9adb2a3264e8ad73f80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Jan 2024 04:49:50 +0900 Subject: [PATCH 566/567] Update framework --- osu.Android.props | 2 +- .../Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 56931bbcb4..e39143ab93 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -10,7 +10,7 @@ true - + diff --git a/osu.iOS.props b/osu.iOS.props index c180baeab7..9afeaf7338 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -23,6 +23,6 @@ iossimulator-x64 - + From 0934cff501bd580119e386bbc09e1073a12fb272 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Jan 2024 05:22:41 +0900 Subject: [PATCH 567/567] Workaround implementation oversight See https://github.com/ppy/osu-framework/pull/6130. --- .../Settings/Sections/Input/KeyBindingRow_KeyButton.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs index 3493baa2ad..adf05a71b9 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow_KeyButton.cs @@ -140,7 +140,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input /// A generated from the full input state. /// The key which triggered this update, and should be used as the binding. public void UpdateKeyCombination(KeyCombination fullState, InputKey triggerKey) => - UpdateKeyCombination(new KeyCombination(fullState.Keys.Where(KeyCombination.IsModifierKey).Append(triggerKey).ToArray())); + // TODO: Distinct() can be removed after https://github.com/ppy/osu-framework/pull/6130 is merged. + UpdateKeyCombination(new KeyCombination(fullState.Keys.Where(KeyCombination.IsModifierKey).Append(triggerKey).Distinct().ToArray())); public void UpdateKeyCombination(KeyCombination newCombination) {