1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 05:22:54 +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.Objects = HitRenderer.Objects;
hudOverlay.Progress.AudioClock = decoupledClock; hudOverlay.Progress.AudioClock = decoupledClock;
hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded; hudOverlay.Progress.AllowSeeking = HitRenderer.HasReplayLoaded;
hudOverlay.ReplaySettingsOverlay.IsVisible = HitRenderer.HasReplayLoaded; hudOverlay.ReplaySettingsOverlay.IsAvaliable = HitRenderer.HasReplayLoaded;
hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos);
hudOverlay.ModDisplay.Current.BindTo(Beatmap.Mods); 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 const int fade_duration = 100;
private bool isVisible; private bool isVisible;
public bool IsVisible
private bool isAvaliable;
public bool IsAvaliable
{ {
set set
{ {
isVisible = value; isAvaliable = value;
if (!isAvaliable) Hide();
if (isVisible) }
FadeIn(fade_duration); get
else {
FadeOut(fade_duration); return isAvaliable;
} }
get { return isVisible; }
} }
public ReplaySettingsOverlay() public ReplaySettingsOverlay()
@ -47,12 +48,25 @@ namespace osu.Game.Screens.Play.Settings
switch (args.Key) switch (args.Key)
{ {
case Key.H: case Key.H:
IsVisible = !isVisible; toogleVisibility();
return true; return true;
} }
} }
return base.OnKeyDown(state, args); return base.OnKeyDown(state, args);
} }
private void toogleVisibility()
{
if (isAvaliable)
{
if (isVisible)
FadeIn(fade_duration);
else
FadeOut(fade_duration);
isVisible = !isVisible;
}
}
} }
} }