mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 09:57:21 +09:00
Fix animations not playing correctly in test scene due to too many calls to OnPressed
This commit is contained in:
parent
13618915b7
commit
fee19753e1
@ -69,16 +69,27 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
private class ClickingCursorContainer : OsuCursorContainer
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Pressed = ((int)(Time.Current / 1000)) % 2 == 0;
|
||||||
double currentTime = Time.Current;
|
|
||||||
|
|
||||||
if (((int)(currentTime / 1000)) % 2 == 0)
|
|
||||||
OnPressed(OsuAction.LeftButton);
|
|
||||||
else
|
|
||||||
OnReleased(OsuAction.LeftButton);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user