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

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

View File

@ -11,7 +11,6 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.BeatmapSet.Buttons;
@ -237,8 +236,6 @@ namespace osu.Game.Overlays.BeatmapSet
return;
}
else
{
switch (State.Value)
{
case DownloadState.LocallyAvailable:
@ -265,4 +262,3 @@ namespace osu.Game.Overlays.BeatmapSet
}
}
}
}

View File

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

View File

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