mirror of
https://github.com/osukey/osukey.git
synced 2025-05-28 17:07:35 +09:00
Disable download button + Fix AppVeyor Errors
This commit is contained in:
parent
3202110b80
commit
70fdd4ba5b
@ -78,7 +78,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
[JsonProperty(@"cover@2x")]
|
||||
public string Cover { get; set; }
|
||||
|
||||
|
||||
public string CardLowRes { get; set; }
|
||||
|
||||
[JsonProperty(@"card@2x")]
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
@ -210,7 +209,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
downloadButtonsContainer.FadeOut(transition_duration);
|
||||
favouriteButton.FadeOut(transition_duration);
|
||||
}
|
||||
|
||||
|
||||
if (setInfo.NewValue?.OnlineInfo.Availability?.DownloadDisabled ?? false)
|
||||
{
|
||||
this.ResizeHeightTo(460, transition_duration / 2);
|
||||
@ -237,31 +236,28 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
switch (State.Value)
|
||||
{
|
||||
switch (State.Value)
|
||||
{
|
||||
case DownloadState.LocallyAvailable:
|
||||
// temporary for UX until new design is implemented.
|
||||
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value)
|
||||
{
|
||||
Width = 50,
|
||||
RelativeSizeAxes = Axes.Y
|
||||
};
|
||||
break;
|
||||
case DownloadState.LocallyAvailable:
|
||||
// temporary for UX until new design is implemented.
|
||||
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value)
|
||||
{
|
||||
Width = 50,
|
||||
RelativeSizeAxes = Axes.Y
|
||||
};
|
||||
break;
|
||||
|
||||
case DownloadState.Downloading:
|
||||
case DownloadState.Downloaded:
|
||||
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
||||
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||
break;
|
||||
case DownloadState.Downloading:
|
||||
case DownloadState.Downloaded:
|
||||
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
||||
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||
break;
|
||||
|
||||
default:
|
||||
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||
if (BeatmapSet.Value.OnlineInfo.HasVideo)
|
||||
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||
if (BeatmapSet.Value.OnlineInfo.HasVideo)
|
||||
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user