mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +08:00
Only apply dim changes when background blur is disabled
This commit is contained in:
parent
19e3c5d33c
commit
9ed068c1e6
@ -21,7 +21,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const float BREAK_LIGHTEN_AMOUNT = 0.3f;
|
public const float BREAK_LIGHTEN_AMOUNT = 0.3f;
|
||||||
|
|
||||||
protected const double BACKGROUND_FADE_DURATION = 800;
|
public const double BACKGROUND_FADE_DURATION = 800;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not user-configured settings relating to brightness of elements should be ignored
|
/// Whether or not user-configured settings relating to brightness of elements should be ignored
|
||||||
|
@ -31,6 +31,7 @@ using osu.Game.Overlays;
|
|||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Screens.Backgrounds;
|
||||||
using osu.Game.Screens.Edit;
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
@ -148,7 +149,7 @@ namespace osu.Game.Screens.Select
|
|||||||
if (!this.IsCurrentScreen())
|
if (!this.IsCurrentScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyToBackground(b => b.BlurAmount.Value = e.NewValue ? BACKGROUND_BLUR : 0);
|
ApplyToBackground(applyBlurToBackground);
|
||||||
});
|
});
|
||||||
|
|
||||||
LoadComponentAsync(Carousel = new BeatmapCarousel
|
LoadComponentAsync(Carousel = new BeatmapCarousel
|
||||||
@ -194,6 +195,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
ParallaxAmount = 0.005f,
|
ParallaxAmount = 0.005f,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Alpha = 0,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Child = new WedgeBackground
|
Child = new WedgeBackground
|
||||||
@ -766,10 +768,10 @@ namespace osu.Game.Screens.Select
|
|||||||
ApplyToBackground(backgroundModeBeatmap =>
|
ApplyToBackground(backgroundModeBeatmap =>
|
||||||
{
|
{
|
||||||
backgroundModeBeatmap.Beatmap = beatmap;
|
backgroundModeBeatmap.Beatmap = beatmap;
|
||||||
backgroundModeBeatmap.BlurAmount.Value = configBackgroundBlur.Value ? BACKGROUND_BLUR : 0f;
|
|
||||||
backgroundModeBeatmap.IgnoreUserSettings.Value = true;
|
backgroundModeBeatmap.IgnoreUserSettings.Value = true;
|
||||||
backgroundModeBeatmap.DimWhenUserSettingsIgnored.Value = 0.4f;
|
|
||||||
backgroundModeBeatmap.FadeColour(Color4.White, 250);
|
backgroundModeBeatmap.FadeColour(Color4.White, 250);
|
||||||
|
|
||||||
|
applyBlurToBackground(backgroundModeBeatmap);
|
||||||
});
|
});
|
||||||
|
|
||||||
beatmapInfoWedge.Beatmap = beatmap;
|
beatmapInfoWedge.Beatmap = beatmap;
|
||||||
@ -787,6 +789,14 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void applyBlurToBackground(BackgroundScreenBeatmap backgroundModeBeatmap)
|
||||||
|
{
|
||||||
|
backgroundModeBeatmap.BlurAmount.Value = configBackgroundBlur.Value ? BACKGROUND_BLUR : 0f;
|
||||||
|
backgroundModeBeatmap.DimWhenUserSettingsIgnored.Value = configBackgroundBlur.Value ? 0 : 0.4f;
|
||||||
|
|
||||||
|
wedgeBackground.FadeTo(configBackgroundBlur.Value ? 0.5f : 0.2f, UserDimContainer.BACKGROUND_FADE_DURATION, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
private readonly WeakReference<ITrack?> lastTrack = new WeakReference<ITrack?>(null);
|
private readonly WeakReference<ITrack?> lastTrack = new WeakReference<ITrack?>(null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -22,7 +19,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Size = new Vector2(1, 0.5f),
|
Size = new Vector2(1, 0.5f),
|
||||||
Colour = Color4.Black.Opacity(0.2f),
|
Colour = Color4.Black,
|
||||||
Shear = new Vector2(0.15f, 0),
|
Shear = new Vector2(0.15f, 0),
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
},
|
},
|
||||||
@ -32,7 +29,7 @@ namespace osu.Game.Screens.Select
|
|||||||
RelativePositionAxes = Axes.Y,
|
RelativePositionAxes = Axes.Y,
|
||||||
Size = new Vector2(1, -0.5f),
|
Size = new Vector2(1, -0.5f),
|
||||||
Position = new Vector2(0, 1),
|
Position = new Vector2(0, 1),
|
||||||
Colour = Color4.Black.Opacity(0.2f),
|
Colour = Color4.Black,
|
||||||
Shear = new Vector2(-0.15f, 0),
|
Shear = new Vector2(-0.15f, 0),
|
||||||
EdgeSmoothness = new Vector2(2, 0),
|
EdgeSmoothness = new Vector2(2, 0),
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user