mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Merge branch 'master' into fix-social-overlay-performance
This commit is contained in:
@ -30,6 +30,9 @@ namespace osu.Game.Users
|
||||
private const float content_padding = 10;
|
||||
private const float status_height = 30;
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
private Container statusBar;
|
||||
private Box statusBg;
|
||||
private OsuSpriteText statusMessage;
|
||||
@ -39,6 +42,8 @@ namespace osu.Game.Users
|
||||
|
||||
public readonly Bindable<UserStatus> Status = new Bindable<UserStatus>();
|
||||
|
||||
public readonly IBindable<UserActivity> Activity = new Bindable<UserActivity>();
|
||||
|
||||
public new Action Action;
|
||||
|
||||
protected Action ViewProfile;
|
||||
@ -54,7 +59,7 @@ namespace osu.Game.Users
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, UserProfileOverlay profile)
|
||||
private void load(UserProfileOverlay profile)
|
||||
{
|
||||
if (colours == null)
|
||||
throw new ArgumentNullException(nameof(colours));
|
||||
@ -194,8 +199,8 @@ namespace osu.Game.Users
|
||||
});
|
||||
}
|
||||
|
||||
Status.ValueChanged += status => displayStatus(status.NewValue);
|
||||
Status.ValueChanged += status => statusBg.FadeColour(status.NewValue?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint);
|
||||
Status.ValueChanged += status => displayStatus(status.NewValue, Activity.Value);
|
||||
Activity.ValueChanged += activity => displayStatus(Status.Value, activity.NewValue);
|
||||
|
||||
base.Action = ViewProfile = () =>
|
||||
{
|
||||
@ -210,7 +215,7 @@ namespace osu.Game.Users
|
||||
Status.TriggerChange();
|
||||
}
|
||||
|
||||
private void displayStatus(UserStatus status)
|
||||
private void displayStatus(UserStatus status, UserActivity activity = null)
|
||||
{
|
||||
const float transition_duration = 500;
|
||||
|
||||
@ -225,8 +230,17 @@ namespace osu.Game.Users
|
||||
statusBar.ResizeHeightTo(status_height, transition_duration, Easing.OutQuint);
|
||||
statusBar.FadeIn(transition_duration, Easing.OutQuint);
|
||||
this.ResizeHeightTo(height, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
statusMessage.Text = status.Message;
|
||||
if (status is UserStatusOnline && activity != null)
|
||||
{
|
||||
statusMessage.Text = activity.Status;
|
||||
statusBg.FadeColour(activity.GetAppropriateColour(colours), 500, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
statusMessage.Text = status?.Message;
|
||||
statusBg.FadeColour(status?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user