mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 07:07:18 +08:00
Merge branch 'master' into fix-missing-background-when-video
This commit is contained in:
commit
2d2c8700b4
@ -149,8 +149,8 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
public DownloadState DownloadState => State.Value;
|
||||
|
||||
public TestDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
|
||||
: base(beatmapSet, noVideo)
|
||||
public TestDownloadButton(BeatmapSetInfo beatmapSet)
|
||||
: base(beatmapSet)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ namespace osu.Game.Configuration
|
||||
};
|
||||
|
||||
Set(OsuSetting.ExternalLinkWarning, true);
|
||||
Set(OsuSetting.PreferNoVideo, false);
|
||||
|
||||
// Audio
|
||||
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
||||
@ -214,6 +215,7 @@ namespace osu.Game.Configuration
|
||||
IncreaseFirstObjectVisibility,
|
||||
ScoreDisplayMode,
|
||||
ExternalLinkWarning,
|
||||
PreferNoVideo,
|
||||
Scaling,
|
||||
ScalingPositionX,
|
||||
ScalingPositionY,
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online;
|
||||
@ -16,8 +17,6 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
protected bool DownloadEnabled => button.Enabled.Value;
|
||||
|
||||
private readonly bool noVideo;
|
||||
|
||||
/// <summary>
|
||||
/// Currently selected beatmap. Used to present the correct difficulty after completing a download.
|
||||
/// </summary>
|
||||
@ -25,12 +24,11 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
private readonly ShakeContainer shakeContainer;
|
||||
private readonly DownloadButton button;
|
||||
private Bindable<bool> noVideoSetting;
|
||||
|
||||
public PanelDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
|
||||
public PanelDownloadButton(BeatmapSetInfo beatmapSet)
|
||||
: base(beatmapSet)
|
||||
{
|
||||
this.noVideo = noVideo;
|
||||
|
||||
InternalChild = shakeContainer = new ShakeContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -50,7 +48,7 @@ namespace osu.Game.Overlays.Direct
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game, BeatmapManager beatmaps)
|
||||
private void load(OsuGame game, BeatmapManager beatmaps, OsuConfigManager osuConfig)
|
||||
{
|
||||
if (BeatmapSet.Value?.OnlineInfo?.Availability?.DownloadDisabled ?? false)
|
||||
{
|
||||
@ -59,6 +57,8 @@ namespace osu.Game.Overlays.Direct
|
||||
return;
|
||||
}
|
||||
|
||||
noVideoSetting = osuConfig.GetBindable<bool>(OsuSetting.PreferNoVideo);
|
||||
|
||||
button.Action = () =>
|
||||
{
|
||||
switch (State.Value)
|
||||
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Direct
|
||||
break;
|
||||
|
||||
default:
|
||||
beatmaps.Download(BeatmapSet.Value, noVideo);
|
||||
beatmaps.Download(BeatmapSet.Value, noVideoSetting.Value);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
@ -21,6 +21,12 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
||||
LabelText = "Warn about opening external links",
|
||||
Bindable = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning)
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Prefer downloads without video",
|
||||
Keywords = new[] { "no-video" },
|
||||
Bindable = config.GetBindable<bool>(OsuSetting.PreferNoVideo)
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -212,8 +212,8 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
private class PlaylistDownloadButton : PanelDownloadButton
|
||||
{
|
||||
public PlaylistDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
|
||||
: base(beatmapSet, noVideo)
|
||||
public PlaylistDownloadButton(BeatmapSetInfo beatmapSet)
|
||||
: base(beatmapSet)
|
||||
{
|
||||
Alpha = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user