1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 17:32:54 +08:00

Hide and disable player settings overlay on multi-spectator player

This commit is contained in:
Salman Ahmed 2021-08-13 06:28:07 +03:00
parent 2b86416cb2
commit c10320f239
3 changed files with 11 additions and 3 deletions

View File

@ -4,6 +4,7 @@
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Scoring;
@ -34,6 +35,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
private void load()
{
spectatorPlayerClock.WaitingOnFrames.BindTo(waitingOnFrames);
HUDOverlay.PlayerSettingsOverlay.State.Value = Visibility.Hidden;
HUDOverlay.PlayerSettingsOverlay.State.Disabled = true;
}
protected override void UpdateAfterChildren()

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Play.HUD
if (e.ControlPressed)
{
if (e.Key == Key.H && ReplayLoaded)
if (e.Key == Key.H && ReplayLoaded && !State.Disabled)
{
ToggleVisibility();
return true;

View File

@ -240,13 +240,17 @@ namespace osu.Game.Screens.Play
if (e.NewValue)
{
PlayerSettingsOverlay.Show();
if (!PlayerSettingsOverlay.State.Disabled)
PlayerSettingsOverlay.Show();
ModDisplay.FadeIn(200);
KeyCounter.Margin = new MarginPadding(10) { Bottom = 30 };
}
else
{
PlayerSettingsOverlay.Hide();
if (!PlayerSettingsOverlay.State.Disabled)
PlayerSettingsOverlay.Hide();
ModDisplay.Delay(2000).FadeOut(200);
KeyCounter.Margin = new MarginPadding(10);
}