mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Fix ModDisplay potentially being operated on before loaded completely
Closes https://github.com/ppy/osu/issues/11810.
This commit is contained in:
parent
d757dfa05c
commit
403536ef80
@ -72,19 +72,6 @@ namespace osu.Game.Screens.Play.HUD
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Current.ValueChanged += mods =>
|
||||
{
|
||||
iconsContainer.Clear();
|
||||
|
||||
foreach (Mod mod in mods.NewValue)
|
||||
{
|
||||
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||
}
|
||||
|
||||
if (IsLoaded)
|
||||
appearTransform();
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
@ -97,7 +84,16 @@ namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
appearTransform();
|
||||
Current.BindValueChanged(mods =>
|
||||
{
|
||||
iconsContainer.Clear();
|
||||
|
||||
foreach (Mod mod in mods.NewValue)
|
||||
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||
|
||||
appearTransform();
|
||||
}, true);
|
||||
|
||||
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user