1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +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
commit 64e94a8b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -51,7 +51,7 @@ namespace osu.Game.Screens.Backgrounds
/// </summary> /// </summary>
public readonly Bindable<float> DimWhenUserSettingsIgnored = new Bindable<float>(); 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; private readonly DimmableBackground dimmable;

View File

@ -1078,7 +1078,7 @@ namespace osu.Game.Screens.Play
b.FadeColour(Color4.White, 250); b.FadeColour(Color4.White, 250);
// bind component bindables. // bind component bindables.
b.IsBreakTime.BindTo(breakTracker.IsBreakTime); ((IBindable<bool>)b.IsBreakTime).BindTo(breakTracker.IsBreakTime);
b.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground); b.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground);
@ -1238,7 +1238,13 @@ namespace osu.Game.Screens.Play
if (this.IsCurrentScreen()) 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; storyboardReplacesBackground.Value = false;
} }
} }