1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 04:22:55 +08:00

improve code

This commit is contained in:
nanashi-1 2023-08-09 07:34:30 +08:00
parent 07b4f6115b
commit fed338a42b

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -33,13 +31,7 @@ namespace osu.Game.Skinning
protected override void LoadComplete()
{
var skin = source.FindProvider(s => getTexture(s, "A") != null);
rank.Texture = getTexture(skin, scoreProcessor.Rank.Value.ToString());
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = getTexture(skin, v.NewValue.ToString()));
scoreProcessor.Rank.BindValueChanged(v => rank.Texture = source.GetTexture($"ranking-{v.NewValue}-small"), true);
}
private static Texture getTexture(ISkin skin, string name) => skin?.GetTexture($"ranking-{name}-small");
}
}