mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Add support for old marker style danger textures
This commit is contained in:
parent
9837286aea
commit
5803c72b4c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user