1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Move advanced stats to a more permanent location on song select

This commit is contained in:
Dean Herbert 2023-12-19 19:09:56 +09:00
parent 0a64d631e2
commit 07bb0805e9
No known key found for this signature in database
3 changed files with 54 additions and 11 deletions

View File

@ -28,7 +28,6 @@ namespace osu.Game.Screens.Select
private const float spacing = 10;
private const float transition_duration = 250;
private readonly AdvancedStats advanced;
private readonly UserRatings ratingsDisplay;
private readonly MetadataSection description, source, tags;
private readonly Container failRetryContainer;
@ -109,12 +108,6 @@ namespace osu.Game.Screens.Select
Padding = new MarginPadding { Right = spacing / 2 },
Children = new[]
{
new DetailBox().WithChild(advanced = new AdvancedStats
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = spacing, Top = spacing * 2, Bottom = spacing },
}),
new DetailBox().WithChild(new OnlineViewContainer(string.Empty)
{
RelativeSizeAxes = Axes.X,
@ -180,7 +173,6 @@ namespace osu.Game.Screens.Select
private void updateStatistics()
{
advanced.BeatmapInfo = BeatmapInfo;
description.Metadata = BeatmapInfo?.DifficultyName ?? string.Empty;
source.Metadata = BeatmapInfo?.Metadata.Source ?? string.Empty;
tags.Metadata = BeatmapInfo?.Metadata.Tags ?? string.Empty;

View File

@ -305,7 +305,7 @@ namespace osu.Game.Screens.Select
},
infoLabelContainer = new FillFlowContainer
{
Margin = new MarginPadding { Top = 20 },
Margin = new MarginPadding { Top = 8 },
Spacing = new Vector2(20, 0),
AutoSizeAxes = Axes.Both,
}

View File

@ -13,6 +13,8 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Bindings;
@ -35,6 +37,7 @@ using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Menu;
using osu.Game.Screens.Play;
using osu.Game.Screens.Select.Details;
using osu.Game.Screens.Select.Options;
using osu.Game.Skinning;
using osuTK;
@ -45,7 +48,7 @@ namespace osu.Game.Screens.Select
{
public abstract partial class SongSelect : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>
{
public static readonly float WEDGE_HEIGHT = 245;
public static readonly float WEDGE_HEIGHT = 200;
protected const float BACKGROUND_BLUR = 20;
private const float left_area_padding = 20;
@ -132,6 +135,8 @@ namespace osu.Game.Screens.Select
private IDisposable? modSelectOverlayRegistration;
private AdvancedStats advancedStats = null!;
[Resolved]
private MusicController music { get; set; } = null!;
@ -253,12 +258,56 @@ namespace osu.Game.Screens.Select
},
},
new Container
{
RelativeSizeAxes = Axes.X,
Height = 90,
Padding = new MarginPadding(10)
{
Left = left_area_padding,
Right = left_area_padding * 2,
},
Y = WEDGE_HEIGHT,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 10,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Hollow = true,
Colour = new Color4(130, 204, 255, 15),
Radius = 10,
},
Children = new Drawable[]
{
new Box
{
Colour = new Color4(130, 204, 255, 40),
Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both,
},
advancedStats = new AdvancedStats(2)
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Width = 0.8f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
}
},
}
},
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding
{
Bottom = Footer.HEIGHT,
Top = WEDGE_HEIGHT,
Top = WEDGE_HEIGHT + 70,
Left = left_area_padding,
Right = left_area_padding * 2,
},
@ -797,6 +846,8 @@ namespace osu.Game.Screens.Select
ModSelect.Beatmap = beatmap;
advancedStats.BeatmapInfo = beatmap.BeatmapInfo;
bool beatmapSelected = beatmap is not DummyWorkingBeatmap;
if (beatmapSelected)