Fix animations not playing correctly in test scene due to too many calls to OnPressed

This commit is contained in:
Dean Herbert 2020-07-10 14:47:11 +09:00
parent 13618915b7
commit fee19753e1

View File

@ -69,19 +69,30 @@ namespace osu.Game.Rulesets.Osu.Tests
private class ClickingCursorContainer : OsuCursorContainer private class ClickingCursorContainer : OsuCursorContainer
{ {
protected override void Update() private bool pressed;
public bool Pressed
{ {
base.Update(); set
{
if (value == pressed)
return;
double currentTime = Time.Current; pressed = value;
if (value)
if (((int)(currentTime / 1000)) % 2 == 0)
OnPressed(OsuAction.LeftButton); OnPressed(OsuAction.LeftButton);
else else
OnReleased(OsuAction.LeftButton); OnReleased(OsuAction.LeftButton);
} }
} }
protected override void Update()
{
base.Update();
Pressed = ((int)(Time.Current / 1000)) % 2 == 0;
}
}
private class MovingCursorInputManager : ManualInputManager private class MovingCursorInputManager : ManualInputManager
{ {
public MovingCursorInputManager() public MovingCursorInputManager()