1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-09 06:17:24 +08:00
osu-lazer/osu.Game/Overlays/Profile/Sections/Recent/MedalIcon.cs

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

41 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 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
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 17:19:50 +08:00
namespace osu.Game.Overlays.Profile.Sections.Recent
{
[LongRunningLoad]
2018-03-07 20:03:21 +08:00
public class MedalIcon : Container
{
private readonly string slug;
private readonly Sprite sprite;
2018-04-13 17:19:50 +08:00
private string url => $@"https://s.ppy.sh/images/medals-client/{slug}@2x.png";
2018-04-13 17:19:50 +08:00
public MedalIcon(string slug)
{
this.slug = slug;
2018-04-13 17:19:50 +08:00
Child = sprite = new Sprite
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
}
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader]
private void load(LargeTextureStore textures)
{
2018-08-31 06:04:40 +08:00
sprite.Texture = textures.Get(url);
}
}
}