From aec3753863db310227c684e1686eb57c5bc68585 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 3 Jan 2019 13:57:56 +0900 Subject: [PATCH 1/6] Fix imported replays having excess statistics --- .../Scoring/CatchScoreProcessor.cs | 2 +- .../Scoring/ManiaScoreProcessor.cs | 2 +- .../Scoring/OsuScoreProcessor.cs | 2 +- .../Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 2 +- osu.Game/Scoring/Legacy/LegacyScoreParser.cs | 32 ++++++++++++------- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 57f4355d6a..54c572bcab 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -43,6 +43,6 @@ namespace osu.Game.Rulesets.Catch.Scoring Health.Value += Math.Max(result.Judgement.HealthIncreaseFor(result) - hpDrainRate, 0) * harshness; } - protected override HitWindows CreateHitWindows() => new CatchHitWindows(); + public override HitWindows CreateHitWindows() => new CatchHitWindows(); } } diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 20a665c314..a053a6be97 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -159,6 +159,6 @@ namespace osu.Game.Rulesets.Mania.Scoring } } - protected override HitWindows CreateHitWindows() => new ManiaHitWindows(); + public override HitWindows CreateHitWindows() => new ManiaHitWindows(); } } diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index a24efe4a1e..1a63ff75c4 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -74,6 +74,6 @@ namespace osu.Game.Rulesets.Osu.Scoring protected override JudgementResult CreateResult(Judgement judgement) => new OsuJudgementResult(judgement); - protected override HitWindows CreateHitWindows() => new OsuHitWindows(); + public override HitWindows CreateHitWindows() => new OsuHitWindows(); } } diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 87481c800d..900a2c8148 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -67,6 +67,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring Health.Value = 0; } - protected override HitWindows CreateHitWindows() => new TaikoHitWindows(); + public override HitWindows CreateHitWindows() => new TaikoHitWindows(); } } diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 4b3012192d..576937f94e 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Scoring /// /// Create a for this processor. /// - protected virtual HitWindows CreateHitWindows() => new HitWindows(); + public virtual HitWindows CreateHitWindows() => new HitWindows(); /// /// The current rank. diff --git a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs index 3184f776a7..1009e7065e 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs @@ -57,12 +57,20 @@ namespace osu.Game.Scoring.Legacy var countKatu = (int)sr.ReadUInt16(); var countMiss = (int)sr.ReadUInt16(); - score.ScoreInfo.Statistics[HitResult.Great] = count300; - score.ScoreInfo.Statistics[HitResult.Good] = count100; - score.ScoreInfo.Statistics[HitResult.Meh] = count50; - score.ScoreInfo.Statistics[HitResult.Perfect] = countGeki; - score.ScoreInfo.Statistics[HitResult.Ok] = countKatu; - score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + var windows = currentRuleset.CreateRulesetContainerWith(workingBeatmap).CreateScoreProcessor().CreateHitWindows(); + + if (windows.IsHitResultAllowed(HitResult.Great)) + score.ScoreInfo.Statistics[HitResult.Great] = count300; + if (windows.IsHitResultAllowed(HitResult.Good)) + score.ScoreInfo.Statistics[HitResult.Good] = count100; + if (windows.IsHitResultAllowed(HitResult.Meh)) + score.ScoreInfo.Statistics[HitResult.Meh] = count50; + if (windows.IsHitResultAllowed(HitResult.Perfect)) + score.ScoreInfo.Statistics[HitResult.Perfect] = countGeki; + if (windows.IsHitResultAllowed(HitResult.Ok)) + score.ScoreInfo.Statistics[HitResult.Ok] = countKatu; + if (windows.IsHitResultAllowed(HitResult.Miss)) + score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; score.ScoreInfo.TotalScore = sr.ReadInt32(); score.ScoreInfo.MaxCombo = sr.ReadUInt16(); @@ -116,12 +124,12 @@ namespace osu.Game.Scoring.Legacy private void calculateAccuracy(ScoreInfo score) { - int countMiss = score.Statistics[HitResult.Miss]; - int count50 = score.Statistics[HitResult.Meh]; - int count100 = score.Statistics[HitResult.Good]; - int count300 = score.Statistics[HitResult.Great]; - int countGeki = score.Statistics[HitResult.Perfect]; - int countKatu = score.Statistics[HitResult.Ok]; + score.Statistics.TryGetValue(HitResult.Miss, out int countMiss); + score.Statistics.TryGetValue(HitResult.Meh, out int count50); + score.Statistics.TryGetValue(HitResult.Good, out int count100); + score.Statistics.TryGetValue(HitResult.Great, out int count300); + score.Statistics.TryGetValue(HitResult.Perfect, out int countGeki); + score.Statistics.TryGetValue(HitResult.Ok, out int countKatu); switch (score.Ruleset.ID) { From 4c866e7940fe35beb88399b122ede5ceb874dbea Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Fri, 1 Feb 2019 22:37:27 +0300 Subject: [PATCH 2/6] Add PlaylistItemHandle.HandlePositionalInput override --- osu.Game/Overlays/Music/PlaylistItem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 910f7698c0..7c7b78afc7 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -169,6 +169,8 @@ namespace osu.Game.Overlays.Music Alpha = 0f; Margin = new MarginPadding { Left = 5, Top = 2 }; } + + public override bool HandlePositionalInput => IsPresent; } } From cd92dddd467b209fbdc0bbaedcd4c3e80c90b943 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Feb 2019 12:31:05 +0900 Subject: [PATCH 3/6] Add per-ruleset mappings --- osu.Game/Scoring/Legacy/LegacyScoreParser.cs | 38 +++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs index 069dadf891..6bb454da76 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs @@ -59,18 +59,32 @@ namespace osu.Game.Scoring.Legacy var windows = currentRuleset.CreateRulesetContainerWith(workingBeatmap).CreateScoreProcessor().CreateHitWindows(); - if (windows.IsHitResultAllowed(HitResult.Great)) - score.ScoreInfo.Statistics[HitResult.Great] = count300; - if (windows.IsHitResultAllowed(HitResult.Good)) - score.ScoreInfo.Statistics[HitResult.Good] = count100; - if (windows.IsHitResultAllowed(HitResult.Meh)) - score.ScoreInfo.Statistics[HitResult.Meh] = count50; - if (windows.IsHitResultAllowed(HitResult.Perfect)) - score.ScoreInfo.Statistics[HitResult.Perfect] = countGeki; - if (windows.IsHitResultAllowed(HitResult.Ok)) - score.ScoreInfo.Statistics[HitResult.Ok] = countKatu; - if (windows.IsHitResultAllowed(HitResult.Miss)) - score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + switch (currentRuleset.LegacyID) + { + case 0: + score.ScoreInfo.Statistics[HitResult.Great] = count300; + score.ScoreInfo.Statistics[HitResult.Good] = count100; + score.ScoreInfo.Statistics[HitResult.Meh] = count50; + score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + break; + case 1: + score.ScoreInfo.Statistics[HitResult.Great] = count300; + score.ScoreInfo.Statistics[HitResult.Good] = count100; + score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + break; + case 2: + score.ScoreInfo.Statistics[HitResult.Perfect] = count300; + score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + break; + case 3: + score.ScoreInfo.Statistics[HitResult.Perfect] = countGeki; + score.ScoreInfo.Statistics[HitResult.Great] = count300; + score.ScoreInfo.Statistics[HitResult.Good] = countKatu; + score.ScoreInfo.Statistics[HitResult.Ok] = count100; + score.ScoreInfo.Statistics[HitResult.Meh] = count50; + score.ScoreInfo.Statistics[HitResult.Miss] = countMiss; + break; + } score.ScoreInfo.TotalScore = sr.ReadInt32(); score.ScoreInfo.MaxCombo = sr.ReadUInt16(); From 91d875db0d9224bb836df8476c66310ef1141130 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Feb 2019 12:56:55 +0900 Subject: [PATCH 4/6] Remove unused local --- osu.Game/Scoring/Legacy/LegacyScoreParser.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs index 6bb454da76..f89f8e80bf 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs @@ -57,8 +57,6 @@ namespace osu.Game.Scoring.Legacy var countKatu = (int)sr.ReadUInt16(); var countMiss = (int)sr.ReadUInt16(); - var windows = currentRuleset.CreateRulesetContainerWith(workingBeatmap).CreateScoreProcessor().CreateHitWindows(); - switch (currentRuleset.LegacyID) { case 0: From cf91b882c860ecd3a33352596bbf90e5209c7499 Mon Sep 17 00:00:00 2001 From: Kyle Chang Date: Fri, 1 Feb 2019 13:28:56 -0500 Subject: [PATCH 5/6] Fix slider tail evaluation in osu difficulty calculator The slider tail circle was already included as a nested hit object and is judged before the end of the slider's actual duration, so using the slider end time leads to an inaccurate travel distance and end position. --- .../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs index 4e9ac26dc5..1ec12adb3b 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -143,7 +143,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing var scoringTimes = slider.NestedHitObjects.Skip(1).Select(t => t.StartTime); foreach (var time in scoringTimes) computeVertex(time); - computeVertex(slider.EndTime); } private Vector2 getEndCursorPosition(OsuHitObject hitObject) From 065b0c9076fa526ec7d7413d2ee33ae47732fee7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 4 Feb 2019 17:04:52 +0900 Subject: [PATCH 6/6] Fix background not being faded correctly --- osu.Game/Screens/Select/SongSelect.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index d800cea736..f3091f7d4e 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -31,6 +31,7 @@ using osu.Game.Screens.Menu; using osu.Game.Screens.Play; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; +using osuTK.Graphics; namespace osu.Game.Screens.Select { @@ -564,7 +565,7 @@ namespace osu.Game.Screens.Select { backgroundModeBeatmap.Beatmap = beatmap; backgroundModeBeatmap.BlurTo(background_blur, 750, Easing.OutQuint); - backgroundModeBeatmap.FadeTo(1, 250); + backgroundModeBeatmap.FadeColour(Color4.White, 250); } beatmapInfoWedge.Beatmap = beatmap;