1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 08:22:56 +08:00

Remove individual setting to disable videos, fix tests

This commit is contained in:
voidedWarranties 2020-03-07 22:08:38 -08:00
parent 76c832518f
commit 48282dea8b
8 changed files with 13 additions and 20 deletions

View File

@ -26,7 +26,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
var storyboard = decoder.Decode(stream);
Assert.IsTrue(storyboard.HasDrawable);
Assert.AreEqual(4, storyboard.Layers.Count());
Assert.AreEqual(5, storyboard.Layers.Count());
StoryboardLayer background = storyboard.Layers.FirstOrDefault(l => l.Depth == 3);
Assert.IsNotNull(background);

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Screens.Play;
using osu.Game.Storyboards.Drawables;
using osuTK.Graphics;
@ -24,9 +25,13 @@ namespace osu.Game.Tests.Visual.Gameplay
[Cached]
private MusicController musicController = new MusicController();
[Cached]
private GameplayClock gameplayClock;
public TestSceneStoryboard()
{
Clock = new FramedClock();
gameplayClock = new GameplayClock(Clock);
AddRange(new Drawable[]
{

View File

@ -70,7 +70,6 @@ namespace osu.Game.Configuration
Set(OsuSetting.ShowFpsDisplay, false);
Set(OsuSetting.ShowStoryboard, true);
Set(OsuSetting.ShowVideoBackground, true);
Set(OsuSetting.BeatmapSkins, true);
Set(OsuSetting.BeatmapHitsounds, true);
@ -176,7 +175,6 @@ namespace osu.Game.Configuration
BlurLevel,
LightenDuringBreaks,
ShowStoryboard,
ShowVideoBackground,
KeyOverlay,
ScoreMeter,
FloatingComments,

View File

@ -55,8 +55,6 @@ namespace osu.Game.Graphics.Containers
protected Bindable<bool> ShowStoryboard { get; private set; }
protected Bindable<bool> ShowVideo { get; private set; }
private float breakLightening => LightenDuringBreaks.Value && IsBreakTime.Value ? BREAK_LIGHTEN_AMOUNT : 0;
protected float DimLevel => Math.Max(EnableUserDim.Value && !IgnoreUserSettings.Value ? (float)UserDimLevel.Value - breakLightening : 0, 0);
@ -79,14 +77,12 @@ namespace osu.Game.Graphics.Containers
UserDimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
LightenDuringBreaks = config.GetBindable<bool>(OsuSetting.LightenDuringBreaks);
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
ShowVideo = config.GetBindable<bool>(OsuSetting.ShowVideoBackground);
EnableUserDim.ValueChanged += _ => UpdateVisuals();
UserDimLevel.ValueChanged += _ => UpdateVisuals();
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
IsBreakTime.ValueChanged += _ => UpdateVisuals();
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
ShowVideo.ValueChanged += _ => UpdateVisuals();
StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals();
IgnoreUserSettings.ValueChanged += _ => UpdateVisuals();
}

View File

@ -22,11 +22,6 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
},
new SettingsCheckbox
{
LabelText = "Video",
Bindable = config.GetBindable<bool>(OsuSetting.ShowVideoBackground)
},
new SettingsCheckbox
{
LabelText = "Hit Lighting",
Bindable = config.GetBindable<bool>(OsuSetting.HitLighting)

View File

@ -166,7 +166,7 @@ namespace osu.Game.Screens.Backgrounds
BlurAmount.ValueChanged += _ => UpdateVisuals();
}
protected override bool ShowDimContent => !ShowStoryboard.Value || !StoryboardReplacesBackground.Value || !ShowVideo.Value; // The background needs to be hidden in the case of it being replaced by the storyboard
protected override bool ShowDimContent => !ShowStoryboard.Value || !StoryboardReplacesBackground.Value; // The background needs to be hidden in the case of it being replaced by the storyboard
protected override void UpdateVisuals()
{

View File

@ -15,7 +15,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
private readonly PlayerSliderBar<double> dimSliderBar;
private readonly PlayerSliderBar<double> blurSliderBar;
private readonly PlayerCheckbox showStoryboardToggle;
private readonly PlayerCheckbox showVideoToggle;
private readonly PlayerCheckbox beatmapSkinsToggle;
private readonly PlayerCheckbox beatmapHitsoundsToggle;
@ -44,7 +43,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
Text = "Toggles:"
},
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" },
showVideoToggle = new PlayerCheckbox { LabelText = "Video" },
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" },
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }
};
@ -56,7 +54,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
showVideoToggle.Current = config.GetBindable<bool>(OsuSetting.ShowVideoBackground);
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
}

View File

@ -32,11 +32,13 @@ namespace osu.Game.Storyboards.Drawables
RelativeSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader]
[BackgroundDependencyLoader(true)]
private void load(GameplayClock clock, IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
{
if (clock != null)
this.clock = clock;
if (clock == null)
return;
this.clock = clock;
var path = beatmap.Value.BeatmapSetInfo?.Files?.Find(f => f.Filename.Equals(Video.Path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
@ -64,7 +66,7 @@ namespace osu.Game.Storyboards.Drawables
protected override void Update()
{
if (clock.CurrentTime > Video.StartTime)
if (clock != null && clock.CurrentTime > Video.StartTime)
{
if (!videoStarted)
{