mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
move logic to logo action
This commit is contained in:
parent
04a4f9c9a3
commit
c2353cbdfa
@ -39,6 +39,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private ButtonSystem buttons;
|
||||
|
||||
private bool loginPrompted = false;
|
||||
|
||||
[Resolved]
|
||||
private GameHost host { get; set; }
|
||||
|
||||
@ -137,9 +139,6 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
}
|
||||
|
||||
if (!api.IsLoggedIn)
|
||||
login?.ToggleVisibility();
|
||||
|
||||
Beatmap.ValueChanged += beatmap_ValueChanged;
|
||||
}
|
||||
|
||||
@ -152,6 +151,16 @@ namespace osu.Game.Screens.Menu
|
||||
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
|
||||
logo.FadeIn(100, Easing.OutQuint);
|
||||
|
||||
logo.Action += () =>
|
||||
{
|
||||
if (!api.IsLoggedIn && !loginPrompted)
|
||||
login?.ToggleVisibility();
|
||||
|
||||
loginPrompted = true;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
if (resuming)
|
||||
{
|
||||
buttons.State = ButtonSystemState.TopLevel;
|
||||
|
Loading…
Reference in New Issue
Block a user