mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:45:36 +08:00
Compare commits
3 Commits
c29bf6cec1
...
e183b2b14d
Author | SHA1 | Date | |
---|---|---|---|
|
e183b2b14d | ||
|
a0b8243f4c | ||
|
fb4b334ce2 |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
public readonly SkinnableDrawable CirclePiece;
|
||||
private readonly Container scaleContainer;
|
||||
|
||||
protected virtual OsuSkinComponents CirclePieceComponent => OsuSkinComponents.HitCircle;
|
||||
|
||||
public DrawableHitCircle(HitCircle h)
|
||||
: base(h)
|
||||
{
|
||||
@ -57,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
return true;
|
||||
},
|
||||
},
|
||||
CirclePiece = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.HitCircle), _ => new MainCirclePiece()),
|
||||
CirclePiece = new SkinnableDrawable(new OsuSkinComponent(CirclePieceComponent), _ => new MainCirclePiece()),
|
||||
ApproachCircle = new ApproachCircle
|
||||
{
|
||||
Alpha = 0,
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
private readonly IBindable<Vector2> positionBindable = new Bindable<Vector2>();
|
||||
private readonly IBindable<int> pathVersion = new Bindable<int>();
|
||||
|
||||
protected override OsuSkinComponents CirclePieceComponent => OsuSkinComponents.SliderHeadHitCircle;
|
||||
|
||||
private readonly Slider slider;
|
||||
|
||||
public DrawableSliderHead(Slider slider, HitCircle h)
|
||||
|
@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Osu
|
||||
ApproachCircle,
|
||||
ReverseArrow,
|
||||
HitCircleText,
|
||||
SliderHeadHitCircle,
|
||||
SliderFollowCircle,
|
||||
SliderBall,
|
||||
SliderBody,
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
||||
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 osu.Game.Rulesets.Objects.Drawables;
|
||||
@ -18,8 +19,12 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
{
|
||||
public class LegacyMainCirclePiece : CompositeDrawable
|
||||
{
|
||||
public LegacyMainCirclePiece()
|
||||
private readonly string priorityLookup;
|
||||
|
||||
public LegacyMainCirclePiece(string priorityLookup = null)
|
||||
{
|
||||
this.priorityLookup = priorityLookup;
|
||||
|
||||
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
|
||||
}
|
||||
|
||||
@ -39,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
{
|
||||
hitCircleSprite = new Sprite
|
||||
{
|
||||
Texture = skin.GetTexture("hitcircle"),
|
||||
Texture = getTextureWithFallback(string.Empty),
|
||||
Colour = drawableObject.AccentColour.Value,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -51,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
}, confineMode: ConfineMode.NoScaling),
|
||||
new Sprite
|
||||
{
|
||||
Texture = skin.GetTexture("hitcircleoverlay"),
|
||||
Texture = getTextureWithFallback("overlay"),
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}
|
||||
@ -65,6 +70,16 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
|
||||
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
||||
|
||||
Texture getTextureWithFallback(string name)
|
||||
{
|
||||
Texture tex = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(priorityLookup))
|
||||
tex = skin.GetTexture($"{priorityLookup}{name}");
|
||||
|
||||
return tex ?? skin.GetTexture($"hitcircle{name}");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateState(ValueChangedEvent<ArmedState> state)
|
||||
|
@ -82,6 +82,12 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
||||
|
||||
return null;
|
||||
|
||||
case OsuSkinComponents.SliderHeadHitCircle:
|
||||
if (hasHitCircle.Value)
|
||||
return new LegacyMainCirclePiece("sliderstartcircle");
|
||||
|
||||
return null;
|
||||
|
||||
case OsuSkinComponents.HitCircle:
|
||||
if (hasHitCircle.Value)
|
||||
return new LegacyMainCirclePiece();
|
||||
|
Loading…
Reference in New Issue
Block a user