2017-03-23 03:22:31 +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 osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-03-23 04:19:29 +00:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Screens.Select.Leaderboards;
|
2017-03-23 03:22:31 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Select
|
|
|
|
|
{
|
|
|
|
|
public class BeatmapDetailArea : Container
|
|
|
|
|
{
|
2017-03-23 05:47:27 +00:00
|
|
|
|
private readonly Container content;
|
2017-03-23 03:29:28 +00:00
|
|
|
|
protected override Container<Drawable> Content => content;
|
|
|
|
|
|
2017-03-30 15:32:18 +00:00
|
|
|
|
public readonly BeatmapDetails Details;
|
2017-03-23 04:19:29 +00:00
|
|
|
|
public readonly Leaderboard Leaderboard;
|
|
|
|
|
|
2017-03-23 07:31:08 +00:00
|
|
|
|
private WorkingBeatmap beatmap;
|
|
|
|
|
public WorkingBeatmap Beatmap
|
2017-03-23 04:19:29 +00:00
|
|
|
|
{
|
2017-03-23 07:31:08 +00:00
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return beatmap;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
beatmap = value;
|
2017-04-11 04:48:43 +00:00
|
|
|
|
Leaderboard.Beatmap = beatmap?.BeatmapInfo;
|
2017-04-24 10:17:11 +00:00
|
|
|
|
Details.Beatmap = beatmap?.BeatmapInfo;
|
2017-03-23 07:31:08 +00:00
|
|
|
|
}
|
2017-03-23 04:19:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-23 03:22:31 +00:00
|
|
|
|
public BeatmapDetailArea()
|
|
|
|
|
{
|
2017-03-23 03:29:28 +00:00
|
|
|
|
AddInternal(new Drawable[]
|
2017-03-23 03:22:31 +00:00
|
|
|
|
{
|
|
|
|
|
new BeatmapDetailAreaTabControl
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2017-04-04 15:27:08 +00:00
|
|
|
|
OnFilter = (tab, mods) =>
|
2017-03-23 04:19:29 +00:00
|
|
|
|
{
|
|
|
|
|
switch (tab)
|
|
|
|
|
{
|
|
|
|
|
case BeatmapDetailTab.Details:
|
2017-03-23 07:28:40 +00:00
|
|
|
|
Details.Show();
|
|
|
|
|
Leaderboard.Hide();
|
2017-03-23 04:19:29 +00:00
|
|
|
|
break;
|
2017-04-04 15:27:08 +00:00
|
|
|
|
|
2017-03-23 04:19:29 +00:00
|
|
|
|
default:
|
2017-03-23 07:28:40 +00:00
|
|
|
|
Details.Hide();
|
|
|
|
|
Leaderboard.Show();
|
2017-03-23 04:19:29 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
2017-03-23 03:22:31 +00:00
|
|
|
|
},
|
2017-03-23 03:29:28 +00:00
|
|
|
|
content = new Container
|
2017-03-23 03:22:31 +00:00
|
|
|
|
{
|
2017-03-23 03:29:28 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-03-23 03:22:31 +00:00
|
|
|
|
Padding = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT },
|
|
|
|
|
},
|
2017-03-23 03:29:28 +00:00
|
|
|
|
});
|
2017-03-23 04:19:29 +00:00
|
|
|
|
|
|
|
|
|
Add(new Drawable[]
|
|
|
|
|
{
|
2017-03-30 15:32:18 +00:00
|
|
|
|
Details = new BeatmapDetails
|
2017-03-23 04:19:29 +00:00
|
|
|
|
{
|
2017-04-24 09:55:49 +00:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Masking = true,
|
|
|
|
|
Height = 352,
|
2017-04-06 13:39:23 +00:00
|
|
|
|
Alpha = 0,
|
2017-03-23 04:19:29 +00:00
|
|
|
|
},
|
|
|
|
|
Leaderboard = new Leaderboard
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2017-03-23 03:22:31 +00:00
|
|
|
|
}
|
2017-04-24 09:55:49 +00:00
|
|
|
|
}
|