Fix ValueChanged events being called out of order

This commit is contained in:
David Zhao 2019-07-26 19:00:07 +09:00
parent 6f2edaad55
commit 6e09d857fd

View File

@ -53,7 +53,13 @@ namespace osu.Game.Graphics.Containers
samplePopIn = audio.Samples.Get(@"UI/overlay-pop-in");
samplePopOut = audio.Samples.Get(@"UI/overlay-pop-out");
}
protected override void LoadComplete()
{
base.LoadComplete();
// This must be added after the base LoadComplete. The overlay may need to be hidden immediately if its disabled.
State.ValueChanged += onStateChanged;
}