mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 22:22:59 +08:00
Remove individual setting to disable videos, fix tests
This commit is contained in:
parent
76c832518f
commit
48282dea8b
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
var storyboard = decoder.Decode(stream);
|
var storyboard = decoder.Decode(stream);
|
||||||
|
|
||||||
Assert.IsTrue(storyboard.HasDrawable);
|
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);
|
StoryboardLayer background = storyboard.Layers.FirstOrDefault(l => l.Depth == 3);
|
||||||
Assert.IsNotNull(background);
|
Assert.IsNotNull(background);
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Storyboards.Drawables;
|
using osu.Game.Storyboards.Drawables;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -24,9 +25,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Cached]
|
[Cached]
|
||||||
private MusicController musicController = new MusicController();
|
private MusicController musicController = new MusicController();
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private GameplayClock gameplayClock;
|
||||||
|
|
||||||
public TestSceneStoryboard()
|
public TestSceneStoryboard()
|
||||||
{
|
{
|
||||||
Clock = new FramedClock();
|
Clock = new FramedClock();
|
||||||
|
gameplayClock = new GameplayClock(Clock);
|
||||||
|
|
||||||
AddRange(new Drawable[]
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,6 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.ShowFpsDisplay, false);
|
Set(OsuSetting.ShowFpsDisplay, false);
|
||||||
|
|
||||||
Set(OsuSetting.ShowStoryboard, true);
|
Set(OsuSetting.ShowStoryboard, true);
|
||||||
Set(OsuSetting.ShowVideoBackground, true);
|
|
||||||
Set(OsuSetting.BeatmapSkins, true);
|
Set(OsuSetting.BeatmapSkins, true);
|
||||||
Set(OsuSetting.BeatmapHitsounds, true);
|
Set(OsuSetting.BeatmapHitsounds, true);
|
||||||
|
|
||||||
@ -176,7 +175,6 @@ namespace osu.Game.Configuration
|
|||||||
BlurLevel,
|
BlurLevel,
|
||||||
LightenDuringBreaks,
|
LightenDuringBreaks,
|
||||||
ShowStoryboard,
|
ShowStoryboard,
|
||||||
ShowVideoBackground,
|
|
||||||
KeyOverlay,
|
KeyOverlay,
|
||||||
ScoreMeter,
|
ScoreMeter,
|
||||||
FloatingComments,
|
FloatingComments,
|
||||||
|
@ -55,8 +55,6 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected Bindable<bool> ShowStoryboard { get; private set; }
|
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;
|
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);
|
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);
|
UserDimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||||
LightenDuringBreaks = config.GetBindable<bool>(OsuSetting.LightenDuringBreaks);
|
LightenDuringBreaks = config.GetBindable<bool>(OsuSetting.LightenDuringBreaks);
|
||||||
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
ShowVideo = config.GetBindable<bool>(OsuSetting.ShowVideoBackground);
|
|
||||||
|
|
||||||
EnableUserDim.ValueChanged += _ => UpdateVisuals();
|
EnableUserDim.ValueChanged += _ => UpdateVisuals();
|
||||||
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
||||||
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
|
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
|
||||||
IsBreakTime.ValueChanged += _ => UpdateVisuals();
|
IsBreakTime.ValueChanged += _ => UpdateVisuals();
|
||||||
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
||||||
ShowVideo.ValueChanged += _ => UpdateVisuals();
|
|
||||||
StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals();
|
StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals();
|
||||||
IgnoreUserSettings.ValueChanged += _ => UpdateVisuals();
|
IgnoreUserSettings.ValueChanged += _ => UpdateVisuals();
|
||||||
}
|
}
|
||||||
|
@ -22,11 +22,6 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
|
Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
|
||||||
LabelText = "Video",
|
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.ShowVideoBackground)
|
|
||||||
},
|
|
||||||
new SettingsCheckbox
|
|
||||||
{
|
{
|
||||||
LabelText = "Hit Lighting",
|
LabelText = "Hit Lighting",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.HitLighting)
|
Bindable = config.GetBindable<bool>(OsuSetting.HitLighting)
|
||||||
|
@ -166,7 +166,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
BlurAmount.ValueChanged += _ => UpdateVisuals();
|
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()
|
protected override void UpdateVisuals()
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
private readonly PlayerSliderBar<double> dimSliderBar;
|
private readonly PlayerSliderBar<double> dimSliderBar;
|
||||||
private readonly PlayerSliderBar<double> blurSliderBar;
|
private readonly PlayerSliderBar<double> blurSliderBar;
|
||||||
private readonly PlayerCheckbox showStoryboardToggle;
|
private readonly PlayerCheckbox showStoryboardToggle;
|
||||||
private readonly PlayerCheckbox showVideoToggle;
|
|
||||||
private readonly PlayerCheckbox beatmapSkinsToggle;
|
private readonly PlayerCheckbox beatmapSkinsToggle;
|
||||||
private readonly PlayerCheckbox beatmapHitsoundsToggle;
|
private readonly PlayerCheckbox beatmapHitsoundsToggle;
|
||||||
|
|
||||||
@ -44,7 +43,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
Text = "Toggles:"
|
Text = "Toggles:"
|
||||||
},
|
},
|
||||||
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" },
|
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" },
|
||||||
showVideoToggle = new PlayerCheckbox { LabelText = "Video" },
|
|
||||||
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" },
|
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" },
|
||||||
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }
|
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }
|
||||||
};
|
};
|
||||||
@ -56,7 +54,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
|
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||||
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
|
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
|
||||||
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
showVideoToggle.Current = config.GetBindable<bool>(OsuSetting.ShowVideoBackground);
|
|
||||||
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
||||||
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
||||||
}
|
}
|
||||||
|
@ -32,11 +32,13 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(GameplayClock clock, IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
|
private void load(GameplayClock clock, IBindable<WorkingBeatmap> beatmap, TextureStore textureStore)
|
||||||
{
|
{
|
||||||
if (clock != null)
|
if (clock == null)
|
||||||
this.clock = clock;
|
return;
|
||||||
|
|
||||||
|
this.clock = clock;
|
||||||
|
|
||||||
var path = beatmap.Value.BeatmapSetInfo?.Files?.Find(f => f.Filename.Equals(Video.Path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
if (clock.CurrentTime > Video.StartTime)
|
if (clock != null && clock.CurrentTime > Video.StartTime)
|
||||||
{
|
{
|
||||||
if (!videoStarted)
|
if (!videoStarted)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user