1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Fix display order regression

This commit is contained in:
Dean Herbert 2017-05-25 19:47:18 +09:00
parent d7fa6933be
commit 1a255fdf48

View File

@ -28,6 +28,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
private LoginForm form;
private OsuColour colours;
private UserPanel panel;
private UserDropdown dropdown;
public override RectangleF BoundingBox => bounding ? base.BoundingBox : RectangleF.Empty;
public bool Bounding
@ -95,33 +98,6 @@ namespace osu.Game.Overlays.Settings.Sections.General
};
break;
case APIState.Online:
UserDropdown dropdown = new UserDropdown { RelativeSizeAxes = Axes.X };
dropdown.Current.ValueChanged += newValue =>
{
switch (newValue)
{
case UserAction.Online:
api.LocalUser.Value.Status.Value = new UserStatusOnline();
dropdown.StatusColour = colours.Green;
break;
case UserAction.DoNotDisturb:
api.LocalUser.Value.Status.Value = new UserStatusDoNotDisturb();
dropdown.StatusColour = colours.Red;
break;
case UserAction.AppearOffline:
api.LocalUser.Value.Status.Value = new UserStatusOffline();
dropdown.StatusColour = colours.Gray7;
break;
case UserAction.SignOut:
api.Logout();
break;
}
};
dropdown.Current.TriggerChange();
UserPanel panel = new UserPanel(api.LocalUser.Value) { RelativeSizeAxes = Axes.X };
panel.Status.BindTo(api.LocalUser.Value.Status);
Children = new Drawable[]
{
new FillFlowContainer
@ -150,11 +126,36 @@ namespace osu.Game.Overlays.Settings.Sections.General
},
},
},
panel,
dropdown,
panel = new UserPanel(api.LocalUser.Value) { RelativeSizeAxes = Axes.X },
dropdown = new UserDropdown { RelativeSizeAxes = Axes.X },
},
},
};
panel.Status.BindTo(api.LocalUser.Value.Status);
dropdown.Current.TriggerChange();
dropdown.Current.ValueChanged += newValue =>
{
switch (newValue)
{
case UserAction.Online:
api.LocalUser.Value.Status.Value = new UserStatusOnline();
dropdown.StatusColour = colours.Green;
break;
case UserAction.DoNotDisturb:
api.LocalUser.Value.Status.Value = new UserStatusDoNotDisturb();
dropdown.StatusColour = colours.Red;
break;
case UserAction.AppearOffline:
api.LocalUser.Value.Status.Value = new UserStatusOffline();
dropdown.StatusColour = colours.Gray7;
break;
case UserAction.SignOut:
api.Logout();
break;
}
};
break;
}