Rename alwaysVisible to explain where it comes from

This commit is contained in:
Dean Herbert 2018-06-13 11:38:15 +09:00
parent d9e7a324c0
commit a7ed3ea80b
1 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class KeyCounterCollection : FillFlowContainer<KeyCounter>
private const int duration = 100;
public readonly Bindable<bool> Visible = new Bindable<bool>(true);
private readonly Bindable<bool> alwaysVisible = new Bindable<bool>();
private readonly Bindable<bool> configVisibility = new Bindable<bool>();
public KeyCounterCollection()
{
@ -47,10 +47,10 @@ public void ResetCount()
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
config.BindWith(OsuSetting.KeyOverlay, alwaysVisible);
config.BindWith(OsuSetting.KeyOverlay, configVisibility);
Visible.BindValueChanged(_ => updateVisibility());
alwaysVisible.BindValueChanged(_ => updateVisibility(), true);
configVisibility.BindValueChanged(_ => updateVisibility(), true);
}
//further: change default values here and in KeyCounter if needed, instead of passing them in every constructor
@ -113,7 +113,7 @@ public Color4 KeyUpTextColor
}
}
private void updateVisibility() => this.FadeTo(Visible.Value || alwaysVisible.Value ? 1 : 0, duration);
private void updateVisibility() => this.FadeTo(Visible.Value || configVisibility.Value ? 1 : 0, duration);
public override bool HandleKeyboardInput => receptor == null;
public override bool HandleMouseInput => receptor == null;