1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Move implementation to base class

This commit is contained in:
Dan Balasescu 2021-12-07 20:36:39 +09:00
parent 5ffe702dd6
commit 4683193f09
3 changed files with 27 additions and 32 deletions

View File

@ -275,20 +275,36 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
protected virtual Drawable CreateBackground() => new OnlinePlayBackgroundSprite();
protected virtual IEnumerable<Drawable> CreateBottomDetails() => new Drawable[]
protected virtual IEnumerable<Drawable> CreateBottomDetails()
{
new PlaylistCountPill
var pills = new List<Drawable>();
if (Room.Type.Value != MatchType.Playlists)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new StarRatingRangeDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Scale = new Vector2(0.8f)
pills.AddRange(new OnlinePlayComposite[]
{
new MatchTypePill(),
new QueueModePill(),
});
}
};
pills.AddRange(new Drawable[]
{
new PlaylistCountPill
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new StarRatingRangeDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Scale = new Vector2(0.8f)
}
});
return pills;
}
private class RoomNameText : OsuSpriteText
{

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
@ -178,18 +177,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
return true;
}
protected override IEnumerable<Drawable> CreateBottomDetails()
{
if (Room.Type.Value == MatchType.Playlists)
return base.CreateBottomDetails();
return new Drawable[]
{
new MatchTypePill(),
new QueueModePill(),
}.Concat(base.CreateBottomDetails());
}
public class PasswordEntryPopover : OsuPopover
{
private readonly Room room;

View File

@ -2,8 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -69,12 +67,6 @@ namespace osu.Game.Screens.OnlinePlay.Match
protected override Drawable CreateBackground() => background = new BackgroundSprite();
protected override IEnumerable<Drawable> CreateBottomDetails() => new Drawable[]
{
new MatchTypePill(),
new QueueModePill(),
}.Concat(base.CreateBottomDetails());
private class BackgroundSprite : UpdateableBeatmapBackgroundSprite
{
protected override double LoadDelay => 0;