KeyCounter visibility

This commit is contained in:
Andrey Zavadskiy
2017-03-01 13:22:01 +03:00
parent 327300e9a7
commit cc92459ee1
2 changed files with 26 additions and 1 deletions

View File

@ -33,6 +33,8 @@ namespace osu.Game.Configuration
Set(OsuConfig.SnakingOutSliders, false); Set(OsuConfig.SnakingOutSliders, false);
Set(OsuConfig.MenuParallax, true); Set(OsuConfig.MenuParallax, true);
Set(OsuConfig.KeyOverlay, false);
//todo: implement all settings below this line (remove the Disabled set when doing so). //todo: implement all settings below this line (remove the Disabled set when doing so).
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true; Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
@ -80,7 +82,6 @@ namespace osu.Game.Configuration
Set(OsuConfig.IgnoreBeatmapSamples, false).Disabled = true; Set(OsuConfig.IgnoreBeatmapSamples, false).Disabled = true;
Set(OsuConfig.IgnoreBeatmapSkins, false).Disabled = true; Set(OsuConfig.IgnoreBeatmapSkins, false).Disabled = true;
Set(OsuConfig.IgnoreList, string.Empty).Disabled = true; Set(OsuConfig.IgnoreList, string.Empty).Disabled = true;
Set(OsuConfig.KeyOverlay, false).Disabled = true;
Set(OsuConfig.Language, @"unknown").Disabled = true; Set(OsuConfig.Language, @"unknown").Disabled = true;
Set(OsuConfig.AllowNowPlayingHighlights, false).Disabled = true; Set(OsuConfig.AllowNowPlayingHighlights, false).Disabled = true;
Set(OsuConfig.LastVersion, string.Empty).Disabled = true; Set(OsuConfig.LastVersion, string.Empty).Disabled = true;

View File

@ -9,6 +9,9 @@ using osu.Game.Modes.Objects;
using OpenTK; using OpenTK;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Framework.Configuration;
namespace osu.Game.Modes.UI namespace osu.Game.Modes.UI
{ {
@ -21,6 +24,8 @@ namespace osu.Game.Modes.UI
public HealthDisplay HealthDisplay; public HealthDisplay HealthDisplay;
public Score Score { get; set; } public Score Score { get; set; }
private Bindable<bool> showKeyCounter;
protected abstract KeyCounterCollection CreateKeyCounter(); protected abstract KeyCounterCollection CreateKeyCounter();
protected abstract ComboCounter CreateComboCounter(); protected abstract ComboCounter CreateComboCounter();
protected abstract PercentageCounter CreateAccuracyCounter(); protected abstract PercentageCounter CreateAccuracyCounter();
@ -58,6 +63,25 @@ namespace osu.Game.Modes.UI
}; };
} }
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
if (showKeyCounter)
KeyCounter.Show();
else KeyCounter.Hide();
showKeyCounter.ValueChanged += visibilityChanged;
}
private void visibilityChanged(object sender, EventArgs e)
{
if (showKeyCounter)
KeyCounter.Show();
else KeyCounter.Hide();
}
public void BindProcessor(ScoreProcessor processor) public void BindProcessor(ScoreProcessor processor)
{ {
//bind processor bindables to combocounter, score display etc. //bind processor bindables to combocounter, score display etc.