From fc192906eacb8ff4f54134b520b8451244302bb1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Feb 2017 10:22:28 +0900 Subject: [PATCH] Handle proxied approach layer better and add slider's approach circle (previously missing). --- .../Objects/Drawables/DrawableHitCircle.cs | 4 +++- .../Objects/Drawables/DrawableSlider.cs | 5 +++-- osu.Game.Modes.Osu/UI/OsuPlayfield.cs | 4 ++-- .../IDrawableHitObjectWithProxiedApproach.cs | 17 +++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs index 8f59f05001..091366b88c 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -11,7 +11,7 @@ using OpenTK; namespace osu.Game.Modes.Osu.Objects.Drawables { - public class DrawableHitCircle : DrawableOsuHitObject + public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach { private HitCircle osuObject; @@ -156,5 +156,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables break; } } + + public Drawable ProxiedLayer => ApproachCircle; } } diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs index 611daad642..18999496b6 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs @@ -6,11 +6,10 @@ using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; -using osu.Framework.Input; namespace osu.Game.Modes.Osu.Objects.Drawables { - class DrawableSlider : DrawableOsuHitObject + public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach { private Slider slider; @@ -133,6 +132,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables FadeOut(800); } + + public Drawable ProxiedLayer => initialCircle.ApproachCircle; } internal interface ISliderProgress diff --git a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs index b6daffbb8b..20164060fe 100644 --- a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs @@ -60,10 +60,10 @@ namespace osu.Game.Modes.Osu.UI public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; - DrawableHitCircle c = h as DrawableHitCircle; + IDrawableHitObjectWithProxiedApproach c = h as IDrawableHitObjectWithProxiedApproach; if (c != null) { - approachCircles.Add(c.ApproachCircle.CreateProxy()); + approachCircles.Add(c.ProxiedLayer.CreateProxy()); } h.OnJudgement += judgement; diff --git a/osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs b/osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs new file mode 100644 index 0000000000..9abd2f8592 --- /dev/null +++ b/osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics; + +namespace osu.Game.Modes.Objects.Drawables +{ + public interface IDrawableHitObjectWithProxiedApproach + { + Drawable ProxiedLayer { get; } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4cbc229596..858da59ed5 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -75,6 +75,7 @@ +