Merge branch 'master' into timeline-input-adjustment

This commit is contained in:
Dean Herbert
2018-06-18 02:54:25 +09:00
committed by GitHub
56 changed files with 801 additions and 893 deletions

View File

@ -18,7 +18,8 @@ namespace osu.Game.Screens.Play
{
private const int duration = 100;
private Bindable<bool> showKeyCounter;
public readonly Bindable<bool> Visible = new Bindable<bool>(true);
private readonly Bindable<bool> configVisibility = new Bindable<bool>();
public KeyCounterCollection()
{
@ -46,9 +47,10 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
showKeyCounter = config.GetBindable<bool>(OsuSetting.KeyOverlay);
showKeyCounter.ValueChanged += keyCounterVisibility => this.FadeTo(keyCounterVisibility ? 1 : 0, duration);
showKeyCounter.TriggerChange();
config.BindWith(OsuSetting.KeyOverlay, configVisibility);
Visible.BindValueChanged(_ => updateVisibility());
configVisibility.BindValueChanged(_ => updateVisibility(), true);
}
//further: change default values here and in KeyCounter if needed, instead of passing them in every constructor
@ -111,6 +113,8 @@ namespace osu.Game.Screens.Play
}
}
private void updateVisibility() => this.FadeTo(Visible.Value || configVisibility.Value ? 1 : 0, duration);
public override bool HandleKeyboardInput => receptor == null;
public override bool HandleMouseInput => receptor == null;

View File

@ -229,6 +229,7 @@ namespace osu.Game.Screens.Play
};
hudOverlay.HoldToQuit.Action = Exit;
hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded);
if (ShowStoryboard)
initializeStoryboard(false);