changing song select background blur setting to boolean

This commit is contained in:
Jérémiah DÉCOMBE 2023-01-24 09:19:53 +01:00
parent d783998c81
commit 7ca2a431e6
3 changed files with 8 additions and 8 deletions

View File

@ -60,7 +60,7 @@ protected override void InitialiseDefaults()
SetDefault(OsuSetting.ToolbarClockDisplayMode, ToolbarClockDisplayMode.Full);
SetDefault(OsuSetting.SongSelectBackgoundBlurLevel, 1f, 0, 1f, 0.01f);
SetDefault(OsuSetting.SongSelectBackgoundBlur, true);
// Online settings
SetDefault(OsuSetting.Username, string.Empty);
@ -341,7 +341,7 @@ public enum OsuSetting
ChatDisplayHeight,
BeatmapListingCardSize,
ToolbarClockDisplayMode,
SongSelectBackgoundBlurLevel,
SongSelectBackgoundBlur,
Version,
ShowFirstRunSetup,
ShowConvertedBeatmaps,

View File

@ -43,10 +43,10 @@ private void load(OsuConfigManager config)
Current = config.GetBindable<ModSelectHotkeyStyle>(OsuSetting.ModSelectHotkeyStyle),
ClassicDefault = ModSelectHotkeyStyle.Classic
},
new SettingsSlider<float>
new SettingsCheckbox
{
LabelText = UserInterfaceStrings.SongSelectBackgroundBlurLevel,
Current = config.GetBindable<float>(OsuSetting.SongSelectBackgoundBlurLevel)
Current = config.GetBindable<bool>(OsuSetting.SongSelectBackgoundBlur)
}
};
}

View File

@ -125,12 +125,12 @@ public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBind
[Resolved]
internal IOverlayManager? OverlayManager { get; private set; }
private Bindable<float> backgroundBlurLevel { get; set; } = new BindableFloat();
private Bindable<bool> backgroundBlurLevel { get; set; } = new BindableBool();
[BackgroundDependencyLoader(true)]
private void load(AudioManager audio, OsuColour colours, ManageCollectionsDialog? manageCollectionsDialog, DifficultyRecommender? recommender, OsuConfigManager config)
{
backgroundBlurLevel = config.GetBindable<float>(OsuSetting.SongSelectBackgoundBlurLevel);
backgroundBlurLevel = config.GetBindable<bool>(OsuSetting.SongSelectBackgoundBlur);
backgroundBlurLevel.BindValueChanged(e =>
{
if (this.IsCurrentScreen())
@ -138,7 +138,7 @@ private void load(AudioManager audio, OsuColour colours, ManageCollectionsDialog
ApplyToBackground(background =>
{
background.IgnoreUserSettings.Value = true;
background.BlurAmount.Value = e.NewValue * BACKGROUND_BLUR;
background.BlurAmount.Value = e.NewValue ? BACKGROUND_BLUR : 0;
});
}
}, true);
@ -758,7 +758,7 @@ private void updateComponentFromBeatmap(WorkingBeatmap beatmap)
ApplyToBackground(backgroundModeBeatmap =>
{
backgroundModeBeatmap.Beatmap = beatmap;
backgroundModeBeatmap.BlurAmount.Value = backgroundBlurLevel.Value * BACKGROUND_BLUR;
backgroundModeBeatmap.BlurAmount.Value = backgroundBlurLevel.Value ? BACKGROUND_BLUR : 0f;
backgroundModeBeatmap.FadeColour(Color4.White, 250);
});