mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 10:12:53 +08:00
Apply review suggestions
This commit is contained in:
parent
fc1d497a86
commit
633b969017
@ -149,8 +149,8 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
public DownloadState DownloadState => State.Value;
|
public DownloadState DownloadState => State.Value;
|
||||||
|
|
||||||
public TestDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
|
public TestDownloadButton(BeatmapSetInfo beatmapSet)
|
||||||
: base(beatmapSet, noVideo)
|
: base(beatmapSet)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -15,16 +16,13 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
protected bool DownloadEnabled => button.Enabled.Value;
|
protected bool DownloadEnabled => button.Enabled.Value;
|
||||||
|
|
||||||
private readonly bool? noVideo;
|
|
||||||
|
|
||||||
private readonly ShakeContainer shakeContainer;
|
private readonly ShakeContainer shakeContainer;
|
||||||
private readonly DownloadButton button;
|
private readonly DownloadButton button;
|
||||||
|
private readonly BindableBool noVideoSetting = new BindableBool();
|
||||||
|
|
||||||
public PanelDownloadButton(BeatmapSetInfo beatmapSet, bool? noVideo = null)
|
public PanelDownloadButton(BeatmapSetInfo beatmapSet)
|
||||||
: base(beatmapSet)
|
: base(beatmapSet)
|
||||||
{
|
{
|
||||||
this.noVideo = noVideo;
|
|
||||||
|
|
||||||
InternalChild = shakeContainer = new ShakeContainer
|
InternalChild = shakeContainer = new ShakeContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -53,6 +51,8 @@ namespace osu.Game.Overlays.Direct
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noVideoSetting.BindTo(osuConfig.GetBindable<bool>(OsuSetting.PreferNoVideo));
|
||||||
|
|
||||||
button.Action = () =>
|
button.Action = () =>
|
||||||
{
|
{
|
||||||
switch (State.Value)
|
switch (State.Value)
|
||||||
@ -67,8 +67,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
var minimiseDownloadSize = noVideo ?? osuConfig.GetBindable<bool>(OsuSetting.PreferNoVideo).Value;
|
beatmaps.Download(BeatmapSet.Value, noVideoSetting.Value);
|
||||||
beatmaps.Download(BeatmapSet.Value, minimiseDownloadSize);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,8 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
|||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Prefer no-video downloads",
|
LabelText = "Prefer downloads without video",
|
||||||
|
Keywords = new[] { "no-video" },
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.PreferNoVideo)
|
Bindable = config.GetBindable<bool>(OsuSetting.PreferNoVideo)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -212,8 +212,8 @@ namespace osu.Game.Screens.Multi
|
|||||||
|
|
||||||
private class PlaylistDownloadButton : PanelDownloadButton
|
private class PlaylistDownloadButton : PanelDownloadButton
|
||||||
{
|
{
|
||||||
public PlaylistDownloadButton(BeatmapSetInfo beatmapSet, bool? noVideo = null)
|
public PlaylistDownloadButton(BeatmapSetInfo beatmapSet)
|
||||||
: base(beatmapSet, noVideo)
|
: base(beatmapSet)
|
||||||
{
|
{
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user