1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 23:40:44 +08:00

Merge pull request #26544 from peppy/fix-background-dim-failure

Fix background dim occasionally getting in a bad state when exiting gameplay
This commit is contained in:
Bartłomiej Dach
2024-01-15 15:16:37 +01:00
committed by GitHub
Unverified
2 changed files with 9 additions and 3 deletions
@@ -51,7 +51,7 @@ namespace osu.Game.Screens.Backgrounds
/// </summary>
public readonly Bindable<float> DimWhenUserSettingsIgnored = new Bindable<float>();
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
internal readonly Bindable<bool> IsBreakTime = new Bindable<bool>();
private readonly DimmableBackground dimmable;
+8 -2
View File
@@ -1078,7 +1078,7 @@ namespace osu.Game.Screens.Play
b.FadeColour(Color4.White, 250);
// bind component bindables.
b.IsBreakTime.BindTo(breakTracker.IsBreakTime);
((IBindable<bool>)b.IsBreakTime).BindTo(breakTracker.IsBreakTime);
b.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground);
@@ -1238,7 +1238,13 @@ namespace osu.Game.Screens.Play
if (this.IsCurrentScreen())
{
ApplyToBackground(b => b.IgnoreUserSettings.Value = true);
ApplyToBackground(b =>
{
b.IgnoreUserSettings.Value = true;
b.IsBreakTime.UnbindFrom(breakTracker.IsBreakTime);
b.IsBreakTime.Value = false;
});
storyboardReplacesBackground.Value = false;
}
}