mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Add a setting to hide storyboards.
This commit is contained in:
parent
ddaf28d7f6
commit
cb8029af9e
@ -54,6 +54,8 @@ namespace osu.Game.Configuration
|
||||
// Graphics
|
||||
Set(OsuSetting.ShowFpsDisplay, false);
|
||||
|
||||
Set(OsuSetting.ShowStoryboard, true);
|
||||
|
||||
Set(OsuSetting.MenuParallax, true);
|
||||
|
||||
Set(OsuSetting.SnakingInSliders, true);
|
||||
@ -87,6 +89,7 @@ namespace osu.Game.Configuration
|
||||
GameplayCursorSize,
|
||||
AutoCursorSize,
|
||||
DimLevel,
|
||||
ShowStoryboard,
|
||||
KeyOverlay,
|
||||
FloatingComments,
|
||||
PlaybackSpeed,
|
||||
|
@ -1,10 +1,27 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Configuration;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
{
|
||||
public class DetailSettings : SettingsSubsection
|
||||
{
|
||||
protected override string Header => "Detail Settings";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Storyboards",
|
||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ namespace osu.Game.Screens.Play
|
||||
#region User Settings
|
||||
|
||||
private Bindable<double> dimLevel;
|
||||
private Bindable<bool> showStoryboard;
|
||||
private Bindable<bool> mouseWheelDisabled;
|
||||
private Bindable<double> userAudioOffset;
|
||||
|
||||
@ -82,6 +83,7 @@ namespace osu.Game.Screens.Play
|
||||
this.api = api;
|
||||
|
||||
dimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||
|
||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||
|
||||
@ -213,6 +215,7 @@ namespace osu.Game.Screens.Play
|
||||
storyboardUsesBackground = beatmap.StoryboardUsesBackground;
|
||||
storyboard.Width = storyboard.Height * beatmap.BeatmapInfo.StoryboardAspect;
|
||||
storyboard.Masking = true;
|
||||
storyboard.Alpha = showStoryboard ? 1 : 0;
|
||||
|
||||
hudOverlay.BindProcessor(scoreProcessor);
|
||||
hudOverlay.BindRulesetContainer(RulesetContainer);
|
||||
@ -285,8 +288,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
(Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, Easing.OutQuint);
|
||||
|
||||
applyDim();
|
||||
dimLevel.ValueChanged += newDim => applyDim();
|
||||
dimLevel.ValueChanged += value => updateBackgroundElements();
|
||||
showStoryboard.ValueChanged += value => updateBackgroundElements();
|
||||
updateBackgroundElements();
|
||||
|
||||
Content.Alpha = 0;
|
||||
Content
|
||||
@ -327,13 +331,13 @@ namespace osu.Game.Screens.Play
|
||||
return true;
|
||||
}
|
||||
|
||||
private void applyDim()
|
||||
private void updateBackgroundElements()
|
||||
{
|
||||
var opacity = 1 - (float)dimLevel;
|
||||
storyboard.FadeColour(new Color4(opacity, opacity, opacity, 1), 800);
|
||||
storyboard.FadeTo(opacity == 0 ? 0 : 1);
|
||||
storyboard.FadeTo(!showStoryboard || opacity == 0 ? 0 : 1, 800);
|
||||
|
||||
Background?.FadeTo(storyboardUsesBackground ? 0 : opacity, 800, Easing.OutQuint);
|
||||
Background?.FadeTo(showStoryboard && storyboardUsesBackground ? 0 : opacity, 800, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private void fadeOut()
|
||||
|
Loading…
Reference in New Issue
Block a user