diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs index 63e4a58dfc..208bf15328 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -49,7 +49,10 @@ public DrawableHitCircle(OsuHitObject h) : base(h) return true; }, }, - number = new NumberPiece(), + number = new NumberPiece() + { + Text = h is Spinner ? "S" : (HitObject.ComboIndex + 1).ToString(), + }, ring = new RingPiece(), flash = new FlashPiece(), explode = new ExplodePiece diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs index 18999496b6..6c4e1fec78 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs @@ -49,8 +49,10 @@ public DrawableSlider(Slider s) : base(s) }, initialCircle = new DrawableHitCircle(new HitCircle { + //todo: avoid creating this temporary HitCircle. StartTime = s.StartTime, Position = s.StackedPosition, + ComboIndex = s.ComboIndex, Scale = s.Scale, Colour = s.Colour, Sample = s.Sample, diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs index 8a594ed95c..bb18e32475 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs @@ -6,33 +6,54 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { public class NumberPiece : Container { - private Sprite number; + private SpriteText number; + + public string Text + { + get { return number.Text; } + set { number.Text = value; } + } public NumberPiece() { Anchor = Anchor.Centre; Origin = Anchor.Centre; - Children = new[] + Children = new Drawable[] { - number = new Sprite + new CircularContainer { + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Glow, + Radius = 60, + Colour = Color4.White.Opacity(0.5f), + }, + Children = new[] + { + new Box() + } + }, + number = new OsuSpriteText + { + Text = @"1", + Font = @"Venera", + UseFullGlyphHeight = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, + TextSize = 40, Alpha = 1 } }; } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - number.Texture = textures.Get(@"Play/osu/number"); - } } } \ No newline at end of file diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs index 27376df323..989a5caffb 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs @@ -15,8 +15,14 @@ public override List Convert(Beatmap beatmap) { List output = new List(); + int combo = 0; foreach (HitObject h in beatmap.HitObjects) + { + if (h.NewCombo) combo = 0; + + h.ComboIndex = combo++; output.Add(h as OsuHitObject); + } UpdateStacking(output, beatmap.BeatmapInfo?.StackLeniency ?? 0.7f); diff --git a/osu.Game/Modes/Objects/HitObject.cs b/osu.Game/Modes/Objects/HitObject.cs index 841858ac89..cdc5f1655d 100644 --- a/osu.Game/Modes/Objects/HitObject.cs +++ b/osu.Game/Modes/Objects/HitObject.cs @@ -24,6 +24,8 @@ public abstract class HitObject public HitSampleInfo Sample; + public int ComboIndex; + public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { } } }