1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Rename download buttons to avoid ambiguity

This commit is contained in:
Dean Herbert 2019-07-03 12:02:35 +09:00
parent 466bc7f28a
commit 23acddcb56
9 changed files with 21 additions and 22 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Online
typeof(BasicStats), typeof(BasicStats),
typeof(BeatmapPicker), typeof(BeatmapPicker),
typeof(Details), typeof(Details),
typeof(DownloadButton), typeof(HeaderDownloadButton),
typeof(FavouriteButton), typeof(FavouriteButton),
typeof(Header), typeof(Header),
typeof(HeaderButton), typeof(HeaderButton),

View File

@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
public override IReadOnlyList<Type> RequiredTypes => new[] public override IReadOnlyList<Type> RequiredTypes => new[]
{ {
typeof(DownloadButton) typeof(PanelDownloadButton)
}; };
private TestDownloadButton downloadButton; private TestDownloadButton downloadButton;
@ -143,7 +143,7 @@ namespace osu.Game.Tests.Visual.Online
return beatmap; return beatmap;
} }
private class TestDownloadButton : DownloadButton private class TestDownloadButton : PanelDownloadButton
{ {
public new bool DownloadEnabled => base.DownloadEnabled; public new bool DownloadEnabled => base.DownloadEnabled;

View File

@ -11,7 +11,7 @@ using osuTK;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public class OsuDownloadButton : OsuAnimatedButton public class DownloadButton : OsuAnimatedButton
{ {
public readonly Bindable<DownloadState> State = new Bindable<DownloadState>(); public readonly Bindable<DownloadState> State = new Bindable<DownloadState>();
@ -21,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface
private OsuColour colours; private OsuColour colours;
public OsuDownloadButton() public DownloadButton()
{ {
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -20,7 +20,7 @@ using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet.Buttons namespace osu.Game.Overlays.BeatmapSet.Buttons
{ {
public class DownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip public class HeaderDownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip
{ {
private readonly bool noVideo; private readonly bool noVideo;
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
private ShakeContainer shakeContainer; private ShakeContainer shakeContainer;
private HeaderButton button; private HeaderButton button;
public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) public HeaderDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
: base(beatmapSet) : base(beatmapSet)
{ {
this.noVideo = noVideo; this.noVideo = noVideo;

View File

@ -18,7 +18,6 @@ using osu.Game.Overlays.BeatmapSet.Buttons;
using osu.Game.Overlays.Direct; using osu.Game.Overlays.Direct;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using DownloadButton = osu.Game.Overlays.BeatmapSet.Buttons.DownloadButton;
namespace osu.Game.Overlays.BeatmapSet namespace osu.Game.Overlays.BeatmapSet
{ {
@ -268,7 +267,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
case DownloadState.LocallyAvailable: case DownloadState.LocallyAvailable:
// temporary for UX until new design is implemented. // temporary for UX until new design is implemented.
downloadButtonsContainer.Child = new Direct.DownloadButton(BeatmapSet.Value) downloadButtonsContainer.Child = new PanelDownloadButton(BeatmapSet.Value)
{ {
Width = 50, Width = 50,
RelativeSizeAxes = Axes.Y RelativeSizeAxes = Axes.Y
@ -278,13 +277,13 @@ namespace osu.Game.Overlays.BeatmapSet
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 HeaderDownloadButton(BeatmapSet.Value);
break; break;
default: default:
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); downloadButtonsContainer.Child = new HeaderDownloadButton(BeatmapSet.Value);
if (BeatmapSet.Value.OnlineInfo.HasVideo) if (BeatmapSet.Value.OnlineInfo.HasVideo)
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true)); downloadButtonsContainer.Add(new HeaderDownloadButton(BeatmapSet.Value, true));
break; break;
} }
} }

View File

@ -155,7 +155,7 @@ namespace osu.Game.Overlays.Direct
}, },
}, },
}, },
new DownloadButton(SetInfo) new PanelDownloadButton(SetInfo)
{ {
Size = new Vector2(50, 30), Size = new Vector2(50, 30),
Margin = new MarginPadding(horizontal_padding), Margin = new MarginPadding(horizontal_padding),

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Direct
private const float height = 70; private const float height = 70;
private FillFlowContainer statusContainer; private FillFlowContainer statusContainer;
protected DownloadButton DownloadButton; protected PanelDownloadButton DownloadButton;
private PlayButton playButton; private PlayButton playButton;
private Box progressBar; private Box progressBar;
@ -150,7 +150,7 @@ namespace osu.Game.Overlays.Direct
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = DownloadButton = new DownloadButton(SetInfo) Child = DownloadButton = new PanelDownloadButton(SetInfo)
{ {
Size = new Vector2(height - vertical_padding * 3), Size = new Vector2(height - vertical_padding * 3),
Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding }, Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding },

View File

@ -1,4 +1,4 @@
// 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 osu.Framework.Allocation; using osu.Framework.Allocation;
@ -10,16 +10,16 @@ using osu.Game.Online;
namespace osu.Game.Overlays.Direct namespace osu.Game.Overlays.Direct
{ {
public class DownloadButton : BeatmapDownloadTrackingComposite public class PanelDownloadButton : BeatmapDownloadTrackingComposite
{ {
protected bool DownloadEnabled => button.Enabled.Value; protected bool DownloadEnabled => button.Enabled.Value;
private readonly bool noVideo; private readonly bool noVideo;
private readonly ShakeContainer shakeContainer; private readonly ShakeContainer shakeContainer;
private readonly OsuDownloadButton button; private readonly DownloadButton button;
public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) public PanelDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false)
: base(beatmapSet) : base(beatmapSet)
{ {
this.noVideo = noVideo; this.noVideo = noVideo;
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Direct
InternalChild = shakeContainer = new ShakeContainer InternalChild = shakeContainer = new ShakeContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Child = button = new OsuDownloadButton Child = button = new DownloadButton
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play
{ {
public class ReplayDownloadButton : DownloadTrackingComposite<ScoreInfo, ScoreManager> public class ReplayDownloadButton : DownloadTrackingComposite<ScoreInfo, ScoreManager>
{ {
private OsuDownloadButton button; private DownloadButton button;
private ShakeContainer shakeContainer; private ShakeContainer shakeContainer;
private ReplayAvailability replayAvailability private ReplayAvailability replayAvailability
@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play
InternalChild = shakeContainer = new ShakeContainer InternalChild = shakeContainer = new ShakeContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Child = button = new OsuDownloadButton Child = button = new DownloadButton
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
} }