2023-05-16 15:52:26 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
2023-05-25 18:55:11 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2023-05-16 15:52:26 +08:00
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|
|
|
{
|
2023-05-17 15:13:03 +08:00
|
|
|
public abstract partial class OnlinePlayPill : OnlinePlayComposite
|
2023-05-16 15:52:26 +08:00
|
|
|
{
|
2023-05-17 15:13:54 +08:00
|
|
|
protected PillContainer Pill { get; private set; } = null!;
|
|
|
|
protected OsuTextFlowContainer TextFlow { get; private set; } = null!;
|
2023-05-25 18:55:11 +08:00
|
|
|
protected virtual FontUsage Font => OsuFont.GetFont(size: 12);
|
2023-05-16 15:52:26 +08:00
|
|
|
|
2023-05-17 15:13:03 +08:00
|
|
|
protected OnlinePlayPill()
|
2023-05-16 15:52:26 +08:00
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2023-05-16 16:06:48 +08:00
|
|
|
InternalChild = Pill = new PillContainer
|
2023-05-16 15:52:26 +08:00
|
|
|
{
|
2023-05-25 18:55:11 +08:00
|
|
|
Child = TextFlow = new OsuTextFlowContainer(s => s.Font = Font)
|
2023-05-16 15:52:26 +08:00
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|