mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Implement instant movement properly
This commit is contained in:
parent
7d955839be
commit
a155814bc4
@ -283,9 +283,24 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Move(Vector2 pos) => Position = pos;
|
||||
private bool instantMove = true;
|
||||
|
||||
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
|
||||
public void Move(Vector2 pos)
|
||||
{
|
||||
if (instantMove)
|
||||
{
|
||||
Position = pos;
|
||||
instantMove = false;
|
||||
}
|
||||
else
|
||||
this.MoveTo(pos, 200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
instantMove |= !IsPresent;
|
||||
this.FadeIn(200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user