From fc0e44b2141c649290f1a044113f98d5eb0743ff Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 21 Jun 2017 11:18:52 +0900 Subject: [PATCH] Update framework. --- osu-framework | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game/Graphics/IHasAccentColour.cs | 4 +++- osu.Game/Graphics/Transforms/TransformAccent.cs | 2 +- osu.Game/Graphics/UserInterface/PercentageCounter.cs | 2 +- osu.Game/Graphics/UserInterface/RollingCounter.cs | 8 ++++---- osu.Game/Graphics/UserInterface/ScoreCounter.cs | 2 +- osu.Game/Graphics/UserInterface/SimpleComboCounter.cs | 2 +- osu.Game/Overlays/DragBar.cs | 2 +- osu.Game/Screens/Play/HUD/ComboCounter.cs | 2 +- osu.Game/Screens/Play/HUD/ComboResultCounter.cs | 2 +- osu.Game/Screens/Tournament/ScrollingTeamContainer.cs | 2 +- 12 files changed, 17 insertions(+), 15 deletions(-) diff --git a/osu-framework b/osu-framework index 231a39bf63..a4bd66e369 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 231a39bf63544566212b02019f1de2518a60946f +Subproject commit a4bd66e369f7ed5c1c0dc7a0157950dac1f11c5c diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index cfc20d4bd4..b51a7730e0 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Mania.UI barLineContainer.Width = columns.Width; } - private class TransformTimeSpan : Transform + private class TransformTimeSpan : Transform { public override double CurrentValue { diff --git a/osu.Game/Graphics/IHasAccentColour.cs b/osu.Game/Graphics/IHasAccentColour.cs index e4647f22fd..672c59a935 100644 --- a/osu.Game/Graphics/IHasAccentColour.cs +++ b/osu.Game/Graphics/IHasAccentColour.cs @@ -3,6 +3,7 @@ using OpenTK.Graphics; using osu.Framework.Graphics; +using osu.Framework.Graphics.Transforms; using osu.Game.Graphics.Transforms; namespace osu.Game.Graphics @@ -26,7 +27,8 @@ namespace osu.Game.Graphics /// The new accent colour. /// The tween duration. /// The tween easing. - public static void FadeAccent(this IHasAccentColour accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) + public static void FadeAccent(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) + where T : Transformable, IHasAccentColour { accentedDrawable.TransformTo(() => accentedDrawable.AccentColour, newColour, duration, easing, new TransformAccent()); } diff --git a/osu.Game/Graphics/Transforms/TransformAccent.cs b/osu.Game/Graphics/Transforms/TransformAccent.cs index 406d1ea9eb..d49f969c20 100644 --- a/osu.Game/Graphics/Transforms/TransformAccent.cs +++ b/osu.Game/Graphics/Transforms/TransformAccent.cs @@ -8,7 +8,7 @@ using osu.Framework.MathUtils; namespace osu.Game.Graphics.Transforms { - public class TransformAccent : Transform + public class TransformAccent : Transform { /// /// Current value of the transformed colour in linear colour space. diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index c32b654840..79cdc9effe 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -45,7 +45,7 @@ namespace osu.Game.Graphics.UserInterface Current.Value = Current + amount; } - protected class TransformAccuracy : Transform + protected class TransformAccuracy : Transform { public override double CurrentValue { diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index bdb2054ca4..4338dd23eb 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface /// /// Must be a subclass of Transform(T) /// - protected virtual Type TransformType => typeof(Transform); + protected virtual Type TransformType => typeof(Transform); protected SpriteText DisplayedCountSpriteText; @@ -181,17 +181,17 @@ namespace osu.Game.Graphics.UserInterface protected virtual void TransformCount(T currentValue, T newValue) { Debug.Assert( - typeof(Transform).IsAssignableFrom(TransformType), + typeof(Transform).IsAssignableFrom(TransformType), @"transformType should be a subclass of Transform." ); - TransformCount((Transform)Activator.CreateInstance(TransformType), currentValue, newValue); + TransformCount((Transform)Activator.CreateInstance(TransformType), currentValue, newValue); } /// /// Intended to be used by TransformCount(T currentValue, T newValue). /// - protected void TransformCount(Transform transform, T currentValue, T newValue) + protected void TransformCount(Transform transform, T currentValue, T newValue) { Type type = transform.GetType(); diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index 3e01b9e4f4..f98e84852a 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -56,7 +56,7 @@ namespace osu.Game.Graphics.UserInterface Current.Value = Current + amount; } - protected class TransformScore : Transform + protected class TransformScore : Transform { public override double CurrentValue { diff --git a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs index 8537e80f63..bee1a71894 100644 --- a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs +++ b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs @@ -37,7 +37,7 @@ namespace osu.Game.Graphics.UserInterface Current.Value = Current + amount; } - private class TransformCounterCount : Transform + private class TransformCounterCount : Transform { public override int CurrentValue { diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 281f02a451..07e0c76396 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -98,7 +98,7 @@ namespace osu.Game.Overlays return true; } - private class TransformSeek : TransformFloat + private class TransformSeek : TransformFloat { public override void Apply(Drawable d) { diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index 46c7084cec..3793181ecd 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -205,7 +205,7 @@ namespace osu.Game.Screens.Play.HUD Transforms.Add(transform); } - protected class TransformComboRoll : Transform + protected class TransformComboRoll : Transform { public override int CurrentValue { diff --git a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs index a1a166f944..a4a20c1fd0 100644 --- a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD Current.Value = Current + amount; } - protected class TransformComboResult : Transform + protected class TransformComboResult : Transform { public override ulong CurrentValue { diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 4e34975085..a7019f1e35 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -308,7 +308,7 @@ namespace osu.Game.Screens.Tournament Scrolling } - public class TransformScrollSpeed : TransformFloat + public class TransformScrollSpeed : TransformFloat { public override void Apply(Drawable d) {