Merge branch 'master' into async-beatmap-properties

This commit is contained in:
Dean Herbert 2017-11-21 17:18:19 +09:00 committed by GitHub
commit 10e835aea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 16 deletions

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Net.Http;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Development; using osu.Framework.Development;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -198,10 +197,9 @@ namespace osu.Desktop.Overlays
} }
} }
} }
catch (HttpRequestException) catch (Exception)
{ {
//likely have no internet connection. // we'll ignore this and retry later. can be triggered by no internet connection or thread abortion.
//we'll ignore this and retry later.
} }
finally finally
{ {

View File

@ -36,7 +36,8 @@ namespace osu.Game.Tests.Visual
Username = @"peppy", Username = @"peppy",
Id = 2, Id = 2,
Country = new Country { FlagName = @"AU" }, Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg" CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
IsSupporter = true,
}) { Width = 300 }, }) { Width = 300 },
}, },
}); });

View File

@ -16,6 +16,7 @@ using osu.Game.Overlays;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Users namespace osu.Game.Users
{ {
@ -43,6 +44,8 @@ namespace osu.Game.Users
this.user = user; this.user = user;
FillFlowContainer infoContainer;
Height = height - status_height; Height = height - status_height;
Masking = true; Masking = true;
CornerRadius = 5; CornerRadius = 5;
@ -100,7 +103,7 @@ namespace osu.Game.Users
TextSize = 18, TextSize = 18,
Font = @"Exo2.0-SemiBoldItalic", Font = @"Exo2.0-SemiBoldItalic",
}, },
new FillFlowContainer infoContainer = new FillFlowContainer
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
@ -115,16 +118,6 @@ namespace osu.Game.Users
Width = 30f, Width = 30f,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
}, },
new Container
{
Width = 40f,
RelativeSizeAxes = Axes.Y,
},
new CircularContainer
{
Width = 20f,
RelativeSizeAxes = Axes.Y,
},
}, },
}, },
}, },
@ -171,6 +164,13 @@ namespace osu.Game.Users
}, },
}, },
}; };
if (user.IsSupporter)
infoContainer.Add(new SupporterIcon
{
RelativeSizeAxes = Axes.Y,
Width = 20f,
});
} }
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
@ -219,5 +219,53 @@ namespace osu.Game.Users
{ {
new OsuMenuItem("View Profile", MenuItemType.Highlighted, ViewProfile), new OsuMenuItem("View Profile", MenuItemType.Highlighted, ViewProfile),
}; };
private class SupporterIcon : CircularContainer
{
private readonly Box background;
public SupporterIcon()
{
Masking = true;
Children = new Drawable[]
{
new Box { RelativeSizeAxes = Axes.Both },
new CircularContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Scale = new Vector2(0.8f),
Masking = true,
Children = new Drawable[]
{
background = new Box { RelativeSizeAxes = Axes.Both },
new Triangles
{
TriangleScale = 0.2f,
ColourLight = OsuColour.FromHex(@"ff7db7"),
ColourDark = OsuColour.FromHex(@"de5b95"),
RelativeSizeAxes = Axes.Both,
Velocity = 0.3f,
},
}
},
new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Icon = FontAwesome.fa_heart,
Scale = new Vector2(0.45f),
}
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
background.Colour = colours.Pink;
}
}
} }
} }