From d2d589a15695edab3b1f862b15ef4d27f63808d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 12 Oct 2022 15:11:52 +0900 Subject: [PATCH] Expose HUD state via `Player` --- osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs | 3 ++- osu.Game/Screens/Play/Player.cs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs b/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs index a923aca2c8..2dc9f5f5cb 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchComboDisplay.cs @@ -11,6 +11,7 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; +using osu.Game.Screens.Play; using osu.Game.Skinning; using osuTK.Graphics; @@ -41,7 +42,7 @@ public CatchComboDisplay() } [BackgroundDependencyLoader(true)] - private void load(DrawableRuleset drawableRuleset) + private void load(DrawableRuleset drawableRuleset, HUDOverlay hud) { hudVisibilityMode = config.GetBindable(OsuSetting.HUDVisibilityMode); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7721d5b912..68b623b781 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -94,6 +94,11 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab public int RestartCount; + /// + /// Whether the is currently visible. + /// + public IBindable ShowingOverlayComponents = new Bindable(); + [Resolved] private ScoreManager scoreManager { get; set; } @@ -1015,6 +1020,8 @@ public override void OnEntering(ScreenTransitionEvent e) }); HUDOverlay.IsPlaying.BindTo(localUserPlaying); + ShowingOverlayComponents.BindTo(HUDOverlay.ShowHud); + DimmableStoryboard.IsBreakTime.BindTo(breakTracker.IsBreakTime); DimmableStoryboard.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground);