mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:28:00 +08:00
Make results panels aware of whether they are a local score that has just been set
This commit is contained in:
parent
c0960e60cb
commit
a8e9c62583
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
}
|
||||
}
|
||||
},
|
||||
new AccuracyCircle(score)
|
||||
new AccuracyCircle(score, false)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
|
||||
private void addPanelStep(ScoreInfo score, PanelState state = PanelState.Expanded) => AddStep("add panel", () =>
|
||||
{
|
||||
Child = panel = new ScorePanel(score)
|
||||
Child = panel = new ScorePanel(score, true)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -73,14 +73,19 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
|
||||
private readonly ScoreInfo score;
|
||||
|
||||
private readonly bool withFlair;
|
||||
|
||||
private SmoothCircularProgress accuracyCircle;
|
||||
private SmoothCircularProgress innerMask;
|
||||
private Container<RankBadge> badges;
|
||||
private RankText rankText;
|
||||
|
||||
public AccuracyCircle(ScoreInfo score)
|
||||
private SampleChannel applauseSound;
|
||||
|
||||
public AccuracyCircle(ScoreInfo score, bool withFlair)
|
||||
{
|
||||
this.score = score;
|
||||
this.withFlair = withFlair;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -29,6 +29,8 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
private const float padding = 10;
|
||||
|
||||
private readonly ScoreInfo score;
|
||||
private readonly bool withFlair;
|
||||
|
||||
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
|
||||
|
||||
private FillFlowContainer starAndModDisplay;
|
||||
@ -41,9 +43,11 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
/// Creates a new <see cref="ExpandedPanelMiddleContent"/>.
|
||||
/// </summary>
|
||||
/// <param name="score">The score to display.</param>
|
||||
public ExpandedPanelMiddleContent(ScoreInfo score)
|
||||
/// <param name="withFlair">Whether to add flair for a new score being set.</param>
|
||||
public ExpandedPanelMiddleContent(ScoreInfo score, bool withFlair = false)
|
||||
{
|
||||
this.score = score;
|
||||
this.withFlair = withFlair;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Masking = true;
|
||||
@ -116,7 +120,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
Margin = new MarginPadding { Top = 40 },
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 230,
|
||||
Child = new AccuracyCircle(score)
|
||||
Child = new AccuracyCircle(score, withFlair)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Ranking
|
||||
};
|
||||
|
||||
if (Score != null)
|
||||
ScorePanelList.AddScore(Score);
|
||||
ScorePanelList.AddScore(Score, true);
|
||||
|
||||
if (player != null && allowRetry)
|
||||
{
|
||||
|
@ -85,6 +85,8 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
public readonly ScoreInfo Score;
|
||||
|
||||
private readonly bool isNewLocalScore;
|
||||
|
||||
private Container content;
|
||||
|
||||
private Container topLayerContainer;
|
||||
@ -97,9 +99,10 @@ namespace osu.Game.Screens.Ranking
|
||||
private Container middleLayerContentContainer;
|
||||
private Drawable middleLayerContent;
|
||||
|
||||
public ScorePanel(ScoreInfo score)
|
||||
public ScorePanel(ScoreInfo score, bool isNewLocalScore = false)
|
||||
{
|
||||
Score = score;
|
||||
this.isNewLocalScore = isNewLocalScore;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -209,7 +212,7 @@ namespace osu.Game.Screens.Ranking
|
||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
|
||||
|
||||
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
|
||||
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score).With(d => d.Alpha = 0));
|
||||
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, isNewLocalScore).With(d => d.Alpha = 0));
|
||||
break;
|
||||
|
||||
case PanelState.Contracted:
|
||||
|
@ -95,9 +95,10 @@ namespace osu.Game.Screens.Ranking
|
||||
/// Adds a <see cref="ScoreInfo"/> to this list.
|
||||
/// </summary>
|
||||
/// <param name="score">The <see cref="ScoreInfo"/> to add.</param>
|
||||
public ScorePanel AddScore(ScoreInfo score)
|
||||
/// <param name="isNewLocalScore">Whether this is a score that has just been achieved locally. Controls whether flair is added to the display or not.</param>
|
||||
public ScorePanel AddScore(ScoreInfo score, bool isNewLocalScore = false)
|
||||
{
|
||||
var panel = new ScorePanel(score)
|
||||
var panel = new ScorePanel(score, isNewLocalScore)
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
|
Loading…
Reference in New Issue
Block a user