From 4cd4055e7cb509d20e788ab261dd2dcb44519bfa Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Mon, 3 Feb 2020 20:00:43 +0300 Subject: [PATCH] Rename to AlwaysVisible and add XMLDoc --- osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs | 2 +- osu.Game/Screens/Play/KeyCounterDisplay.cs | 9 +++++++-- osu.Game/Screens/Play/Player.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs index 7ce6153ba5..2bafcc1197 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneHUDOverlay.cs @@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddStep("set keycounter visible false", () => { config.Set(OsuSetting.KeyOverlay, false); - hudOverlay.KeyCounter.Visible.Value = false; + hudOverlay.KeyCounter.AlwaysVisible.Value = false; }); AddStep("set showhud false", () => hudOverlay.ShowHud.Value = false); diff --git a/osu.Game/Screens/Play/KeyCounterDisplay.cs b/osu.Game/Screens/Play/KeyCounterDisplay.cs index 5584bdc359..2ed4afafd3 100644 --- a/osu.Game/Screens/Play/KeyCounterDisplay.cs +++ b/osu.Game/Screens/Play/KeyCounterDisplay.cs @@ -19,13 +19,18 @@ namespace osu.Game.Screens.Play private const int duration = 100; private const double key_fade_time = 80; - public readonly Bindable Visible = new Bindable(true); private readonly Bindable configVisibility = new Bindable(); protected readonly FillFlowContainer KeyFlow; protected override Container Content => KeyFlow; + /// + /// Whether the key counter should be visible regardless of the configuration value. + /// This is true by default, but can be changed. + /// + public readonly Bindable AlwaysVisible = new Bindable(true); + public KeyCounterDisplay() { AutoSizeAxes = Axes.Both; @@ -58,7 +63,7 @@ namespace osu.Game.Screens.Play { base.LoadComplete(); - Visible.BindValueChanged(_ => updateVisibility()); + AlwaysVisible.BindValueChanged(_ => updateVisibility()); configVisibility.BindValueChanged(_ => updateVisibility(), true); } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7228e22382..aecd35f7dc 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -219,7 +219,7 @@ namespace osu.Game.Screens.Play IsPaused = { BindTarget = GameplayClockContainer.IsPaused } }, PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } }, - KeyCounter = { Visible = { BindTarget = DrawableRuleset.HasReplayLoaded } }, + KeyCounter = { AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded } }, RequestSeek = GameplayClockContainer.Seek, Anchor = Anchor.Centre, Origin = Anchor.Centre