Add badges when needed instead of using alpha

This commit is contained in:
Joseph Madamba
2022-12-24 13:27:46 -08:00
parent 4f6b3644f3
commit ae967e08b0

View File

@ -261,42 +261,36 @@ namespace osu.Game.Overlays.BeatmapSet
} }
}); });
if (setInfo.NewValue.HasExplicitContent)
{
title.AddArbitraryDrawable(new Container title.AddArbitraryDrawable(new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = explicitContent = new ExplicitContentBeatmapBadge Child = explicitContent = new ExplicitContentBeatmapBadge { Margin = new MarginPadding { Left = 10 } },
{
Alpha = 0f,
Margin = new MarginPadding { Left = 10 },
}
}); });
}
if (setInfo.NewValue.FeaturedInSpotlight)
{
title.AddArbitraryDrawable(new Container title.AddArbitraryDrawable(new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = spotlight = new SpotlightBeatmapBadge Child = spotlight = new SpotlightBeatmapBadge { Margin = new MarginPadding { Left = 10 } },
{
Alpha = 0f,
Margin = new MarginPadding { Left = 10 },
}
}); });
}
artist.AddLink(artistText, LinkAction.SearchBeatmapSet, artistText); artist.AddLink(artistText, LinkAction.SearchBeatmapSet, artistText);
if (setInfo.NewValue.TrackId != null)
{
artist.AddArbitraryDrawable(new Container artist.AddArbitraryDrawable(new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = featuredArtist = new FeaturedArtistBeatmapBadge Child = featuredArtist = new FeaturedArtistBeatmapBadge { Margin = new MarginPadding { Left = 10 } }
{
Alpha = 0f,
Margin = new MarginPadding { Left = 10 }
}
}); });
}
updateExternalLink(); updateExternalLink();
explicitContent.Alpha = setInfo.NewValue.HasExplicitContent ? 1 : 0;
spotlight.Alpha = setInfo.NewValue.FeaturedInSpotlight ? 1 : 0;
featuredArtist.Alpha = setInfo.NewValue.TrackId != null ? 1 : 0;
onlineStatusPill.FadeIn(500, Easing.OutQuint); onlineStatusPill.FadeIn(500, Easing.OutQuint);