mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 16:22:55 +08:00
Merge branch 'master' into add-notelock
This commit is contained in:
commit
3b6d893dcf
@ -52,6 +52,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.407.1" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.411.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
BorderThickness = 1,
|
||||
BorderColour = colours.Yellow,
|
||||
Child = new Box
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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 Microsoft.EntityFrameworkCore.Internal;
|
||||
using NUnit.Framework;
|
||||
@ -162,5 +163,69 @@ namespace osu.Game.Tests.Beatmaps
|
||||
Assert.That(editorBeatmap.HitObjects.Count(h => h == hitCircle), Is.EqualTo(1));
|
||||
Assert.That(editorBeatmap.HitObjects.IndexOf(hitCircle), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests that multiple hitobjects are updated simultaneously.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestMultipleHitObjectUpdate()
|
||||
{
|
||||
var updatedObjects = new List<HitObject>();
|
||||
var allHitObjects = new List<HitObject>();
|
||||
EditorBeatmap editorBeatmap = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
updatedObjects.Clear();
|
||||
|
||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var h = new HitCircle();
|
||||
editorBeatmap.Add(h);
|
||||
allHitObjects.Add(h);
|
||||
}
|
||||
});
|
||||
|
||||
AddStep("change all start times", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
allHitObjects[i].StartTime += 10;
|
||||
});
|
||||
|
||||
// Distinct ensures that all hitobjects have been updated once, debounce is tested below.
|
||||
AddAssert("all hitobjects updated", () => updatedObjects.Distinct().Count() == 10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests that hitobject updates are debounced when they happen too soon.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestDebouncedUpdate()
|
||||
{
|
||||
var updatedObjects = new List<HitObject>();
|
||||
EditorBeatmap editorBeatmap = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
updatedObjects.Clear();
|
||||
|
||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
||||
editorBeatmap.Add(new HitCircle());
|
||||
});
|
||||
|
||||
AddStep("change start time twice", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
|
||||
editorBeatmap.HitObjects[0].StartTime = 10;
|
||||
editorBeatmap.HitObjects[0].StartTime = 20;
|
||||
});
|
||||
|
||||
AddAssert("only updated once", () => updatedObjects.Count == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,14 +29,8 @@ namespace osu.Game.Overlays.Music
|
||||
{
|
||||
public CollectionsMenu()
|
||||
{
|
||||
Masking = true;
|
||||
CornerRadius = 5;
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Colour = Color4.Black.Opacity(0.3f),
|
||||
Radius = 3,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -375,7 +375,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ComputeIsMaskedAway(RectangleF maskingBounds) => AllJudged && base.ComputeIsMaskedAway(maskingBounds);
|
||||
public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) => AllJudged && base.UpdateSubTreeMasking(source, maskingBounds);
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
|
@ -63,6 +63,7 @@ namespace osu.Game.Screens.Edit
|
||||
trackStartTime(obj);
|
||||
}
|
||||
|
||||
private readonly HashSet<HitObject> pendingUpdates = new HashSet<HitObject>();
|
||||
private ScheduledDelegate scheduledUpdate;
|
||||
|
||||
/// <summary>
|
||||
@ -74,15 +75,27 @@ namespace osu.Game.Screens.Edit
|
||||
private void updateHitObject([CanBeNull] HitObject hitObject, bool silent)
|
||||
{
|
||||
scheduledUpdate?.Cancel();
|
||||
scheduledUpdate = Scheduler.AddDelayed(() =>
|
||||
|
||||
if (hitObject != null)
|
||||
pendingUpdates.Add(hitObject);
|
||||
|
||||
scheduledUpdate = Schedule(() =>
|
||||
{
|
||||
beatmapProcessor?.PreProcess();
|
||||
hitObject?.ApplyDefaults(ControlPointInfo, BeatmapInfo.BaseDifficulty);
|
||||
|
||||
foreach (var obj in pendingUpdates)
|
||||
obj.ApplyDefaults(ControlPointInfo, BeatmapInfo.BaseDifficulty);
|
||||
|
||||
beatmapProcessor?.PostProcess();
|
||||
|
||||
if (!silent)
|
||||
HitObjectUpdated?.Invoke(hitObject);
|
||||
}, 0);
|
||||
{
|
||||
foreach (var obj in pendingUpdates)
|
||||
HitObjectUpdated?.Invoke(obj);
|
||||
}
|
||||
|
||||
pendingUpdates.Clear();
|
||||
});
|
||||
}
|
||||
|
||||
public BeatmapInfo BeatmapInfo
|
||||
|
@ -22,7 +22,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.407.1" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.411.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||
<PackageReference Include="Sentry" Version="2.1.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.25.0" />
|
||||
|
@ -70,7 +70,7 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.407.1" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.411.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.403.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
@ -79,7 +79,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.407.1" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.411.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.25.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user