Rename to AlwaysVisible and add XMLDoc

This commit is contained in:
Salman Ahmed 2020-02-03 20:00:43 +03:00
parent 51ed289c59
commit 4cd4055e7c
3 changed files with 9 additions and 4 deletions

View File

@ -85,7 +85,7 @@ public void TestChangeHUDVisibilityOnHiddenKeyCounter()
AddStep("set keycounter visible false", () =>
{
config.Set<bool>(OsuSetting.KeyOverlay, false);
hudOverlay.KeyCounter.Visible.Value = false;
hudOverlay.KeyCounter.AlwaysVisible.Value = false;
});
AddStep("set showhud false", () => hudOverlay.ShowHud.Value = false);

View File

@ -19,13 +19,18 @@ public class KeyCounterDisplay : Container<KeyCounter>
private const int duration = 100;
private const double key_fade_time = 80;
public readonly Bindable<bool> Visible = new Bindable<bool>(true);
private readonly Bindable<bool> configVisibility = new Bindable<bool>();
protected readonly FillFlowContainer<KeyCounter> KeyFlow;
protected override Container<KeyCounter> Content => KeyFlow;
/// <summary>
/// Whether the key counter should be visible regardless of the configuration value.
/// This is true by default, but can be changed.
/// </summary>
public readonly Bindable<bool> AlwaysVisible = new Bindable<bool>(true);
public KeyCounterDisplay()
{
AutoSizeAxes = Axes.Both;
@ -58,7 +63,7 @@ protected override void LoadComplete()
{
base.LoadComplete();
Visible.BindValueChanged(_ => updateVisibility());
AlwaysVisible.BindValueChanged(_ => updateVisibility());
configVisibility.BindValueChanged(_ => updateVisibility(), true);
}

View File

@ -219,7 +219,7 @@ private void addOverlayComponents(Container target, WorkingBeatmap working)
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