Merge branch 'master' of git://github.com/ppy/osu into direct-previews

This commit is contained in:
Jorolf
2017-10-06 21:02:48 +02:00
39 changed files with 1596 additions and 534 deletions

View File

@ -9,6 +9,9 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Game.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
namespace osu.Game.Overlays.BeatmapSet
{
@ -17,8 +20,11 @@ namespace osu.Game.Overlays.BeatmapSet
private const float height = 50;
private readonly UpdateableAvatar avatar;
private readonly ClickableArea clickableArea;
private readonly FillFlowContainer fields;
private UserProfileOverlay profile;
private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet
{
@ -31,6 +37,8 @@ namespace osu.Game.Overlays.BeatmapSet
var i = BeatmapSet.OnlineInfo;
avatar.User = i.Author;
clickableArea.Action = () => profile?.ShowUser(avatar.User);
fields.Children = new Drawable[]
{
new Field("made by", i.Author.Username, @"Exo2.0-RegularItalic"),
@ -58,11 +66,15 @@ namespace osu.Game.Overlays.BeatmapSet
Children = new Drawable[]
{
avatar = new UpdateableAvatar
clickableArea = new ClickableArea
{
Size = new Vector2(height),
AutoSizeAxes = Axes.Both,
CornerRadius = 3,
Masking = true,
Child = avatar = new UpdateableAvatar
{
Size = new Vector2(height),
},
EdgeEffect = new EdgeEffectParameters
{
Colour = Color4.Black.Opacity(0.25f),
@ -80,6 +92,13 @@ namespace osu.Game.Overlays.BeatmapSet
};
}
[BackgroundDependencyLoader(true)]
private void load(UserProfileOverlay profile)
{
this.profile = profile;
clickableArea.Action = () => profile?.ShowUser(avatar.User);
}
private class Field : FillFlowContainer
{
public Field(string first, string second, string secondFont)
@ -103,5 +122,10 @@ namespace osu.Game.Overlays.BeatmapSet
};
}
}
private class ClickableArea : OsuClickableContainer, IHasTooltip
{
public string TooltipText => @"View Profile";
}
}
}