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