Disable download button + Fix AppVeyor Errors

This commit is contained in:
KingLuigi4932 2019-06-10 21:13:37 +03:00
parent 3202110b80
commit 70fdd4ba5b
5 changed files with 31 additions and 33 deletions

View File

@ -78,7 +78,7 @@ namespace osu.Game.Beatmaps
[JsonProperty(@"cover@2x")] [JsonProperty(@"cover@2x")]
public string Cover { get; set; } public string Cover { get; set; }
public string CardLowRes { get; set; } public string CardLowRes { get; set; }
[JsonProperty(@"card@2x")] [JsonProperty(@"card@2x")]

View File

@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// 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 System;
using System.Collections.Generic;
using System.Text;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -11,7 +8,6 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet namespace osu.Game.Overlays.BeatmapSet
@ -23,7 +19,7 @@ namespace osu.Game.Overlays.BeatmapSet
public override void Show() public override void Show()
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Margin = new MarginPadding() { Top = 10 }; Margin = new MarginPadding { Top = 10 };
Children = new Drawable[] Children = new Drawable[]
{ {
@ -36,13 +32,13 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Margin = new MarginPadding() { Top = 10, Left = 5, Right = 20 }, Margin = new MarginPadding { Top = 10, Left = 5, Right = 20 },
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
{ {
Margin = new MarginPadding() { Bottom = 10, Horizontal = 5 }, Margin = new MarginPadding { Bottom = 10, Horizontal = 5 },
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium), Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium),
Text = "This beatmap is currently not available for download.", Text = "This beatmap is currently not available for download.",
Colour = Color4.Orange, Colour = Color4.Orange,

View File

@ -11,7 +11,6 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables; using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.BeatmapSet.Buttons; using osu.Game.Overlays.BeatmapSet.Buttons;
@ -210,7 +209,7 @@ namespace osu.Game.Overlays.BeatmapSet
downloadButtonsContainer.FadeOut(transition_duration); downloadButtonsContainer.FadeOut(transition_duration);
favouriteButton.FadeOut(transition_duration); favouriteButton.FadeOut(transition_duration);
} }
if (setInfo.NewValue?.OnlineInfo.Availability?.DownloadDisabled ?? false) if (setInfo.NewValue?.OnlineInfo.Availability?.DownloadDisabled ?? false)
{ {
this.ResizeHeightTo(460, transition_duration / 2); this.ResizeHeightTo(460, transition_duration / 2);
@ -237,31 +236,28 @@ namespace osu.Game.Overlays.BeatmapSet
return; return;
} }
else switch (State.Value)
{ {
switch (State.Value) case DownloadState.LocallyAvailable:
{ // temporary for UX until new design is implemented.
case DownloadState.LocallyAvailable: downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value)
// temporary for UX until new design is implemented. {
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value) Width = 50,
{ RelativeSizeAxes = Axes.Y
Width = 50, };
RelativeSizeAxes = Axes.Y break;
};
break;
case DownloadState.Downloading: case DownloadState.Downloading:
case DownloadState.Downloaded: case DownloadState.Downloaded:
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design. // temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
break; break;
default: default:
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
if (BeatmapSet.Value.OnlineInfo.HasVideo) if (BeatmapSet.Value.OnlineInfo.HasVideo)
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true)); downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true));
break; break;
}
} }
} }
} }

View File

@ -121,7 +121,7 @@ namespace osu.Game.Overlays
public void ShowBeatmapSet(BeatmapSetInfo set) public void ShowBeatmapSet(BeatmapSetInfo set)
{ {
// Re-fetching is the correct way forward. // Re-fetching is the correct way forward.
FetchAndShowBeatmapSet((int)set.OnlineBeatmapSetID); FetchAndShowBeatmapSet(set.OnlineBeatmapSetID ?? 0);
scroll.ScrollTo(0); scroll.ScrollTo(0);
} }
} }

View File

@ -77,6 +77,12 @@ namespace osu.Game.Overlays.Direct
{ {
this.colours = colours; this.colours = colours;
if (BeatmapSet.Value.OnlineInfo.Availability?.DownloadDisabled ?? false)
{
button.Enabled.Value = false;
button.TooltipText = "Unavailable";
}
button.Action = () => button.Action = () =>
{ {
switch (State.Value) switch (State.Value)