1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 12:42:56 +08:00

Fixed the ability to change visibility even not in replay

This commit is contained in:
EVAST9919 2017-05-19 15:54:21 +03:00
parent 4d0d27aa88
commit b2b299a8c3
2 changed files with 24 additions and 10 deletions

View File

@ -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);

View File

@ -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;
}
}
}
}