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
} }
}); });
title.AddArbitraryDrawable(new Container if (setInfo.NewValue.HasExplicitContent)
{ {
AutoSizeAxes = Axes.Both, title.AddArbitraryDrawable(new Container
Child = explicitContent = new ExplicitContentBeatmapBadge
{ {
Alpha = 0f, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Left = 10 }, Child = explicitContent = new ExplicitContentBeatmapBadge { Margin = new MarginPadding { Left = 10 } },
} });
}); }
title.AddArbitraryDrawable(new Container if (setInfo.NewValue.FeaturedInSpotlight)
{ {
AutoSizeAxes = Axes.Both, title.AddArbitraryDrawable(new Container
Child = spotlight = new SpotlightBeatmapBadge
{ {
Alpha = 0f, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Left = 10 }, Child = spotlight = new SpotlightBeatmapBadge { Margin = new MarginPadding { Left = 10 } },
} });
}); }
artist.AddLink(artistText, LinkAction.SearchBeatmapSet, artistText); artist.AddLink(artistText, LinkAction.SearchBeatmapSet, artistText);
artist.AddArbitraryDrawable(new Container if (setInfo.NewValue.TrackId != null)
{ {
AutoSizeAxes = Axes.Both, artist.AddArbitraryDrawable(new Container
Child = featuredArtist = new FeaturedArtistBeatmapBadge
{ {
Alpha = 0f, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Left = 10 } Child = featuredArtist = new FeaturedArtistBeatmapBadge { 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);