mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add combo numbers.
This commit is contained in:
@ -49,7 +49,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
number = new NumberPiece(),
|
number = new NumberPiece()
|
||||||
|
{
|
||||||
|
Text = h is Spinner ? "S" : (HitObject.ComboIndex + 1).ToString(),
|
||||||
|
},
|
||||||
ring = new RingPiece(),
|
ring = new RingPiece(),
|
||||||
flash = new FlashPiece(),
|
flash = new FlashPiece(),
|
||||||
explode = new ExplodePiece
|
explode = new ExplodePiece
|
||||||
|
@ -49,8 +49,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
},
|
},
|
||||||
initialCircle = new DrawableHitCircle(new HitCircle
|
initialCircle = new DrawableHitCircle(new HitCircle
|
||||||
{
|
{
|
||||||
|
//todo: avoid creating this temporary HitCircle.
|
||||||
StartTime = s.StartTime,
|
StartTime = s.StartTime,
|
||||||
Position = s.StackedPosition,
|
Position = s.StackedPosition,
|
||||||
|
ComboIndex = s.ComboIndex,
|
||||||
Scale = s.Scale,
|
Scale = s.Scale,
|
||||||
Colour = s.Colour,
|
Colour = s.Colour,
|
||||||
Sample = s.Sample,
|
Sample = s.Sample,
|
||||||
|
@ -6,33 +6,54 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
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
|
namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
||||||
{
|
{
|
||||||
public class NumberPiece : Container
|
public class NumberPiece : Container
|
||||||
{
|
{
|
||||||
private Sprite number;
|
private SpriteText number;
|
||||||
|
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get { return number.Text; }
|
||||||
|
set { number.Text = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public NumberPiece()
|
public NumberPiece()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new CircularContainer
|
||||||
|
{
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Radius = 60,
|
||||||
|
Colour = Color4.White.Opacity(0.5f),
|
||||||
|
},
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
number = new Sprite
|
new Box()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
number = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
Text = @"1",
|
||||||
|
Font = @"Venera",
|
||||||
|
UseFullGlyphHeight = false,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
TextSize = 40,
|
||||||
Alpha = 1
|
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>();
|
List<OsuHitObject> output = new List<OsuHitObject>();
|
||||||
|
|
||||||
|
int combo = 0;
|
||||||
foreach (HitObject h in beatmap.HitObjects)
|
foreach (HitObject h in beatmap.HitObjects)
|
||||||
|
{
|
||||||
|
if (h.NewCombo) combo = 0;
|
||||||
|
|
||||||
|
h.ComboIndex = combo++;
|
||||||
output.Add(h as OsuHitObject);
|
output.Add(h as OsuHitObject);
|
||||||
|
}
|
||||||
|
|
||||||
UpdateStacking(output, beatmap.BeatmapInfo?.StackLeniency ?? 0.7f);
|
UpdateStacking(output, beatmap.BeatmapInfo?.StackLeniency ?? 0.7f);
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ namespace osu.Game.Modes.Objects
|
|||||||
|
|
||||||
public HitSampleInfo Sample;
|
public HitSampleInfo Sample;
|
||||||
|
|
||||||
|
public int ComboIndex;
|
||||||
|
|
||||||
public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { }
|
public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user