mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:53:04 +08:00
Add setting to turn on/off the video
This commit is contained in:
parent
5dd688a51b
commit
fa3591e5ec
@ -69,6 +69,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.ShowFpsDisplay, false);
|
Set(OsuSetting.ShowFpsDisplay, false);
|
||||||
|
|
||||||
Set(OsuSetting.ShowStoryboard, true);
|
Set(OsuSetting.ShowStoryboard, true);
|
||||||
|
Set(OsuSetting.ShowVideo, true);
|
||||||
Set(OsuSetting.BeatmapSkins, true);
|
Set(OsuSetting.BeatmapSkins, true);
|
||||||
Set(OsuSetting.BeatmapHitsounds, true);
|
Set(OsuSetting.BeatmapHitsounds, true);
|
||||||
|
|
||||||
@ -136,6 +137,7 @@ namespace osu.Game.Configuration
|
|||||||
DimLevel,
|
DimLevel,
|
||||||
BlurLevel,
|
BlurLevel,
|
||||||
ShowStoryboard,
|
ShowStoryboard,
|
||||||
|
ShowVideo,
|
||||||
KeyOverlay,
|
KeyOverlay,
|
||||||
ScoreMeter,
|
ScoreMeter,
|
||||||
FloatingComments,
|
FloatingComments,
|
||||||
|
@ -35,6 +35,8 @@ 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; }
|
||||||
|
|
||||||
protected double DimLevel => EnableUserDim.Value ? UserDimLevel.Value : 0;
|
protected double DimLevel => EnableUserDim.Value ? UserDimLevel.Value : 0;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => dimContent;
|
protected override Container<Drawable> Content => dimContent;
|
||||||
@ -54,10 +56,12 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
UserDimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
|
UserDimLevel = config.GetBindable<double>(OsuSetting.DimLevel);
|
||||||
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
|
ShowVideo = config.GetBindable<bool>(OsuSetting.ShowVideo);
|
||||||
|
|
||||||
EnableUserDim.ValueChanged += _ => UpdateVisuals();
|
EnableUserDim.ValueChanged += _ => UpdateVisuals();
|
||||||
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
||||||
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
||||||
|
ShowVideo.ValueChanged += _ => UpdateVisuals();
|
||||||
StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals();
|
StoryboardReplacesBackground.ValueChanged += _ => UpdateVisuals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@ 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.ShowVideo)
|
||||||
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Rotate cursor when dragging",
|
LabelText = "Rotate cursor when dragging",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
Bindable = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
||||||
|
@ -178,7 +178,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
BlurAmount.ValueChanged += _ => UpdateVisuals();
|
BlurAmount.ValueChanged += _ => UpdateVisuals();
|
||||||
}
|
}
|
||||||
|
|
||||||
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 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 void UpdateVisuals()
|
protected override void UpdateVisuals()
|
||||||
{
|
{
|
||||||
|
@ -27,18 +27,18 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
ShowStoryboard.BindValueChanged(_ => initializeVideo(true), true);
|
ShowVideo.BindValueChanged(_ => initializeVideo(true), true);
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool ShowDimContent => ShowStoryboard.Value && DimLevel < 1;
|
protected override bool ShowDimContent => ShowVideo.Value && DimLevel < 1;
|
||||||
|
|
||||||
private void initializeVideo(bool async)
|
private void initializeVideo(bool async)
|
||||||
{
|
{
|
||||||
if (drawableVideo != null)
|
if (drawableVideo != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ShowStoryboard.Value)
|
if (!ShowVideo.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawableVideo = new DrawableVideo(video);
|
drawableVideo = new DrawableVideo(video);
|
||||||
|
@ -15,6 +15,7 @@ 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;
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ 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" }
|
||||||
};
|
};
|
||||||
@ -48,6 +50,7 @@ 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.ShowVideo);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user