1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Revert changes to BeatmapDetailArea

This commit is contained in:
Dean Herbert 2019-09-19 14:26:15 +09:00
parent e5509cd390
commit a7b6895d4c
3 changed files with 30 additions and 49 deletions

View File

@ -163,7 +163,6 @@ namespace osu.Game.Tests.Visual.SongSelect
}));
AddStep("null beatmap", () => detailsArea.Beatmap = null);
AddStep("Toggle top score visibility", () => detailsArea.TopScore.ToggleVisibility());
}
}
}

View File

@ -1,21 +1,23 @@
// 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 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 padding = 10;
private const float details_padding = 10;
private readonly Container content;
protected override Container<Drawable> Content => content;
public readonly BeatmapDetails Details;
public readonly BeatmapLeaderboard Leaderboard;
public readonly UserTopScoreContainer TopScore;
private WorkingBeatmap beatmap;
@ -27,13 +29,12 @@ namespace osu.Game.Screens.Select
beatmap = value;
Details.Beatmap = beatmap?.BeatmapInfo;
Leaderboard.Beatmap = beatmap is DummyWorkingBeatmap ? null : beatmap?.BeatmapInfo;
TopScore.Hide();
}
}
public BeatmapDetailArea()
{
Children = new Drawable[]
AddRangeInternal(new Drawable[]
{
new BeatmapDetailAreaTabControl
{
@ -57,51 +58,33 @@ namespace osu.Game.Screens.Select
}
},
},
new Container
content = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT },
},
});
AddRange(new Drawable[]
{
Details = new BeatmapDetails
{
RelativeSizeAxes = Axes.X,
Alpha = 0,
Margin = new MarginPadding { Top = details_padding },
},
Leaderboard = new BeatmapLeaderboard
{
Padding = new MarginPadding { Top = BeatmapDetailAreaTabControl.HEIGHT, Bottom = padding },
RelativeSizeAxes = Axes.Both,
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
RowDimensions = new[]
{
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 { Top = padding },
},
Leaderboard = new BeatmapLeaderboard
{
RelativeSizeAxes = Axes.Both,
}
}
}
},
new Drawable[]
{
TopScore = new UserTopScoreContainer
{
Score = { BindTarget = Leaderboard.TopScore }
}
}
},
},
}
};
});
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
Details.Height = Math.Min(DrawHeight - details_padding * 3 - BeatmapDetailAreaTabControl.HEIGHT, 450);
}
}
}

View File

@ -226,7 +226,6 @@ namespace osu.Game.Screens.Select
void displayScore(ScoreInfo score) => this.Push(new SoloResults(score));
BeatmapDetails.Leaderboard.ScoreSelected += displayScore;
BeatmapDetails.TopScore.ScoreSelected += displayScore;
}
[BackgroundDependencyLoader(true)]