1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 11:30:49 +08:00
Dean Herbert
2024-03-29 12:03:05 +08:00
Unverified
parent c51a2e169d
commit fef8afb833
+13 -4
View File
@@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Login
[Resolved]
private OsuColour colours { get; set; } = null!;
private UserDropdown dropdown = null!;
private UserDropdown? dropdown;
/// <summary>
/// Called to request a hide of a parent displaying this container.
@@ -68,6 +68,14 @@ namespace osu.Game.Overlays.Login
apiState.BindValueChanged(onlineStateChanged, true);
}
protected override void LoadComplete()
{
base.LoadComplete();
userStatus.BindTo(api.LocalUser.Value.Status);
userStatus.BindValueChanged(e => updateDropdownCurrent(e.NewValue), true);
}
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
{
form = null;
@@ -144,9 +152,6 @@ namespace osu.Game.Overlays.Login
},
};
userStatus.BindTo(api.LocalUser.Value.Status);
userStatus.BindValueChanged(e => updateDropdownCurrent(e.NewValue), true);
dropdown.Current.BindValueChanged(action =>
{
switch (action.NewValue)
@@ -171,6 +176,7 @@ namespace osu.Game.Overlays.Login
break;
}
}, true);
break;
}
@@ -180,6 +186,9 @@ namespace osu.Game.Overlays.Login
private void updateDropdownCurrent(UserStatus? status)
{
if (dropdown == null)
return;
switch (status)
{
case UserStatus.Online: