1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Split visuals of HitCircleSelectionMask into HitCircleMask

This commit is contained in:
smoogipoo 2018-10-03 14:35:26 +09:00
parent 677d0d4a19
commit e1db2bbc25
2 changed files with 38 additions and 15 deletions

View File

@ -0,0 +1,35 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Edit.Masks
{
public class HitCircleMask : CompositeDrawable
{
public HitCircleMask(HitCircle hitCircle)
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2((float)OsuHitObject.OBJECT_RADIUS * 2);
Scale = new Vector2(hitCircle.Scale);
CornerRadius = Size.X / 2;
AddInternal(new RingPiece());
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
}
}

View File

@ -1,12 +1,10 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
namespace osu.Game.Rulesets.Osu.Edit.Masks namespace osu.Game.Rulesets.Osu.Edit.Masks
{ {
@ -16,22 +14,12 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks
: base(hitCircle) : base(hitCircle)
{ {
Origin = Anchor.Centre; Origin = Anchor.Centre;
AutoSizeAxes = Axes.Both;
Position = hitCircle.Position; Position = hitCircle.Position;
Size = hitCircle.Size;
Scale = hitCircle.Scale;
CornerRadius = Size.X / 2; InternalChild = new HitCircleMask((HitCircle)hitCircle.HitObject);
AddInternal(new RingPiece());
hitCircle.HitObject.PositionChanged += _ => Position = hitCircle.Position; hitCircle.HitObject.PositionChanged += _ => Position = hitCircle.Position;
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
} }
} }