diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index fdb07df6ad..f7cbc1252e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -25,7 +25,7 @@ namespace osu.Desktop.VisualTests.Tests Origin = Anchor.Centre, Anchor = Anchor.Centre, IsCounting = true, - Counters = new KeyCounter[] + Children = new KeyCounter[] { new KeyCounterKeyboard(@"Z", Key.Z), new KeyCounterKeyboard(@"X", Key.X), diff --git a/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs b/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs index 5262d8f250..0c967999b3 100644 --- a/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs +++ b/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs @@ -39,7 +39,7 @@ namespace osu.Game.Modes.Osu.UI Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Margin = new MarginPadding(10), - Counters = new KeyCounter[] + Children = new KeyCounter[] { new KeyCounterKeyboard(@"Z", Key.Z), new KeyCounterKeyboard(@"X", Key.X), diff --git a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs index 83cab0748e..740c497f94 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounterCollection.cs @@ -1,7 +1,6 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using osu.Framework.Graphics; using OpenTK; using OpenTK.Graphics; @@ -9,7 +8,7 @@ using osu.Framework.Graphics.Containers; namespace osu.Game.Graphics.UserInterface { - public class KeyCounterCollection : FlowContainer + public class KeyCounterCollection : FlowContainer { public KeyCounterCollection() { @@ -17,22 +16,9 @@ namespace osu.Game.Graphics.UserInterface AutoSizeAxes = Axes.Both; } - private List counters = new List(); - public IEnumerable Counters + public override void Add(KeyCounter key) { - get { return counters; } - set - { - foreach (var k in value) - addKey(k); - - Children = value; - } - } - - private void addKey(KeyCounter key) - { - counters.Add(key); + base.Add(key); key.IsCounting = IsCounting; key.FadeTime = FadeTime; key.KeyDownTextColor = KeyDownTextColor; @@ -41,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface public void ResetCount() { - foreach (var counter in counters) + foreach (var counter in Children) counter.ResetCount(); } @@ -57,7 +43,7 @@ namespace osu.Game.Graphics.UserInterface if (value != isCounting) { isCounting = value; - foreach (var child in counters) + foreach (var child in Children) child.IsCounting = value; } } @@ -72,7 +58,7 @@ namespace osu.Game.Graphics.UserInterface if (value != fadeTime) { fadeTime = value; - foreach (var child in counters) + foreach (var child in Children) child.FadeTime = value; } } @@ -87,7 +73,7 @@ namespace osu.Game.Graphics.UserInterface if (value != keyDownTextColor) { keyDownTextColor = value; - foreach (var child in counters) + foreach (var child in Children) child.KeyDownTextColor = value; } } @@ -102,7 +88,7 @@ namespace osu.Game.Graphics.UserInterface if (value != keyUpTextColor) { keyUpTextColor = value; - foreach (var child in counters) + foreach (var child in Children) child.KeyUpTextColor = value; } }