mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Merge pull request #1223 from peppy/home-hides-overlays
Hide all overlays when home button is pressed
This commit is contained in:
commit
a769b94aa8
@ -1 +1 @@
|
||||
Subproject commit 5f2d5a57e5d506d7e5d87eeeb442adf10be061f6
|
||||
Subproject commit 4e7ea6af4f59f21f6afc522fb063c05417e1a5fe
|
@ -245,7 +245,11 @@ namespace osu.Game
|
||||
LoadComponentAsync(Toolbar = new Toolbar
|
||||
{
|
||||
Depth = -4,
|
||||
OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); },
|
||||
OnHome = delegate
|
||||
{
|
||||
hideAllOverlays();
|
||||
intro?.ChildScreen?.MakeCurrent();
|
||||
},
|
||||
}, overlayContent.Add);
|
||||
|
||||
settings.StateChanged += delegate
|
||||
@ -310,6 +314,16 @@ namespace osu.Game
|
||||
private OsuScreen currentScreen;
|
||||
private FrameworkConfigManager frameworkConfig;
|
||||
|
||||
private void hideAllOverlays()
|
||||
{
|
||||
settings.State = Visibility.Hidden;
|
||||
chat.State = Visibility.Hidden;
|
||||
direct.State = Visibility.Hidden;
|
||||
social.State = Visibility.Hidden;
|
||||
userProfile.State = Visibility.Hidden;
|
||||
notificationOverlay.State = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private void screenChanged(Screen newScreen)
|
||||
{
|
||||
currentScreen = newScreen as OsuScreen;
|
||||
@ -323,19 +337,12 @@ namespace osu.Game
|
||||
//central game screen change logic.
|
||||
if (!currentScreen.ShowOverlays)
|
||||
{
|
||||
settings.State = Visibility.Hidden;
|
||||
Toolbar.State = Visibility.Hidden;
|
||||
hideAllOverlays();
|
||||
musicController.State = Visibility.Hidden;
|
||||
chat.State = Visibility.Hidden;
|
||||
direct.State = Visibility.Hidden;
|
||||
social.State = Visibility.Hidden;
|
||||
userProfile.State = Visibility.Hidden;
|
||||
notificationOverlay.State = Visibility.Hidden;
|
||||
Toolbar.State = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
Toolbar.State = Visibility.Visible;
|
||||
}
|
||||
|
||||
ScreenChanged?.Invoke(newScreen);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user