diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index bd5b0171cf..4aa2388e28 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -208,7 +208,7 @@ namespace osu.Game.Screens.Play hudOverlay.Progress.Objects = HitRenderer.Objects; hudOverlay.Progress.AudioClock = decoupledClock; hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded; - hudOverlay.ReplaySettingsOverlay.IsVisible = HitRenderer.HasReplayLoaded; + hudOverlay.ReplaySettingsOverlay.IsAvaliable = HitRenderer.HasReplayLoaded; hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods); diff --git a/osu.Game/Screens/Play/Settings/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/Settings/ReplaySettingsOverlay.cs index 9f4d12fd01..3d8e1e2d38 100644 --- a/osu.Game/Screens/Play/Settings/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/Settings/ReplaySettingsOverlay.cs @@ -13,18 +13,19 @@ namespace osu.Game.Screens.Play.Settings private const int fade_duration = 100; private bool isVisible; - public bool IsVisible + + private bool isAvaliable; + public bool IsAvaliable { set { - isVisible = value; - - if (isVisible) - FadeIn(fade_duration); - else - FadeOut(fade_duration); + isAvaliable = value; + if (!isAvaliable) Hide(); + } + get + { + return isAvaliable; } - get { return isVisible; } } public ReplaySettingsOverlay() @@ -47,12 +48,25 @@ namespace osu.Game.Screens.Play.Settings switch (args.Key) { case Key.H: - IsVisible = !isVisible; + toogleVisibility(); return true; } } return base.OnKeyDown(state, args); } + + private void toogleVisibility() + { + if (isAvaliable) + { + if (isVisible) + FadeIn(fade_duration); + else + FadeOut(fade_duration); + + isVisible = !isVisible; + } + } } }