mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Merge pull request #11811 from peppy/fix-mod-display-thread-safety
Fix ModDisplay potentially being operated on before loaded completely
This commit is contained in:
commit
e30fb72ee2
@ -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)
|
protected override void Dispose(bool isDisposing)
|
||||||
@ -97,7 +84,19 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
appearTransform();
|
Current.BindValueChanged(mods =>
|
||||||
|
{
|
||||||
|
iconsContainer.Clear();
|
||||||
|
|
||||||
|
if (mods.NewValue != null)
|
||||||
|
{
|
||||||
|
foreach (Mod mod in mods.NewValue)
|
||||||
|
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||||
|
|
||||||
|
appearTransform();
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
|
||||||
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user