mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Animate individual ModColumn
s during togle of oerlay
This commit is contained in:
parent
901032bfa2
commit
9fdeb20537
@ -31,6 +31,8 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
public class ModColumn : CompositeDrawable
|
||||
{
|
||||
public readonly Container TopLevelContent;
|
||||
|
||||
public readonly ModType ModType;
|
||||
|
||||
private Func<Mod, bool>? filter;
|
||||
@ -78,11 +80,16 @@ namespace osu.Game.Overlays.Mods
|
||||
Width = 320;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Shear = new Vector2(ModPanel.SHEAR_X, 0);
|
||||
CornerRadius = ModPanel.CORNER_RADIUS;
|
||||
Masking = true;
|
||||
|
||||
Container controlContainer;
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
TopLevelContent = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = ModPanel.CORNER_RADIUS,
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
@ -170,6 +177,8 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
createHeaderText();
|
||||
|
@ -106,6 +106,7 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
new Container
|
||||
{
|
||||
Depth = float.MaxValue,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativePositionAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
@ -296,6 +297,13 @@ namespace osu.Game.Overlays.Mods
|
||||
.Delay(300)
|
||||
.FadeIn(200, Easing.OutQuint)
|
||||
.ScaleTo(1, fade_in_duration, Easing.OutElastic);
|
||||
|
||||
for (int i = 0; i < columnFlow.Count; i++)
|
||||
{
|
||||
columnFlow[i].TopLevelContent
|
||||
.Delay(i * 30)
|
||||
.MoveToY(0, fade_in_duration, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void PopOut()
|
||||
@ -312,6 +320,13 @@ namespace osu.Game.Overlays.Mods
|
||||
footer.MoveToY(footer.DrawHeight, fade_out_duration, Easing.OutQuint);
|
||||
|
||||
this.FadeOut(fade_out_duration, Easing.OutQuint);
|
||||
|
||||
for (int i = 0; i < columnFlow.Count; i++)
|
||||
{
|
||||
const float distance = 700;
|
||||
|
||||
columnFlow[i].TopLevelContent.MoveToY(i % 2 == 0 ? -distance : distance, fade_out_duration, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
private class ModColumnContainer : FillFlowContainer<ModColumn>
|
||||
|
Loading…
Reference in New Issue
Block a user