mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 13:54:00 +08:00
8b8d10349e
(cherry picked from commit 257d9d13ac81d85583314f8b5dfabf05661b1572)
75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Beatmaps;
|
|
using osu.Game.Graphics;
|
|
using osu.Game.Graphics.Sprites;
|
|
using osu.Game.Online.Multiplayer;
|
|
using OpenTK;
|
|
|
|
namespace osu.Game.Screens.Multi.Components
|
|
{
|
|
public class BeatmapModeInfo : FillFlowContainer
|
|
{
|
|
private readonly ModeTypeInfo modeTypeInfo;
|
|
private readonly BeatmapTitle beatmapTitle;
|
|
private readonly OsuSpriteText beatmapAuthor;
|
|
|
|
public BeatmapInfo Beatmap
|
|
{
|
|
set
|
|
{
|
|
modeTypeInfo.Beatmap = beatmapTitle.Beatmap = value;
|
|
|
|
if (value == null)
|
|
beatmapAuthor.Text = string.Empty;
|
|
else
|
|
beatmapAuthor.Text = $"mapped by {value.Metadata.Author}";
|
|
}
|
|
}
|
|
|
|
public GameType Type
|
|
{
|
|
set { modeTypeInfo.Type = value; }
|
|
}
|
|
|
|
public BeatmapModeInfo()
|
|
{
|
|
AutoSizeAxes = Axes.Both;
|
|
Direction = FillDirection.Horizontal;
|
|
LayoutDuration = 100;
|
|
Spacing = new Vector2(5f, 0f);
|
|
|
|
Children = new Drawable[]
|
|
{
|
|
modeTypeInfo = new ModeTypeInfo(),
|
|
new Container
|
|
{
|
|
AutoSizeAxes = Axes.X,
|
|
Height = 30,
|
|
Margin = new MarginPadding { Left = 5 },
|
|
Children = new Drawable[]
|
|
{
|
|
beatmapTitle = new BeatmapTitle(),
|
|
beatmapAuthor = new OsuSpriteText
|
|
{
|
|
Anchor = Anchor.BottomLeft,
|
|
Origin = Anchor.BottomLeft,
|
|
TextSize = 14,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
beatmapAuthor.Colour = colours.Gray9;
|
|
}
|
|
}
|
|
}
|