1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fix RollingCounter not updating initial value if changed before loaded

This commit is contained in:
Dean Herbert 2020-08-31 18:13:51 +09:00
parent d3245dda1c
commit 8b7446c43f

View File

@ -65,12 +65,6 @@ namespace osu.Game.Graphics.UserInterface
protected RollingCounter()
{
AutoSizeAxes = Axes.Both;
Current.ValueChanged += val =>
{
if (IsLoaded)
TransformCount(DisplayedCount, val.NewValue);
};
}
[BackgroundDependencyLoader]
@ -81,6 +75,13 @@ namespace osu.Game.Graphics.UserInterface
Child = displayedCountSpriteText;
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(val => TransformCount(DisplayedCount, val.NewValue), true);
}
/// <summary>
/// Sets count value, bypassing rollover animation.
/// </summary>