1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +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() protected RollingCounter()
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Current.ValueChanged += val =>
{
if (IsLoaded)
TransformCount(DisplayedCount, val.NewValue);
};
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -81,6 +75,13 @@ namespace osu.Game.Graphics.UserInterface
Child = displayedCountSpriteText; Child = displayedCountSpriteText;
} }
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(val => TransformCount(DisplayedCount, val.NewValue), true);
}
/// <summary> /// <summary>
/// Sets count value, bypassing rollover animation. /// Sets count value, bypassing rollover animation.
/// </summary> /// </summary>