Re-implement statistics as a click-in panel

This commit is contained in:
smoogipoo
2020-06-18 16:50:45 +09:00
parent 69d85ca3ae
commit c31a05977d
4 changed files with 135 additions and 149 deletions

View File

@ -1,17 +1,17 @@
// 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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Scoring;
using osuTK;
namespace osu.Game.Screens.Ranking.Statistics
{
public class StatisticsPanel : CompositeDrawable
public class StatisticsPanel : VisibilityContainer
{
protected override bool StartHidden => true;
public StatisticsPanel(ScoreInfo score)
{
// Todo: Not correct.
@ -19,27 +19,19 @@ namespace osu.Game.Screens.Ranking.Statistics
FillFlowContainer statisticRows;
InternalChildren = new Drawable[]
InternalChild = new Container
{
new Box
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding
{
RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("#333")
Left = ScorePanel.EXPANDED_WIDTH + 30 + 50,
Right = 50
},
new Container
Child = statisticRows = new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding
{
Left = ScorePanel.EXPANDED_WIDTH + 30 + 50,
Right = 50
},
Child = statisticRows = new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(30, 15),
}
Direction = FillDirection.Vertical,
Spacing = new Vector2(30, 15),
}
};
@ -55,5 +47,9 @@ namespace osu.Game.Screens.Ranking.Statistics
});
}
}
protected override void PopIn() => this.FadeIn();
protected override void PopOut() => this.FadeOut();
}
}