osu/osu.Game/Overlays/OnlineBeatmapSetOverlay.cs

94 lines
2.9 KiB
C#
Raw Normal View History

2017-09-08 21:32:07 +00: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 00:00:20 +00:00
using osu.Framework.Graphics.Shapes;
2017-09-08 21:32:07 +00: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;
2017-09-13 15:37:18 +00:00
private readonly Header header;
private readonly Info info;
2017-09-08 21:32:07 +00:00
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 00:00:20 +00:00
Children = new Drawable[]
2017-09-08 21:32:07 +00:00
{
2017-09-13 00:00:20 +00:00
new Box
2017-09-08 21:32:07 +00:00
{
2017-09-13 00:00:20 +00:00
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.2f)
},
new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
2017-09-13 15:37:18 +00:00
Child = new ReverseChildIDFillFlowContainer<Drawable>
2017-09-13 00:00:20 +00:00
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
2017-09-13 15:37:18 +00:00
Children = new Drawable[]
{
header = new Header(),
2017-09-13 15:37:18 +00:00
info = new Info(),
},
2017-09-13 00:00:20 +00:00
},
2017-09-08 21:32:07 +00:00
},
};
2017-09-13 15:37:18 +00:00
header.Picker.Beatmap.ValueChanged += b => info.Beatmap = b;
2017-09-08 21:32:07 +00: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)
{
header.BeatmapSet = info.BeatmapSet = set;
2017-09-11 05:48:48 +00:00
2017-09-08 21:32:07 +00:00
Show();
}
}
}