Update existing drawables to use UpdateableBeatmapSetCover.

This commit is contained in:
DrabWeb
2018-05-28 19:31:20 -03:00
parent e920b8d577
commit bdfb5752cd
5 changed files with 19 additions and 104 deletions

View File

@ -111,7 +111,7 @@ namespace osu.Game.Screens.Multi.Components
private void load(OsuColour colours, LocalisationEngine localisation)
{
Box sideStrip;
Container coverContainer;
UpdateableBeatmapSetCover cover;
OsuSpriteText name, status, beatmapTitle, beatmapDash, beatmapArtist;
ParticipantInfo participantInfo;
ModeTypeInfo modeTypeInfo;
@ -146,24 +146,12 @@ namespace osu.Game.Screens.Multi.Components
RelativeSizeAxes = Axes.Y,
Width = side_strip_width,
},
new Container
cover = new UpdateableBeatmapSetCover
{
Width = cover_width,
RelativeSizeAxes = Axes.Y,
Masking = true,
Margin = new MarginPadding { Left = side_strip_width },
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
coverContainer = new Container
{
RelativeSizeAxes = Axes.Both,
},
},
},
new Container
{
@ -263,23 +251,14 @@ namespace osu.Game.Screens.Multi.Components
if (b != null)
{
coverContainer.FadeIn(transition_duration);
LoadComponentAsync(new BeatmapSetCover(b.BeatmapSet)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
}, coverContainer.Add);
cover.BeatmapSet = b.BeatmapSet;
beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title);
beatmapDash.Text = @" - ";
beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist);
}
else
{
coverContainer.FadeOut(transition_duration);
cover.BeatmapSet = null;
beatmapTitle.Current = null;
beatmapArtist.Current = null;

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Multi.Components
private OsuColour colours;
private Box statusStrip;
private Container coverContainer;
private UpdateableBeatmapSetCover cover;
private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow, infoPanelFlow;
private OsuSpriteText name, status;
private ScrollContainer participantsScroll;
@ -105,21 +105,9 @@ namespace osu.Game.Screens.Multi.Components
Masking = true,
Children = new Drawable[]
{
new Container
cover = new UpdateableBeatmapSetCover
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
coverContainer = new Container
{
RelativeSizeAxes = Axes.Both,
},
},
},
new Box
{
@ -294,17 +282,7 @@ namespace osu.Game.Screens.Multi.Components
if (b != null)
{
coverContainer.FadeIn(transition_duration);
LoadComponentAsync(new BeatmapSetCover(b.BeatmapSet)
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
}, coverContainer.Add);
cover.BeatmapSet = b.BeatmapSet;
beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title);
beatmapDash.Text = @" - ";
beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist);
@ -312,7 +290,7 @@ namespace osu.Game.Screens.Multi.Components
}
else
{
coverContainer.FadeOut(transition_duration);
cover.BeatmapSet = null;
beatmapTitle.Current = null;
beatmapArtist.Current = null;
@ -367,7 +345,7 @@ namespace osu.Game.Screens.Multi.Components
{
if (Room == null)
{
coverContainer.FadeOut(transition_duration);
cover.BeatmapSet = null;
participantsFlow.FadeOut(transition_duration);
participantNumbersFlow.FadeOut(transition_duration);
infoPanelFlow.FadeOut(transition_duration);