mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Add ability to avoid expand animation in ModDisplay
This commit is contained in:
parent
41ab82cdc3
commit
bace829629
@ -24,6 +24,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
public bool DisplayUnrankedText = true;
|
public bool DisplayUnrankedText = true;
|
||||||
|
|
||||||
|
public bool AllowExpand = true;
|
||||||
|
|
||||||
private readonly Bindable<IReadOnlyList<Mod>> current = new Bindable<IReadOnlyList<Mod>>();
|
private readonly Bindable<IReadOnlyList<Mod>> current = new Bindable<IReadOnlyList<Mod>>();
|
||||||
|
|
||||||
public Bindable<IReadOnlyList<Mod>> Current
|
public Bindable<IReadOnlyList<Mod>> Current
|
||||||
@ -87,7 +89,9 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
appearTransform();
|
appearTransform();
|
||||||
|
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appearTransform()
|
private void appearTransform()
|
||||||
@ -97,14 +101,17 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
else
|
else
|
||||||
unrankedText.Hide();
|
unrankedText.Hide();
|
||||||
|
|
||||||
iconsContainer.FinishTransforms();
|
|
||||||
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
|
||||||
expand();
|
expand();
|
||||||
|
|
||||||
using (iconsContainer.BeginDelayedSequence(1200))
|
using (iconsContainer.BeginDelayedSequence(1200))
|
||||||
contract();
|
contract();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expand() => iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
|
private void expand()
|
||||||
|
{
|
||||||
|
if (AllowExpand)
|
||||||
|
iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
private void contract() => iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
|
private void contract() => iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user