mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:52:57 +08:00
Reduce animations of osu!direct list mode
The panels' content was flying around and felt really shocking. This fixes elements in place to provide a better experience.
This commit is contained in:
parent
78eabce35a
commit
6d6fea47ab
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.States;
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Overlays.Direct
|
||||
@ -26,12 +25,14 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
private PlayButton playButton;
|
||||
private Box progressBar;
|
||||
private Container downloadContainer;
|
||||
|
||||
protected override bool FadePlayButton => false;
|
||||
|
||||
protected override PlayButton PlayButton => playButton;
|
||||
protected override Box PreviewBar => progressBar;
|
||||
|
||||
public DirectListPanel(BeatmapSetInfo beatmap) : base(beatmap)
|
||||
public DirectListPanel(BeatmapSetInfo beatmap)
|
||||
: base(beatmap)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = height;
|
||||
@ -65,6 +66,18 @@ namespace osu.Game.Overlays.Direct
|
||||
LayoutDuration = transition_duration,
|
||||
Spacing = new Vector2(10, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
playButton = new PlayButton(SetInfo)
|
||||
{
|
||||
@ -72,7 +85,6 @@ namespace osu.Game.Overlays.Direct
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Size = new Vector2(height / 2),
|
||||
FillMode = FillMode.Fit,
|
||||
Alpha = 0,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
@ -91,6 +103,10 @@ namespace osu.Game.Overlays.Direct
|
||||
Current = localisation.GetUnicodePreference(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist),
|
||||
Font = @"Exo2.0-BoldItalic",
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
@ -108,16 +124,13 @@ namespace osu.Game.Overlays.Direct
|
||||
Origin = Anchor.TopRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
LayoutEasing = Easing.OutQuint,
|
||||
LayoutDuration = transition_duration,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
downloadContainer = new Container
|
||||
new Container
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
Child = new DownloadButton(SetInfo)
|
||||
{
|
||||
Size = new Vector2(height - vertical_padding * 3),
|
||||
@ -184,17 +197,5 @@ namespace osu.Game.Overlays.Direct
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
downloadContainer.FadeIn(transition_duration, Easing.InOutQuint);
|
||||
return base.OnHover(state);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
downloadContainer.FadeOut(transition_duration, Easing.InOutQuint);
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ namespace osu.Game.Overlays.Direct
|
||||
protected abstract PlayButton PlayButton { get; }
|
||||
protected abstract Box PreviewBar { get; }
|
||||
|
||||
protected virtual bool FadePlayButton => true;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
protected DirectPanel(BeatmapSetInfo setInfo)
|
||||
@ -125,6 +127,7 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
content.TweenEdgeEffectTo(edgeEffectHovered, hover_transition_time, Easing.OutQuint);
|
||||
content.MoveToY(-4, hover_transition_time, Easing.OutQuint);
|
||||
if (FadePlayButton)
|
||||
PlayButton.FadeIn(120, Easing.InOutQuint);
|
||||
|
||||
return base.OnHover(state);
|
||||
@ -134,7 +137,7 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
content.TweenEdgeEffectTo(edgeEffectNormal, hover_transition_time, Easing.OutQuint);
|
||||
content.MoveToY(0, hover_transition_time, Easing.OutQuint);
|
||||
if (!PreviewPlaying)
|
||||
if (FadePlayButton && !PreviewPlaying)
|
||||
PlayButton.FadeOut(120, Easing.InOutQuint);
|
||||
|
||||
base.OnHoverLost(state);
|
||||
|
Loading…
Reference in New Issue
Block a user