Merge branch 'master' into net5.0

This commit is contained in:
Bartłomiej Dach 2021-01-16 16:07:44 +01:00 committed by GitHub
commit c80e9c08fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View File

@ -1,9 +1,11 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Mods;
@ -34,7 +36,7 @@ public void TestVariousSpinners(bool autoplay)
[TestCase(true)]
public void TestLongSpinner(bool autoplay)
{
AddStep("Very short spinner", () => SetContents(() => testSingle(5, autoplay, 2000)));
AddStep("Very long spinner", () => SetContents(() => testSingle(5, autoplay, 4000)));
AddUntilStep("Wait for completion", () => drawableSpinner.Result.HasResult);
AddUntilStep("Check correct progress", () => drawableSpinner.Progress == (autoplay ? 1 : 0));
}
@ -55,7 +57,11 @@ private Drawable testSingle(float circleSize, bool auto = false, double length =
var spinner = new Spinner
{
StartTime = Time.Current + delay,
EndTime = Time.Current + delay + length
EndTime = Time.Current + delay + length,
Samples = new List<HitSampleInfo>
{
new HitSampleInfo("hitnormal")
}
};
spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize });

View File

@ -138,6 +138,15 @@ protected override void Update()
scrollToTrackTime();
}
protected override bool OnScroll(ScrollEvent e)
{
// if this is not a precision scroll event, let the editor handle the seek itself (for snapping support)
if (!e.AltPressed && !e.IsPrecise)
return false;
return base.OnScroll(e);
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();

View File

@ -378,8 +378,10 @@ public override Drawable GetDrawableComponent(ISkinComponent component)
// kind of wasteful that we throw this away, but should do for now.
if (createDrawable() != null)
{
if (Configuration.LegacyVersion > 1)
return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, getParticleTexture(resultComponent.Component));
var particle = getParticleTexture(resultComponent.Component);
if (particle != null)
return new LegacyJudgementPieceNew(resultComponent.Component, createDrawable, particle);
else
return new LegacyJudgementPieceOld(resultComponent.Component, createDrawable);
}