1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 02:52:54 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Edit/Blueprints/Components/EditNotePiece.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.0 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
2024-11-07 20:41:41 +08:00
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
2020-12-07 11:32:52 +08:00
using osu.Game.Rulesets.Mania.Skinning.Default;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osuTK;
2024-11-07 20:41:41 +08:00
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints.Components
{
public partial class EditNotePiece : CompositeDrawable
{
[Resolved]
private Column? column { get; set; }
public EditNotePiece()
{
Masking = true;
2024-11-07 15:41:29 +08:00
CornerRadius = 5;
Height = DefaultNotePiece.NOTE_HEIGHT;
2024-11-07 20:41:41 +08:00
InternalChildren = new Drawable[]
{
2024-11-07 20:41:41 +08:00
new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 5,
BorderThickness = 5,
BorderColour = Color4.White.Opacity(0.7f),
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true,
},
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 10,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
},
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
protected override void Update()
{
base.Update();
if (column != null)
Scale = new Vector2(1, column.ScrollingInfo.Direction.Value == ScrollingDirection.Down ? 1 : -1);
}
}
}