2023-10-26 14:10:56 +08:00
|
|
|
// 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;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Colour;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Game.Configuration;
|
2024-08-06 17:06:08 +08:00
|
|
|
using osu.Game.Localisation.SkinComponents;
|
2023-10-26 14:10:56 +08:00
|
|
|
using osu.Game.Skinning;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
|
|
|
public partial class ArgonWedgePiece : CompositeDrawable, ISerialisableDrawable
|
|
|
|
{
|
|
|
|
public bool UsesFixedAnchor { get; set; }
|
|
|
|
|
|
|
|
[SettingSource("Inverted shear")]
|
|
|
|
public BindableBool InvertShear { get; } = new BindableBool();
|
|
|
|
|
2024-08-06 17:06:08 +08:00
|
|
|
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Colour), nameof(SkinnableComponentStrings.ColourDescription))]
|
|
|
|
public new BindableColour4 Colour { get; } = new BindableColour4(Color4Extensions.FromHex("#66CCFF"));
|
|
|
|
|
2023-10-26 14:10:56 +08:00
|
|
|
public ArgonWedgePiece()
|
|
|
|
{
|
|
|
|
CornerRadius = 10f;
|
2023-11-10 15:37:07 +08:00
|
|
|
|
|
|
|
Size = new Vector2(400, 100);
|
2023-10-26 14:10:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Masking = true;
|
|
|
|
Shear = new Vector2(0.8f, 0f);
|
|
|
|
|
|
|
|
InternalChild = new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-08-06 17:06:08 +08:00
|
|
|
Colour = ColourInfo.GradientVertical(Colour.Value.Opacity(0.0f), Colour.Value.Opacity(0.25f)),
|
2023-10-26 14:10:56 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
InvertShear.BindValueChanged(v => Shear = new Vector2(0.8f, 0f) * (v.NewValue ? -1 : 1), true);
|
2024-08-06 17:06:08 +08:00
|
|
|
Colour.BindValueChanged(c => InternalChild.Colour = ColourInfo.GradientVertical(Colour.Value.Opacity(0.0f), Colour.Value.Opacity(0.25f)));
|
2023-10-26 14:10:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|