2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Profile.Sections.Recent
|
|
|
|
|
{
|
|
|
|
|
public class MedalIcon : Container
|
|
|
|
|
{
|
|
|
|
|
private readonly string slug;
|
|
|
|
|
private readonly Sprite sprite;
|
|
|
|
|
|
|
|
|
|
private string url => $@"https://s.ppy.sh/images/medals-client/{slug}@2x.png";
|
|
|
|
|
|
|
|
|
|
public MedalIcon(string slug)
|
|
|
|
|
{
|
|
|
|
|
this.slug = slug;
|
|
|
|
|
|
|
|
|
|
Child = sprite = new Sprite
|
|
|
|
|
{
|
|
|
|
|
Height = 40,
|
|
|
|
|
Width = 40,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2018-09-09 01:41:47 +08:00
|
|
|
|
private void load(LargeTextureStore textures)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-08-31 06:04:40 +08:00
|
|
|
|
sprite.Texture = textures.Get(url);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|