mirror of
https://github.com/ppy/osu
synced 2025-02-17 19:07:07 +00:00
Make circle piece respond to hitobject scale
This commit is contained in:
parent
4a507c66ee
commit
22c545ea8c
@ -28,6 +28,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks.HitCircleMasks.Components
|
||||
|
||||
hitCircle.PositionChanged += _ => UpdatePosition();
|
||||
hitCircle.StackHeightChanged += _ => UpdatePosition();
|
||||
hitCircle.ScaleChanged += _ => Scale = new Vector2(hitCircle.Scale);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -62,6 +62,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
|
||||
HitObject.StackHeightChanged += _ => Position = HitObject.StackedPosition;
|
||||
HitObject.ScaleChanged += s => Scale = new Vector2(s);
|
||||
}
|
||||
|
||||
public override Color4 AccentColour
|
||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public event Action<Vector2> PositionChanged;
|
||||
public event Action<int> StackHeightChanged;
|
||||
public event Action<float> ScaleChanged;
|
||||
|
||||
public double TimePreempt = 600;
|
||||
public double TimeFadeIn = 400;
|
||||
@ -64,7 +65,20 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public double Radius => OBJECT_RADIUS * Scale;
|
||||
|
||||
public float Scale { get; set; } = 1;
|
||||
private float scale = 1;
|
||||
|
||||
public float Scale
|
||||
{
|
||||
get => scale;
|
||||
set
|
||||
{
|
||||
if (scale == value)
|
||||
return;
|
||||
scale = value;
|
||||
|
||||
ScaleChanged?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool NewCombo { get; set; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user