mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 14:23:14 +08:00
Attempt to fix inner scope warning
This commit is contained in:
parent
7a369547fd
commit
be81346573
@ -95,8 +95,33 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
UserDropdown dropdown;
|
UserDropdown dropdown = new UserDropdown { RelativeSizeAxes = Axes.X };
|
||||||
UserPanel panel;
|
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[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
@ -125,40 +150,11 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
panel = new UserPanel(api.LocalUser.Value)
|
panel,
|
||||||
{
|
dropdown,
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
},
|
|
||||||
dropdown = new UserDropdown
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
panel.Status.BindTo(api.LocalUser.Value.Status);
|
|
||||||
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();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user