1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00
osu-lazer/osu.Game/Overlays/OnlineBeatmapSetOverlay.cs

94 lines
2.9 KiB
C#
Raw Normal View History

2017-09-09 05:32:07 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2017-09-13 08:00:20 +08:00
using osu.Framework.Graphics.Shapes;
2017-09-09 05:32:07 +08:00
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.OnlineBeatmapSet;
namespace osu.Game.Overlays
{
public class OnlineBeatmapSetOverlay : WaveOverlayContainer
{
public const float X_PADDING = 40;
public const float RIGHT_WIDTH = 275;
private readonly ReverseChildIDFillFlowContainer<Drawable> scrollContent;
public OnlineBeatmapSetOverlay()
{
FirstWaveColour = OsuColour.Gray(0.4f);
SecondWaveColour = OsuColour.Gray(0.3f);
ThirdWaveColour = OsuColour.Gray(0.2f);
FourthWaveColour = OsuColour.Gray(0.1f);
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
RelativeSizeAxes = Axes.Both;
Width = 0.85f;
Masking = true;
EdgeEffect = new EdgeEffectParameters
{
Colour = Color4.Black.Opacity(0),
Type = EdgeEffectType.Shadow,
Radius = 3,
Offset = new Vector2(0f, 1f),
};
2017-09-13 08:00:20 +08:00
Children = new Drawable[]
2017-09-09 05:32:07 +08:00
{
2017-09-13 08:00:20 +08:00
new Box
2017-09-09 05:32:07 +08:00
{
2017-09-13 08:00:20 +08:00
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.2f)
},
new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
Child = scrollContent = new ReverseChildIDFillFlowContainer<Drawable>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
},
2017-09-09 05:32:07 +08:00
},
};
}
protected override void PopIn()
{
base.PopIn();
FadeEdgeEffectTo(0.25f, APPEAR_DURATION, Easing.In);
}
protected override void PopOut()
{
base.PopOut();
FadeEdgeEffectTo(0, DISAPPEAR_DURATION, Easing.Out);
}
public void ShowBeatmapSet(BeatmapSetInfo set)
{
2017-09-11 13:48:48 +08:00
Header header;
Info info;
2017-09-09 05:32:07 +08:00
scrollContent.Children = new Drawable[]
{
2017-09-11 13:48:48 +08:00
header = new Header(set),
info = new Info(set),
2017-09-09 05:32:07 +08:00
};
2017-09-11 13:48:48 +08:00
header.Picker.Beatmap.ValueChanged += b => info.Beatmap = b;
2017-09-09 05:32:07 +08:00
Show();
}
}
}