2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Configuration;
|
2022-01-28 12:53:48 +08:00
|
|
|
|
using osu.Game.Localisation;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.PlayerSettings
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class VisualSettings : PlayerSettingsGroup
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly PlayerSliderBar<double> dimSliderBar;
|
|
|
|
|
private readonly PlayerSliderBar<double> blurSliderBar;
|
2022-11-02 12:48:03 +08:00
|
|
|
|
private readonly PlayerSliderBar<float> comboColourNormalisationSliderBar;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private readonly PlayerCheckbox showStoryboardToggle;
|
2018-04-25 15:15:23 +08:00
|
|
|
|
private readonly PlayerCheckbox beatmapSkinsToggle;
|
2021-01-13 13:09:22 +08:00
|
|
|
|
private readonly PlayerCheckbox beatmapColorsToggle;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public VisualSettings()
|
2020-09-09 17:48:02 +08:00
|
|
|
|
: base("Visual Settings")
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-01-28 12:32:30 +08:00
|
|
|
|
dimSliderBar = new PlayerSliderBar<double>
|
|
|
|
|
{
|
2022-11-02 12:55:01 +08:00
|
|
|
|
LabelText = GameplaySettingsStrings.BackgroundDim,
|
2020-01-28 12:32:30 +08:00
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
|
|
|
|
blurSliderBar = new PlayerSliderBar<double>
|
|
|
|
|
{
|
2022-11-02 12:55:01 +08:00
|
|
|
|
LabelText = GameplaySettingsStrings.BackgroundBlur,
|
2020-01-28 12:32:30 +08:00
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
2022-01-28 12:53:48 +08:00
|
|
|
|
showStoryboardToggle = new PlayerCheckbox { LabelText = GraphicsSettingsStrings.StoryboardVideo },
|
|
|
|
|
beatmapSkinsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapSkins },
|
|
|
|
|
beatmapColorsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapColours },
|
2022-11-02 12:48:03 +08:00
|
|
|
|
comboColourNormalisationSliderBar = new PlayerSliderBar<float>
|
|
|
|
|
{
|
2022-11-02 13:01:03 +08:00
|
|
|
|
LabelText = GraphicsSettingsStrings.ComboColourNormalisation,
|
2022-11-02 12:48:03 +08:00
|
|
|
|
DisplayAsPercentage = true,
|
|
|
|
|
},
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuConfigManager config)
|
|
|
|
|
{
|
2020-10-06 16:18:41 +08:00
|
|
|
|
dimSliderBar.Current = config.GetBindable<double>(OsuSetting.DimLevel);
|
|
|
|
|
blurSliderBar.Current = config.GetBindable<double>(OsuSetting.BlurLevel);
|
2019-06-17 18:37:24 +08:00
|
|
|
|
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
|
|
|
|
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
2021-01-13 13:09:22 +08:00
|
|
|
|
beatmapColorsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapColours);
|
2022-11-02 17:14:20 +08:00
|
|
|
|
comboColourNormalisationSliderBar.Current = config.GetBindable<float>(OsuSetting.ComboColourNormalisationAmount);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|