mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 14:02:55 +08:00
Merge branch 'master' into fix-import-crash
This commit is contained in:
commit
64bc0f958b
@ -134,9 +134,9 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
|
|
||||||
DetailsVisible.BindValueChanged(visible =>
|
DetailsVisible.BindValueChanged(visible =>
|
||||||
{
|
{
|
||||||
hiddenDetailContainer.Alpha = visible.NewValue ? 0 : 1;
|
hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint);
|
||||||
expandedDetailContainer.Alpha = visible.NewValue ? 1 : 0;
|
expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||||
}, true);
|
});
|
||||||
|
|
||||||
User.BindValueChanged(user => updateDisplay(user.NewValue));
|
User.BindValueChanged(user => updateDisplay(user.NewValue));
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,40 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
private OverlinedInfoContainer ppInfo;
|
private OverlinedInfoContainer ppInfo;
|
||||||
private OverlinedInfoContainer detailGlobalRank;
|
private OverlinedInfoContainer detailGlobalRank;
|
||||||
private OverlinedInfoContainer detailCountryRank;
|
private OverlinedInfoContainer detailCountryRank;
|
||||||
|
private FillFlowContainer fillFlow;
|
||||||
private RankGraph rankGraph;
|
private RankGraph rankGraph;
|
||||||
|
|
||||||
public readonly Bindable<User> User = new Bindable<User>();
|
public readonly Bindable<User> User = new Bindable<User>();
|
||||||
|
|
||||||
|
private bool expanded = true;
|
||||||
|
|
||||||
|
public bool Expanded
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (expanded == value) return;
|
||||||
|
|
||||||
|
expanded = value;
|
||||||
|
|
||||||
|
if (fillFlow == null) return;
|
||||||
|
|
||||||
|
fillFlow.ClearTransforms();
|
||||||
|
|
||||||
|
if (expanded)
|
||||||
|
fillFlow.AutoSizeAxes = Axes.Y;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fillFlow.AutoSizeAxes = Axes.None;
|
||||||
|
fillFlow.ResizeHeightTo(0, 200, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
User.ValueChanged += e => updateDisplay(e.NewValue);
|
User.ValueChanged += e => updateDisplay(e.NewValue);
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
@ -43,10 +69,13 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colours.CommunityUserGrayGreenDarkest,
|
Colour = colours.CommunityUserGrayGreenDarkest,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
fillFlow = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = expanded ? Axes.Y : Axes.None,
|
||||||
|
AutoSizeDuration = 200,
|
||||||
|
AutoSizeEasing = Easing.OutQuint,
|
||||||
|
Masking = true,
|
||||||
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 20),
|
Spacing = new Vector2(0, 20),
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
infoTabControl.AddItem("Info");
|
infoTabControl.AddItem("Info");
|
||||||
infoTabControl.AddItem("Modding");
|
infoTabControl.AddItem("Modding");
|
||||||
|
|
||||||
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Alpha = visible.NewValue ? 1 : 0, true);
|
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Expanded = visible.NewValue, true);
|
||||||
User.ValueChanged += e => updateDisplay(e.NewValue);
|
User.ValueChanged += e => updateDisplay(e.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user