2020-10-14 15:46:13 +08:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
|
|
|
public class SkinnableComboCounter : SkinnableDrawable, IComboCounter
|
|
|
|
{
|
|
|
|
public SkinnableComboCounter()
|
|
|
|
: base(new HUDSkinComponent(HUDSkinComponents.ComboCounter), createDefault)
|
|
|
|
{
|
2020-10-14 16:20:10 +08:00
|
|
|
CentreComponent = false;
|
2020-10-14 15:46:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private IComboCounter skinnedCounter;
|
|
|
|
|
|
|
|
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
|
|
|
{
|
|
|
|
base.SkinChanged(skin, allowFallback);
|
|
|
|
|
2020-10-14 22:52:58 +08:00
|
|
|
skinnedCounter = Drawable as IComboCounter;
|
|
|
|
skinnedCounter?.Current.BindTo(Current);
|
2020-10-14 15:46:13 +08:00
|
|
|
}
|
|
|
|
|
2020-10-14 16:21:56 +08:00
|
|
|
private static Drawable createDefault(ISkinComponent skinComponent) => new DefaultComboCounter();
|
2020-10-14 15:46:13 +08:00
|
|
|
|
|
|
|
public Bindable<int> Current { get; } = new Bindable<int>();
|
|
|
|
}
|
|
|
|
}
|