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;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.PlayerSettings
|
|
|
|
|
{
|
|
|
|
|
public class VisualSettings : PlayerSettingsGroup
|
|
|
|
|
{
|
|
|
|
|
protected override string Title => "Visual settings";
|
|
|
|
|
|
|
|
|
|
private readonly PlayerSliderBar<double> dimSliderBar;
|
|
|
|
|
private readonly PlayerSliderBar<double> blurSliderBar;
|
|
|
|
|
private readonly PlayerCheckbox showStoryboardToggle;
|
2018-04-25 15:15:23 +08:00
|
|
|
|
private readonly PlayerCheckbox beatmapSkinsToggle;
|
|
|
|
|
private readonly PlayerCheckbox beatmapHitsoundsToggle;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public VisualSettings()
|
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "Background dim:"
|
|
|
|
|
},
|
2020-01-28 12:32:30 +08:00
|
|
|
|
dimSliderBar = new PlayerSliderBar<double>
|
|
|
|
|
{
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
2018-04-13 17:19:50 +08:00
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "Background blur:"
|
|
|
|
|
},
|
2020-01-28 12:32:30 +08:00
|
|
|
|
blurSliderBar = new PlayerSliderBar<double>
|
|
|
|
|
{
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
2018-04-13 17:19:50 +08:00
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = "Toggles:"
|
|
|
|
|
},
|
2020-03-13 14:29:11 +08:00
|
|
|
|
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboard / Video" },
|
2018-04-25 15:15:23 +08:00
|
|
|
|
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" },
|
2019-01-22 09:06:30 +08:00
|
|
|
|
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuConfigManager config)
|
|
|
|
|
{
|
|
|
|
|
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
|
|
|
|
|
blurSliderBar.Bindable = 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);
|
|
|
|
|
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|