mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 03:42:54 +08:00
Merge pull request #8980 from LittleEndu/already-downloaded
Check local availability of beatmap before disabling download buttons
This commit is contained in:
commit
8f370c5ef5
@ -50,13 +50,6 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuGame game, BeatmapManager beatmaps, OsuConfigManager osuConfig)
|
private void load(OsuGame game, BeatmapManager beatmaps, OsuConfigManager osuConfig)
|
||||||
{
|
{
|
||||||
if (BeatmapSet.Value?.OnlineInfo?.Availability?.DownloadDisabled ?? false)
|
|
||||||
{
|
|
||||||
button.Enabled.Value = false;
|
|
||||||
button.TooltipText = "this beatmap is currently not available for download.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
noVideoSetting = osuConfig.GetBindable<bool>(OsuSetting.PreferNoVideo);
|
noVideoSetting = osuConfig.GetBindable<bool>(OsuSetting.PreferNoVideo);
|
||||||
|
|
||||||
button.Action = () =>
|
button.Action = () =>
|
||||||
@ -81,6 +74,26 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
State.BindValueChanged(state =>
|
||||||
|
{
|
||||||
|
switch (state.NewValue)
|
||||||
|
{
|
||||||
|
case DownloadState.LocallyAvailable:
|
||||||
|
button.Enabled.Value = true;
|
||||||
|
button.TooltipText = string.Empty;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (BeatmapSet.Value?.OnlineInfo?.Availability?.DownloadDisabled ?? false)
|
||||||
|
{
|
||||||
|
button.Enabled.Value = false;
|
||||||
|
button.TooltipText = "this beatmap is currently not available for download.";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
if (BeatmapSet.Value == null) return;
|
if (BeatmapSet.Value == null) return;
|
||||||
|
|
||||||
if (BeatmapSet.Value.OnlineInfo.Availability?.DownloadDisabled ?? false)
|
if ((BeatmapSet.Value.OnlineInfo.Availability?.DownloadDisabled ?? false) && State.Value != DownloadState.LocallyAvailable)
|
||||||
{
|
{
|
||||||
downloadButtonsContainer.Clear();
|
downloadButtonsContainer.Clear();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user