2022-07-27 08:51:55 +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.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2022-07-27 15:19:21 +08:00
|
|
|
using osu.Game.Screens.Play.HUD;
|
2022-07-27 08:51:55 +08:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
{
|
2022-07-27 15:19:21 +08:00
|
|
|
public partial class LegacySongProgress : SongProgress
|
2022-07-27 08:51:55 +08:00
|
|
|
{
|
2022-07-28 17:49:37 +08:00
|
|
|
private CircularProgress circularProgress = null!;
|
2022-07-27 08:51:55 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2022-07-28 17:49:37 +08:00
|
|
|
Size = new Vector2(33);
|
2022-07-27 08:51:55 +08:00
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2022-07-27 14:35:18 +08:00
|
|
|
new Container
|
2022-07-27 08:51:55 +08:00
|
|
|
{
|
2022-07-27 14:35:18 +08:00
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2022-07-27 08:51:55 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-07-28 17:49:37 +08:00
|
|
|
Size = new Vector2(0.92f),
|
|
|
|
Child = circularProgress = new CircularProgress
|
2022-07-27 14:35:18 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
2022-07-27 08:51:55 +08:00
|
|
|
},
|
|
|
|
new CircularContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Masking = true,
|
|
|
|
BorderColour = Colour4.White,
|
|
|
|
BorderThickness = 2,
|
|
|
|
Child = new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
AlwaysPresent = true,
|
|
|
|
Alpha = 0,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new Circle
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Colour = Colour4.White,
|
2022-07-28 17:49:37 +08:00
|
|
|
Size = new Vector2(4),
|
2022-07-27 08:51:55 +08:00
|
|
|
}
|
|
|
|
};
|
2022-07-27 15:19:21 +08:00
|
|
|
}
|
2022-07-27 08:51:55 +08:00
|
|
|
|
2022-07-27 15:19:21 +08:00
|
|
|
protected override void PopIn()
|
|
|
|
{
|
2022-07-28 17:29:49 +08:00
|
|
|
this.FadeIn(500, Easing.OutQuint);
|
2022-07-27 08:51:55 +08:00
|
|
|
}
|
|
|
|
|
2022-07-27 15:19:21 +08:00
|
|
|
protected override void PopOut()
|
2022-07-27 08:51:55 +08:00
|
|
|
{
|
2022-07-28 17:29:49 +08:00
|
|
|
this.FadeOut(100);
|
2022-07-27 15:19:21 +08:00
|
|
|
}
|
2022-07-27 08:51:55 +08:00
|
|
|
|
2022-07-28 15:12:49 +08:00
|
|
|
protected override void UpdateProgress(double progress, bool isIntro)
|
2022-07-27 15:19:21 +08:00
|
|
|
{
|
|
|
|
if (isIntro)
|
2022-07-27 08:51:55 +08:00
|
|
|
{
|
2022-07-28 17:49:37 +08:00
|
|
|
circularProgress.Scale = new Vector2(-1, 1);
|
|
|
|
circularProgress.Anchor = Anchor.TopRight;
|
|
|
|
circularProgress.Colour = new Colour4(199, 255, 47, 153);
|
|
|
|
circularProgress.Current.Value = 1 - progress;
|
2022-07-27 08:51:55 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-28 17:49:37 +08:00
|
|
|
circularProgress.Scale = new Vector2(1);
|
|
|
|
circularProgress.Anchor = Anchor.TopLeft;
|
|
|
|
circularProgress.Colour = new Colour4(255, 255, 255, 153);
|
|
|
|
circularProgress.Current.Value = progress;
|
2022-07-27 08:51:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|