1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Add support for old marker style danger textures

This commit is contained in:
Dean Herbert 2020-10-16 16:29:10 +09:00
parent 9837286aea
commit 5803c72b4c

View File

@ -84,17 +84,42 @@ namespace osu.Game.Skinning
public class LegacyOldStyleMarker : LegacyMarker
{
private readonly Sprite sprite;
private readonly Texture normalTexture;
private readonly Texture dangerTexture;
private readonly Texture superDangerTexture;
public LegacyOldStyleMarker(Skin skin)
{
normalTexture = getTexture(skin, "ki");
dangerTexture = getTexture(skin, "kidanger");
superDangerTexture = getTexture(skin, "kidanger2");
InternalChildren = new Drawable[]
{
new Sprite
sprite = new Sprite
{
Texture = getTexture(skin, "ki"),
Origin = Anchor.Centre,
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(hp =>
{
if (hp.NewValue < 0.2f)
sprite.Texture = superDangerTexture;
else if (hp.NewValue < 0.5f)
sprite.Texture = dangerTexture;
else
sprite.Texture = normalTexture;
});
}
}
public class LegacyNewStyleMarker : LegacyMarker