mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +08:00
Merge pull request #15835 from bdach/off-thread-transforms-unbind
Fix instances of components adding off-thread transforms on unbind
This commit is contained in:
commit
51a7c60eec
@ -214,7 +214,8 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
beatmap.BindDisabledChanged(beatmapDisabledChanged, true);
|
beatmap.BindDisabledChanged(_ => Scheduler.AddOnce(beatmapDisabledChanged));
|
||||||
|
beatmapDisabledChanged();
|
||||||
|
|
||||||
musicController.TrackChanged += trackChanged;
|
musicController.TrackChanged += trackChanged;
|
||||||
trackChanged(beatmap.Value);
|
trackChanged(beatmap.Value);
|
||||||
@ -318,8 +319,10 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmapDisabledChanged(bool disabled)
|
private void beatmapDisabledChanged()
|
||||||
{
|
{
|
||||||
|
bool disabled = beatmap.Disabled;
|
||||||
|
|
||||||
if (disabled)
|
if (disabled)
|
||||||
playlist?.Hide();
|
playlist?.Hide();
|
||||||
|
|
||||||
|
@ -68,13 +68,19 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Current.BindDisabledChanged(disabled => this.FadeColour(disabled ? Color4.Gray : Color4.White, 300), true);
|
Current.BindDisabledChanged(_ => Scheduler.AddOnce(currentDisabledChanged));
|
||||||
Current.BindValueChanged(_ => moveLineToCurrent());
|
currentDisabledChanged();
|
||||||
|
|
||||||
|
Current.BindValueChanged(_ => moveLineToCurrent());
|
||||||
// Scheduled to allow the button flow layout to be computed before the line position is updated
|
// Scheduled to allow the button flow layout to be computed before the line position is updated
|
||||||
ScheduleAfterChildren(moveLineToCurrent);
|
ScheduleAfterChildren(moveLineToCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void currentDisabledChanged()
|
||||||
|
{
|
||||||
|
this.FadeColour(Current.Disabled ? Color4.Gray : Color4.White, 300);
|
||||||
|
}
|
||||||
|
|
||||||
private bool hasInitialPosition;
|
private bool hasInitialPosition;
|
||||||
|
|
||||||
private void moveLineToCurrent()
|
private void moveLineToCurrent()
|
||||||
|
Loading…
Reference in New Issue
Block a user