From bec4bf36ac6eaf6f8196d05fedb8fa293e23d98e Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 4 Apr 2017 17:47:41 +0300 Subject: [PATCH] hud->content and style fixes --- osu.Game/Modes/UI/HudOverlay.cs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/osu.Game/Modes/UI/HudOverlay.cs b/osu.Game/Modes/UI/HudOverlay.cs index 586d28e7f6..263699422c 100644 --- a/osu.Game/Modes/UI/HudOverlay.cs +++ b/osu.Game/Modes/UI/HudOverlay.cs @@ -20,7 +20,7 @@ namespace osu.Game.Modes.UI { private const int duration = 100; - private readonly Container hud; + private readonly Container content; public readonly KeyCounterCollection KeyCounter; public readonly ComboCounter ComboCounter; public readonly ScoreCounter ScoreCounter; @@ -42,7 +42,7 @@ namespace osu.Game.Modes.UI { RelativeSizeAxes = Axes.Both; - Add(hud = new Container + Add(content = new Container { RelativeSizeAxes = Axes.Both, @@ -61,17 +61,23 @@ namespace osu.Game.Modes.UI private void load(OsuConfigManager config, NotificationManager notificationManager) { showKeyCounter = config.GetBindable(OsuConfig.KeyOverlay); - showKeyCounter.ValueChanged += visibility => + showKeyCounter.ValueChanged += keyCounterVisibility => { - if (visibility) - KeyCounter.Show(); + if (keyCounterVisibility) + KeyCounter.FadeIn(duration); else - KeyCounter.Hide(); + KeyCounter.FadeOut(duration); }; showKeyCounter.TriggerChange(); showHud = config.GetBindable(OsuConfig.ShowInterface); - showHud.ValueChanged += hudVisibilityChanged; + showHud.ValueChanged += hudVisibility => + { + if (hudVisibility) + content.FadeIn(duration); + else + content.FadeOut(duration); + }; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) @@ -85,14 +91,6 @@ namespace osu.Game.Modes.UI } } - private void hudVisibilityChanged(object sender, EventArgs e) - { - if (showHud) - hud.FadeIn(duration); - else - hud.FadeOut(duration); - } - public void BindProcessor(ScoreProcessor processor) { ScoreCounter?.Current.BindTo(processor.TotalScore);