-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#30622 from bdach/not-enough-timed-events
Do not show timing distribution graph in offset control if there's not enough timed hits
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Graphics; | ||
using osu.Framework.Testing; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Overlays.Settings; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.Osu.Mods; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Scoring; | ||
using osu.Game.Screens.Play.PlayerSettings; | ||
using osu.Game.Tests.Resources; | ||
|
@@ -52,6 +56,39 @@ public void TestTooShortToDisplay() | |
AddAssert("No calibration button", () => !offsetControl.ChildrenOfType<SettingsButton>().Any()); | ||
} | ||
|
||
[Test] | ||
public void TestNotEnoughTimedHitEvents() | ||
{ | ||
AddStep("Set short reference score", () => | ||
{ | ||
List<HitEvent> hitEvents = | ||
[ | ||
// 10 events total. one of them (head circle) being timed / having hitwindows, rest having no hitwindows | ||
new HitEvent(30, 1, HitResult.LargeTickHit, new SliderHeadCircle { ClassicSliderBehaviour = true }, null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
new HitEvent(0, 1, HitResult.LargeTickHit, new SliderTick(), null, null), | ||
]; | ||
foreach (var ev in hitEvents) | ||
ev.HitObject.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); | ||
offsetControl.ReferenceScore.Value = new ScoreInfo | ||
{ | ||
HitEvents = hitEvents, | ||
BeatmapInfo = Beatmap.Value.BeatmapInfo, | ||
}; | ||
}); | ||
|
||
AddAssert("No calibration button", () => !offsetControl.ChildrenOfType<SettingsButton>().Any()); | ||
} | ||
|
||
[Test] | ||
public void TestScoreFromDifferentBeatmap() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters