Merge pull request #9642 from peppy/score-panel-expanded-cover-background

Add user cover background to expanded version of score panel
This commit is contained in:
Dan Balasescu 2020-07-23 20:36:15 +09:00 committed by GitHub
commit 01edce7130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -13,6 +13,7 @@
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Contracted; using osu.Game.Screens.Ranking.Contracted;
using osu.Game.Screens.Ranking.Expanded; using osu.Game.Screens.Ranking.Expanded;
using osu.Game.Users;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -142,7 +143,16 @@ private void load()
CornerRadius = 20, CornerRadius = 20,
CornerExponent = 2.5f, CornerExponent = 2.5f,
Masking = true, Masking = true,
Child = middleLayerBackground = new Box { RelativeSizeAxes = Axes.Both } Children = new[]
{
middleLayerBackground = new Box { RelativeSizeAxes = Axes.Both },
new UserCoverBackground
{
RelativeSizeAxes = Axes.Both,
User = Score.User,
Colour = ColourInfo.GradientVertical(Color4.White.Opacity(0.5f), Color4Extensions.FromHex("#444").Opacity(0))
},
}
}, },
middleLayerContentContainer = new Container { RelativeSizeAxes = Axes.Both } middleLayerContentContainer = new Container { RelativeSizeAxes = Axes.Both }
} }
@ -155,18 +165,10 @@ protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
if (state == PanelState.Expanded)
{
topLayerBackground.FadeColour(expanded_top_layer_colour);
middleLayerBackground.FadeColour(expanded_middle_layer_colour);
}
else
{
topLayerBackground.FadeColour(contracted_top_layer_colour);
middleLayerBackground.FadeColour(contracted_middle_layer_colour);
}
updateState(); updateState();
topLayerBackground.FinishTransforms(false, nameof(Colour));
middleLayerBackground.FinishTransforms(false, nameof(Colour));
} }
private PanelState state = PanelState.Contracted; private PanelState state = PanelState.Contracted;