mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 03:02:56 +08:00
Fixed the ability to change visibility even not in replay
This commit is contained in:
parent
4d0d27aa88
commit
b2b299a8c3
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user