mirror of
https://github.com/ppy/osu
synced 2024-12-30 19:02:27 +00:00
Add combo numbers.
This commit is contained in:
parent
bab219c428
commit
7fbc5990d1
@ -49,7 +49,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
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
|
||||
|
@ -49,8 +49,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||
},
|
||||
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,
|
||||
|
@ -6,33 +6,54 @@ using osu.Framework.Graphics;
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
@ -15,8 +15,14 @@ namespace osu.Game.Modes.Osu.Objects
|
||||
{
|
||||
List<OsuHitObject> output = new List<OsuHitObject>();
|
||||
|
||||
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);
|
||||
|
||||
|
@ -24,6 +24,8 @@ namespace osu.Game.Modes.Objects
|
||||
|
||||
public HitSampleInfo Sample;
|
||||
|
||||
public int ComboIndex;
|
||||
|
||||
public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user