1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 02:07:24 +08:00
osu-lazer/osu.Game/Overlays/Profile/Sections/Recent/MedalIcon.cs
2019-01-24 17:43:03 +09:00

39 lines
1.0 KiB
C#

// 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.
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]
private void load(LargeTextureStore textures)
{
sprite.Texture = textures.Get(url);
}
}
}