1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 23:37:20 +08:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.1 KiB
C#
Raw Normal View History

// 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 18:19:50 +09:00
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
2018-04-13 18:19:50 +09:00
namespace osu.Game.Overlays.Profile.Sections.Recent
{
[LongRunningLoad]
2018-03-07 17:33:21 +05:30
public partial class MedalIcon : Container
{
private readonly string slug;
private readonly Sprite sprite;
2018-04-13 18:19:50 +09:00
private string url => $@"https://s.ppy.sh/images/medals-client/{slug}@2x.png";
2018-04-13 18:19:50 +09:00
public MedalIcon(string slug)
{
this.slug = slug;
2018-04-13 18:19:50 +09:00
Child = sprite = new Sprite
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
}
2018-04-13 18:19:50 +09:00
[BackgroundDependencyLoader]
private void load(LargeTextureStore textures)
{
2018-08-31 07:04:40 +09:00
sprite.Texture = textures.Get(url);
}
}
}