mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08:00
Remove move unused pieces
This commit is contained in:
parent
17aa9f3040
commit
c548658662
@ -82,7 +82,13 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
// ensure placeholder is hidden when displaying scores
|
// ensure placeholder is hidden when displaying scores
|
||||||
PlaceholderState = PlaceholderState.Successful;
|
PlaceholderState = PlaceholderState.Successful;
|
||||||
|
|
||||||
var scoreFlow = CreateScoreFlow();
|
var scoreFlow = new FillFlowContainer<LeaderboardScore>
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Spacing = new Vector2(0f, 5f),
|
||||||
|
Padding = new MarginPadding { Top = 10, Bottom = 5 },
|
||||||
|
};
|
||||||
scoreFlow.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
|
scoreFlow.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
|
||||||
|
|
||||||
// schedule because we may not be loaded yet (LoadComponentAsync complains).
|
// schedule because we may not be loaded yet (LoadComponentAsync complains).
|
||||||
@ -118,15 +124,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual FillFlowContainer<LeaderboardScore> CreateScoreFlow()
|
|
||||||
=> new FillFlowContainer<LeaderboardScore>
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Spacing = new Vector2(0f, 5f),
|
|
||||||
Padding = new MarginPadding { Top = 10, Bottom = 5 },
|
|
||||||
};
|
|
||||||
|
|
||||||
private TScope scope;
|
private TScope scope;
|
||||||
|
|
||||||
public TScope Scope
|
public TScope Scope
|
||||||
@ -345,9 +342,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
currentPlaceholder = placeholder;
|
currentPlaceholder = placeholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool FadeBottom => true;
|
|
||||||
protected virtual bool FadeTop => false;
|
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
@ -366,22 +360,21 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
float topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, scrollFlow).Y;
|
float topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, scrollFlow).Y;
|
||||||
float bottomY = topY + LeaderboardScore.HEIGHT;
|
float bottomY = topY + LeaderboardScore.HEIGHT;
|
||||||
|
|
||||||
bool requireTopFade = FadeTop && topY <= fadeTop;
|
bool requireBottomFade = bottomY >= fadeBottom;
|
||||||
bool requireBottomFade = FadeBottom && bottomY >= fadeBottom;
|
|
||||||
|
|
||||||
if (!requireTopFade && !requireBottomFade)
|
if (!requireBottomFade)
|
||||||
c.Colour = Color4.White;
|
c.Colour = Color4.White;
|
||||||
else if (topY > fadeBottom + LeaderboardScore.HEIGHT || bottomY < fadeTop - LeaderboardScore.HEIGHT)
|
else if (topY > fadeBottom + LeaderboardScore.HEIGHT || bottomY < fadeTop - LeaderboardScore.HEIGHT)
|
||||||
c.Colour = Color4.Transparent;
|
c.Colour = Color4.Transparent;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bottomY - fadeBottom > 0 && FadeBottom)
|
if (bottomY - fadeBottom > 0)
|
||||||
{
|
{
|
||||||
c.Colour = ColourInfo.GradientVertical(
|
c.Colour = ColourInfo.GradientVertical(
|
||||||
Color4.White.Opacity(Math.Min(1 - (topY - fadeBottom) / LeaderboardScore.HEIGHT, 1)),
|
Color4.White.Opacity(Math.Min(1 - (topY - fadeBottom) / LeaderboardScore.HEIGHT, 1)),
|
||||||
Color4.White.Opacity(Math.Min(1 - (bottomY - fadeBottom) / LeaderboardScore.HEIGHT, 1)));
|
Color4.White.Opacity(Math.Min(1 - (bottomY - fadeBottom) / LeaderboardScore.HEIGHT, 1)));
|
||||||
}
|
}
|
||||||
else if (FadeTop)
|
else
|
||||||
{
|
{
|
||||||
c.Colour = ColourInfo.GradientVertical(
|
c.Colour = ColourInfo.GradientVertical(
|
||||||
Color4.White.Opacity(Math.Min(1 - (fadeTop - topY) / LeaderboardScore.HEIGHT, 1)),
|
Color4.White.Opacity(Math.Min(1 - (fadeTop - topY) / LeaderboardScore.HEIGHT, 1)),
|
||||||
|
Loading…
Reference in New Issue
Block a user