mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 22:27:25 +08:00
Login overlay should disappear when toolbar is hidden.
This commit is contained in:
parent
a7dac15d05
commit
143cfae93a
@ -22,8 +22,9 @@ namespace osu.Game.Overlays.Toolbar
|
||||
public Action<PlayMode> OnPlayModeChange;
|
||||
|
||||
private ToolbarModeSelector modeSelector;
|
||||
private ToolbarUserArea userArea;
|
||||
|
||||
private const int transition_time = 300;
|
||||
private const int transition_time = 500;
|
||||
|
||||
private const float alpha_hovering = 0.8f;
|
||||
private const float alpha_normal = 0.6f;
|
||||
@ -67,7 +68,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
Icon = FontAwesome.fa_search
|
||||
},
|
||||
new ToolbarUserArea(),
|
||||
userArea = new ToolbarUserArea(),
|
||||
new ToolbarButton
|
||||
{
|
||||
Icon = FontAwesome.fa_bars
|
||||
@ -132,6 +133,8 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected override void PopOut()
|
||||
{
|
||||
userArea?.LoginOverlay.Hide();
|
||||
|
||||
MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint);
|
||||
FadeOut(transition_time);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
class ToolbarUserArea : Container
|
||||
{
|
||||
private LoginOverlay loginOverlay;
|
||||
public LoginOverlay LoginOverlay;
|
||||
private ToolbarUserButton button;
|
||||
|
||||
public override RectangleF BoundingBox => button.BoundingBox;
|
||||
@ -25,9 +25,9 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Children = new Drawable[] {
|
||||
button = new ToolbarUserButton
|
||||
{
|
||||
Action = toggle,
|
||||
Action = () => LoginOverlay.ToggleVisibility(),
|
||||
},
|
||||
loginOverlay = new LoginOverlay
|
||||
LoginOverlay = new LoginOverlay
|
||||
{
|
||||
BypassAutoSizeAxes = Axes.Both,
|
||||
Position = new Vector2(0, 1),
|
||||
@ -37,10 +37,5 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void toggle()
|
||||
{
|
||||
loginOverlay.ToggleVisibility();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user