1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 03:12:54 +08:00
osu-lazer/osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs

59 lines
2.1 KiB
C#
Raw Normal View History

2017-09-21 03:33:07 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Scoring;
2017-10-05 09:38:13 +08:00
using osu.Game.Beatmaps.Timing;
2017-09-21 03:33:07 +08:00
namespace osu.Game.Screens.Play.BreaksOverlay
{
2017-10-05 09:38:13 +08:00
public class InfoContainer : VisibilityContainer
2017-09-21 03:33:07 +08:00
{
2017-10-05 09:38:13 +08:00
private const double fade_duration = BreakPeriod.MIN_BREAK_DURATION / 2;
2017-09-23 21:42:18 +08:00
public PercentageInfoLine AccuracyDisplay;
public InfoLine<int> RankDisplay;
public InfoLine<ScoreRank> GradeDisplay;
2017-09-23 21:42:18 +08:00
2017-09-21 03:33:07 +08:00
public InfoContainer()
{
AutoSizeAxes = Axes.Both;
2017-10-05 09:38:13 +08:00
Child = new FillFlowContainer
2017-09-21 03:33:07 +08:00
{
2017-10-05 09:38:13 +08:00
Direction = FillDirection.Vertical,
Spacing = new Vector2(5),
Children = new Drawable[]
2017-09-21 03:33:07 +08:00
{
2017-10-05 09:38:13 +08:00
new OsuSpriteText
2017-09-21 03:33:07 +08:00
{
2017-10-05 09:38:13 +08:00
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "current progress".ToUpper(),
TextSize = 15,
Font = "Exo2.0-Black",
2017-09-21 03:33:07 +08:00
},
2017-10-05 09:38:13 +08:00
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
AccuracyDisplay = new PercentageInfoLine("Accuracy"),
2017-10-05 10:27:52 +08:00
RankDisplay = new InfoLine<int>("Rank"),
2017-10-05 09:38:13 +08:00
GradeDisplay = new InfoLine<ScoreRank>("Grade"),
},
}
},
2017-09-21 03:33:07 +08:00
};
}
2017-10-05 09:38:13 +08:00
protected override void PopIn() => this.FadeIn(fade_duration);
protected override void PopOut() => this.FadeOut(fade_duration);
2017-09-21 03:33:07 +08:00
}
}