mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 00:02:54 +08:00
Fix hold note animation not being reset
This commit is contained in:
parent
63708532a1
commit
9552319732
@ -1,6 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
@ -10,6 +13,17 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
{
|
{
|
||||||
public class TestSceneHoldNote : ManiaHitObjectTestScene
|
public class TestSceneHoldNote : ManiaHitObjectTestScene
|
||||||
{
|
{
|
||||||
|
public TestSceneHoldNote()
|
||||||
|
{
|
||||||
|
AddToggleStep("toggle hitting", v =>
|
||||||
|
{
|
||||||
|
foreach (var holdNote in CreatedDrawables.SelectMany(d => d.ChildrenOfType<DrawableHoldNote>()))
|
||||||
|
{
|
||||||
|
((Bindable<bool>)holdNote.IsHitting).Value = v;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected override DrawableManiaHitObject CreateHitObject()
|
protected override DrawableManiaHitObject CreateHitObject()
|
||||||
{
|
{
|
||||||
var note = new HoldNote { Duration = 1000 };
|
var note = new HoldNote { Duration = 1000 };
|
||||||
|
@ -69,6 +69,7 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
if (!(sprite is TextureAnimation animation))
|
if (!(sprite is TextureAnimation animation))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
animation.GotoFrame(0);
|
||||||
animation.IsPlaying = isHitting.NewValue;
|
animation.IsPlaying = isHitting.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user