1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:47:29 +08:00

Move to ctor

This commit is contained in:
Dan Balasescu 2024-05-23 23:45:04 +09:00
parent f17f70dca7
commit b1c7afd75b
No known key found for this signature in database
2 changed files with 9 additions and 10 deletions

View File

@ -28,21 +28,22 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
public SliderBodyPiece() public SliderBodyPiece()
{ {
InternalChild = body = new ManualSliderBody AutoSizeAxes = Axes.Both;
{
AccentColour = Color4.Transparent
};
// SliderSelectionBlueprint relies on calling ReceivePositionalInputAt on this drawable to determine whether selection should occur. // SliderSelectionBlueprint relies on calling ReceivePositionalInputAt on this drawable to determine whether selection should occur.
// Without AlwaysPresent, a movement in a parent container (ie. the editor composer area resizing) could cause incorrect input handling. // Without AlwaysPresent, a movement in a parent container (ie. the editor composer area resizing) could cause incorrect input handling.
AlwaysPresent = true; AlwaysPresent = true;
InternalChild = body = new ManualSliderBody
{
AccentColour = Color4.Transparent
};
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
body.BorderColour = colours.Yellow; body.BorderColour = colours.Yellow;
AutoSizeAxes = Axes.Both;
} }
private int? lastVersion; private int? lastVersion;

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osuTK; using osuTK;
@ -13,12 +12,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
/// </summary> /// </summary>
public partial class ManualSliderBody : SliderBody public partial class ManualSliderBody : SliderBody
{ {
public new void SetVertices(IReadOnlyList<Vector2> vertices) => base.SetVertices(vertices); public ManualSliderBody()
[BackgroundDependencyLoader]
private void load()
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
} }
public new void SetVertices(IReadOnlyList<Vector2> vertices) => base.SetVertices(vertices);
} }
} }