Disable the display of HUD through DisplayHud property.

This commit is contained in:
Lucas A 2020-05-07 08:52:36 +02:00
parent aff74db80d
commit 83be5455d3
2 changed files with 17 additions and 1 deletions

View File

@ -487,6 +487,15 @@ namespace osu.Game.Rulesets.UI
protected virtual ResumeOverlay CreateResumeOverlay() => null;
/// <summary>
/// Whether to display the HUD with this ruleset.
/// Override to false to completely disable the display of the HUD with this ruleset.
/// </summary>
/// <remarks>
/// HUD refers here to <see cref="HUDOverlay"/> in player as well as <see cref="BreakOverlay"/>.
/// </remarks>
public virtual bool DisplayHud => true;
/// <summary>
/// Sets a replay to be used, overriding local input.
/// </summary>

View File

@ -89,7 +89,7 @@ namespace osu.Game.Screens.Play
protected DrawableRuleset DrawableRuleset { get; private set; }
public HUDOverlay HUDOverlay { get; private set; }
protected HUDOverlay HUDOverlay { get; private set; }
public bool LoadedBeatmapSuccessfully => DrawableRuleset?.Objects.Any() == true;
@ -184,6 +184,13 @@ namespace osu.Game.Screens.Play
addGameplayComponents(GameplayClockContainer, Beatmap.Value, playableBeatmap);
addOverlayComponents(GameplayClockContainer, Beatmap.Value);
if (!DrawableRuleset.DisplayHud)
{
HUDOverlay.ShowHud.Value = false;
HUDOverlay.ShowHud.Disabled = true;
BreakOverlay.Hide();
}
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
// bind clock into components that require it