mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Move user stats into detail header container
This commit is contained in:
parent
7a475d9cf8
commit
f7c942ac10
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
{
|
{
|
||||||
public partial class ExtendedDetails : CompositeDrawable
|
public partial class ExtendedDetails : CompositeDrawable
|
||||||
{
|
{
|
||||||
public Bindable<UserProfile?> UserProfile { get; } = new Bindable<UserProfile?>();
|
public Bindable<UserProfileData?> User { get; } = new Bindable<UserProfileData?>();
|
||||||
|
|
||||||
private SpriteText rankedScore = null!;
|
private SpriteText rankedScore = null!;
|
||||||
private SpriteText hitAccuracy = null!;
|
private SpriteText hitAccuracy = null!;
|
||||||
@ -46,6 +46,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Name = @"Labels",
|
Name = @"Labels",
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, vertical_spacing),
|
Spacing = new Vector2(0, vertical_spacing),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -62,6 +63,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
Name = @"Values",
|
Name = @"Values",
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, vertical_spacing),
|
Spacing = new Vector2(0, vertical_spacing),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -83,7 +85,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
UserProfile.BindValueChanged(userProfile => updateStatistics(userProfile.NewValue?.User.Statistics), true);
|
User.BindValueChanged(user => updateStatistics(user.NewValue?.User.Statistics), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateStatistics(UserStatistics? statistics)
|
private void updateStatistics(UserStatistics? statistics)
|
||||||
|
@ -40,7 +40,6 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
AutoSizeDuration = 200,
|
AutoSizeDuration = 200,
|
||||||
AutoSizeEasing = Easing.OutQuint,
|
AutoSizeEasing = Easing.OutQuint,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 15),
|
Spacing = new Vector2(0, 15),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -26,10 +26,50 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colourProvider.Background5,
|
Colour = colourProvider.Background5,
|
||||||
},
|
},
|
||||||
new MainDetails
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
User = { BindTarget = User }
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
||||||
|
Child = new GridContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RowDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
},
|
||||||
|
ColumnDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
new MainDetails
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
User = { BindTarget = User }
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 2,
|
||||||
|
Colour = colourProvider.Background6,
|
||||||
|
Margin = new MarginPadding { Horizontal = 15 }
|
||||||
|
},
|
||||||
|
new ExtendedDetails
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
User = { BindTarget = User }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user