diff --git a/osu-framework b/osu-framework index e611e186e3..7ca1719b5c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e611e186e3c8951d7e58a6c92c75e1b587e825a2 +Subproject commit 7ca1719b5cdc8b0a9600abe6472b38a426abedb0 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 @@ public override void Reset() 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 @@ public class OsuScoreOverlay : ScoreOverlay 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 @@ namespace osu.Game.Graphics.UserInterface { - public class KeyCounterCollection : FlowContainer + public class KeyCounterCollection : FlowContainer { public KeyCounterCollection() { @@ -17,22 +16,9 @@ public KeyCounterCollection() 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 @@ private void addKey(KeyCounter key) public void ResetCount() { - foreach (var counter in counters) + foreach (var counter in Children) counter.ResetCount(); } @@ -57,7 +43,7 @@ public bool IsCounting if (value != isCounting) { isCounting = value; - foreach (var child in counters) + foreach (var child in Children) child.IsCounting = value; } } @@ -72,7 +58,7 @@ public int FadeTime if (value != fadeTime) { fadeTime = value; - foreach (var child in counters) + foreach (var child in Children) child.FadeTime = value; } } @@ -87,7 +73,7 @@ public Color4 KeyDownTextColor if (value != keyDownTextColor) { keyDownTextColor = value; - foreach (var child in counters) + foreach (var child in Children) child.KeyDownTextColor = value; } } @@ -102,7 +88,7 @@ public Color4 KeyUpTextColor if (value != keyUpTextColor) { keyUpTextColor = value; - foreach (var child in counters) + foreach (var child in Children) child.KeyUpTextColor = value; } }