1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:43:00 +08:00

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,16 +69,27 @@ namespace osu.Game.Rulesets.Osu.Tests
private class ClickingCursorContainer : OsuCursorContainer
{
private bool pressed;
public bool Pressed
{
set
{
if (value == pressed)
return;
pressed = value;
if (value)
OnPressed(OsuAction.LeftButton);
else
OnReleased(OsuAction.LeftButton);
}
}
protected override void Update()
{
base.Update();
double currentTime = Time.Current;
if (((int)(currentTime / 1000)) % 2 == 0)
OnPressed(OsuAction.LeftButton);
else
OnReleased(OsuAction.LeftButton);
Pressed = ((int)(Time.Current / 1000)) % 2 == 0;
}
}