mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Rename BeatmapCard{Base => }
This commit is contained in:
parent
88d4e95ad8
commit
c7b9b176c6
@ -15,7 +15,7 @@ using osu.Game.Overlays;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
public abstract class BeatmapCardBase : OsuClickableContainer
|
||||
public abstract class BeatmapCard : OsuClickableContainer
|
||||
{
|
||||
public const float TRANSITION_DURATION = 400;
|
||||
public const float CORNER_RADIUS = 10;
|
||||
@ -30,7 +30,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
|
||||
protected readonly BeatmapDownloadTracker DownloadTracker;
|
||||
|
||||
protected BeatmapCardBase(APIBeatmapSet beatmapSet, bool allowExpansion = true)
|
||||
protected BeatmapCard(APIBeatmapSet beatmapSet, bool allowExpansion = true)
|
||||
: base(HoverSampleSet.Submit)
|
||||
{
|
||||
Expanded = new BindableBool { Disabled = !allowExpansion };
|
@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
CornerRadius = BeatmapCardBase.CORNER_RADIUS,
|
||||
CornerRadius = BeatmapCard.CORNER_RADIUS,
|
||||
Masking = true,
|
||||
Unhovered = _ => updateFromHoverChange(),
|
||||
Children = new Drawable[]
|
||||
@ -67,7 +67,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = height,
|
||||
CornerRadius = BeatmapCardBase.CORNER_RADIUS,
|
||||
CornerRadius = BeatmapCard.CORNER_RADIUS,
|
||||
Masking = true,
|
||||
},
|
||||
dropdownContent = new HoverHandlingContainer
|
||||
@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
borderContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = BeatmapCardBase.CORNER_RADIUS,
|
||||
CornerRadius = BeatmapCard.CORNER_RADIUS,
|
||||
Masking = true,
|
||||
BorderThickness = 3,
|
||||
Child = new Box
|
||||
@ -143,9 +143,9 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
// This avoids depth issues where a hovered (scaled) card to the right of another card would be beneath the card to the left.
|
||||
this.ScaleTo(Expanded.Value ? 1.03f : 1, 500, Easing.OutQuint);
|
||||
|
||||
background.FadeTo(Expanded.Value ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
dropdownContent.FadeTo(Expanded.Value ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
borderContainer.FadeTo(Expanded.Value ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
background.FadeTo(Expanded.Value ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
dropdownContent.FadeTo(Expanded.Value ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
borderContainer.FadeTo(Expanded.Value ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
|
||||
content.TweenEdgeEffectTo(new EdgeEffectParameters
|
||||
{
|
||||
@ -154,7 +154,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
Radius = 10,
|
||||
Colour = Colour4.Black.Opacity(Expanded.Value ? 0.3f : 0f),
|
||||
Hollow = true,
|
||||
}, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
}, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private class ExpandedContentScrollContainer : OsuScrollContainer
|
||||
|
@ -62,10 +62,10 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
|
||||
private void updateState() => Schedule(() =>
|
||||
{
|
||||
background.FadeColour(Dimmed.Value ? colourProvider.Background4 : colourProvider.Background2, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
background.FadeColour(Dimmed.Value ? colourProvider.Background4 : colourProvider.Background2, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
|
||||
var gradient = ColourInfo.GradientHorizontal(Colour4.White.Opacity(0), Colour4.White.Opacity(0.2f));
|
||||
cover.FadeColour(gradient, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
cover.FadeColour(gradient, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -82,14 +82,14 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
break;
|
||||
|
||||
case DownloadState.Importing:
|
||||
foregroundFill.FadeColour(colours.Yellow, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
foregroundFill.FadeColour(colours.Yellow, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void progressChanged()
|
||||
{
|
||||
foreground.ResizeWidthTo((float)progress.Value, progress.Value > 0 ? BeatmapCardBase.TRANSITION_DURATION : 0, Easing.OutQuint);
|
||||
foreground.ResizeWidthTo((float)progress.Value, progress.Value > 0 ? BeatmapCard.TRANSITION_DURATION : 0, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
public class BeatmapCardExtra : BeatmapCardBase
|
||||
public class BeatmapCardExtra : BeatmapCard
|
||||
{
|
||||
protected override Drawable IdleContent => idleBottomContent;
|
||||
protected override Drawable DownloadInProgressContent => downloadProgressBar;
|
||||
|
@ -21,7 +21,7 @@ using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
public class BeatmapCardNormal : BeatmapCardBase
|
||||
public class BeatmapCardNormal : BeatmapCard
|
||||
{
|
||||
protected override Drawable IdleContent => idleBottomContent;
|
||||
protected override Drawable DownloadInProgressContent => downloadProgressBar;
|
||||
|
@ -88,8 +88,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
bool shouldDim = Dimmed.Value || playButton.Playing.Value;
|
||||
|
||||
playButton.FadeTo(shouldDim ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
cover.FadeColour(shouldDim ? OsuColour.Gray(0.2f) : Color4.White, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
playButton.FadeTo(shouldDim ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
cover.FadeColour(shouldDim ? OsuColour.Gray(0.2f) : Color4.White, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
bool isHovered = IsHovered && Enabled.Value;
|
||||
|
||||
content.ScaleTo(isHovered ? 1.2f : 1, 500, Easing.OutQuint);
|
||||
content.FadeColour(isHovered ? HoverColour : IdleColour, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
content.FadeColour(isHovered ? HoverColour : IdleColour, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
case DownloadState.LocallyAvailable:
|
||||
Action = null;
|
||||
TooltipText = string.Empty;
|
||||
this.FadeOut(BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
this.FadeOut(BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
break;
|
||||
|
||||
case DownloadState.NotDownloaded:
|
||||
@ -81,7 +81,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
}
|
||||
|
||||
Action = () => beatmaps.Download(beatmapSet, preferNoVideo.Value);
|
||||
this.FadeIn(BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
this.FadeIn(BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
spinner.Hide();
|
||||
Icon.Show();
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
this.FadeTo(state.Value == DownloadState.LocallyAvailable ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
this.FadeTo(state.Value == DownloadState.LocallyAvailable ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Buttons
|
||||
private void toggleLoading(bool loading)
|
||||
{
|
||||
Enabled.Value = !loading;
|
||||
icon.FadeTo(loading ? 0 : 1, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
icon.FadeTo(loading ? 0 : 1, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
loadingSpinner.State.Value = loading ? Visibility.Visible : Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
Masking = true;
|
||||
CornerRadius = BeatmapCardBase.CORNER_RADIUS;
|
||||
CornerRadius = BeatmapCard.CORNER_RADIUS;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -133,7 +133,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
Name = @"Main content",
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
CornerRadius = BeatmapCardBase.CORNER_RADIUS,
|
||||
CornerRadius = BeatmapCard.CORNER_RADIUS,
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -169,10 +169,10 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
float targetWidth = Width - (ShowDetails.Value ? ButtonsExpandedWidth : ButtonsCollapsedWidth);
|
||||
|
||||
mainArea.ResizeWidthTo(targetWidth, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
mainArea.ResizeWidthTo(targetWidth, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
|
||||
background.FadeColour(downloadTracker.State.Value == DownloadState.LocallyAvailable ? colours.Lime0 : colourProvider.Background3, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
buttons.FadeTo(ShowDetails.Value ? 1 : 0, BeatmapCardBase.TRANSITION_DURATION, Easing.OutQuint);
|
||||
background.FadeColour(downloadTracker.State.Value == DownloadState.LocallyAvailable ? colours.Lime0 : colourProvider.Background3, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
buttons.FadeTo(ShowDetails.Value ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
|
||||
|
||||
foreach (var button in buttons)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user