mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 22:37:21 +08:00
Add top score section into beatmap detail area
This commit is contained in:
parent
922c3c89ae
commit
d1409d4610
@ -163,6 +163,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
});
|
||||
|
||||
AddStep("null beatmap", () => detailsArea.Beatmap = null);
|
||||
AddStep("Toggle top score visibility", () => detailsArea.TopScore.ToggleVisibility());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,19 +5,18 @@ using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Screens.Select.Details;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class BeatmapDetailArea : Container
|
||||
{
|
||||
private const float details_padding = 10;
|
||||
|
||||
private readonly Container content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
private const float padding = 10;
|
||||
|
||||
public readonly BeatmapDetails Details;
|
||||
public readonly BeatmapLeaderboard Leaderboard;
|
||||
public readonly UserTopScoreContainer TopScore;
|
||||
|
||||
private WorkingBeatmap beatmap;
|
||||
|
||||
@ -34,7 +33,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public BeatmapDetailArea()
|
||||
{
|
||||
AddRangeInternal(new Drawable[]
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new BeatmapDetailAreaTabControl
|
||||
{
|
||||
@ -58,33 +57,44 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
},
|
||||
},
|
||||
content = new Container
|
||||
new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT },
|
||||
Margin = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT },
|
||||
RowDimensions = new Dimension[]
|
||||
{
|
||||
new Dimension(GridSizeMode.Distributed),
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
},
|
||||
Content = new[]
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
Details = new BeatmapDetails
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
Padding = new MarginPadding { Vertical = padding },
|
||||
},
|
||||
Leaderboard = new BeatmapLeaderboard
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new Drawable[]
|
||||
{
|
||||
TopScore = new UserTopScoreContainer(),
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
Details = new BeatmapDetails
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Alpha = 0,
|
||||
Margin = new MarginPadding { Top = details_padding },
|
||||
},
|
||||
Leaderboard = new BeatmapLeaderboard
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
Details.Height = Math.Min(DrawHeight - details_padding * 3 - BeatmapDetailAreaTabControl.HEIGHT, 450);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
{
|
||||
public class UserTopScoreContainer : VisibilityContainer
|
||||
{
|
||||
private const int height = 150;
|
||||
private const int height = 110;
|
||||
private const int duration = 300;
|
||||
|
||||
private readonly Container contentContainer;
|
||||
@ -37,6 +37,7 @@ namespace osu.Game.Screens.Select.Details
|
||||
Origin = Anchor.BottomCentre,
|
||||
Height = height,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Padding = new MarginPadding { Vertical = 10 },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
|
Loading…
x
Reference in New Issue
Block a user