Make ModIcon a bit more safe

This commit is contained in:
smoogipoo 2021-02-02 13:42:45 +09:00
parent 1d3dff8c75
commit 53cfc3bc6e

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.UI
{
mod = value;
if (LoadState >= LoadState.Ready)
if (IsLoaded)
updateMod(value);
}
}
@ -98,13 +98,15 @@ namespace osu.Game.Rulesets.UI
[BackgroundDependencyLoader]
private void load()
{
updateMod(mod);
}
protected override void LoadComplete()
{
base.LoadComplete();
Selected.BindValueChanged(_ => updateColour(), true);
Selected.BindValueChanged(_ => updateColour());
updateMod(mod);
}
private void updateMod(Mod value)