2022-07-27 00:51:55 +00: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.
|
|
|
|
|
2022-07-27 07:19:21 +00:00
|
|
|
using System.Collections.Generic;
|
2022-07-27 00:51:55 +00:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2022-07-27 07:19:21 +00:00
|
|
|
using osu.Game.Screens.Play.HUD;
|
2022-07-27 00:51:55 +00:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
{
|
2022-07-27 07:19:21 +00:00
|
|
|
public class LegacySongProgress : SongProgress
|
2022-07-27 00:51:55 +00:00
|
|
|
{
|
2022-07-28 09:28:03 +00:00
|
|
|
private CircularProgress pie = null!;
|
2022-07-27 00:51:55 +00:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Size = new Vector2(35);
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2022-07-27 06:35:18 +00:00
|
|
|
new Container
|
2022-07-27 00:51:55 +00:00
|
|
|
{
|
2022-07-27 06:35:18 +00:00
|
|
|
Size = new Vector2(0.95f),
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2022-07-27 00:51:55 +00:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-07-27 06:35:18 +00:00
|
|
|
Child = pie = new CircularProgress
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
2022-07-27 00:51:55 +00: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,
|
|
|
|
Size = new Vector2(3),
|
|
|
|
}
|
|
|
|
};
|
2022-07-27 07:19:21 +00:00
|
|
|
}
|
2022-07-27 00:51:55 +00:00
|
|
|
|
2022-07-27 07:19:21 +00:00
|
|
|
protected override void PopIn()
|
|
|
|
{
|
2022-07-27 00:51:55 +00:00
|
|
|
}
|
|
|
|
|
2022-07-27 07:19:21 +00:00
|
|
|
protected override void PopOut()
|
2022-07-27 00:51:55 +00:00
|
|
|
{
|
2022-07-27 07:19:21 +00:00
|
|
|
}
|
2022-07-27 00:51:55 +00:00
|
|
|
|
2022-07-28 07:30:45 +00:00
|
|
|
protected override void UpdateObjects(IEnumerable<HitObject>? objects)
|
2022-07-27 07:19:21 +00:00
|
|
|
{
|
|
|
|
}
|
2022-07-27 00:51:55 +00:00
|
|
|
|
2022-07-28 07:12:49 +00:00
|
|
|
protected override void UpdateProgress(double progress, bool isIntro)
|
2022-07-27 07:19:21 +00:00
|
|
|
{
|
|
|
|
if (isIntro)
|
2022-07-27 00:51:55 +00:00
|
|
|
{
|
|
|
|
pie.Scale = new Vector2(-1, 1);
|
|
|
|
pie.Anchor = Anchor.TopRight;
|
2022-07-27 06:35:18 +00:00
|
|
|
pie.Colour = new Colour4(199, 255, 47, 153);
|
2022-07-27 07:19:21 +00:00
|
|
|
pie.Current.Value = 1 - progress;
|
2022-07-27 00:51:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pie.Scale = new Vector2(1);
|
|
|
|
pie.Anchor = Anchor.TopLeft;
|
2022-07-27 06:35:18 +00:00
|
|
|
pie.Colour = new Colour4(255, 255, 255, 153);
|
2022-07-27 07:19:21 +00:00
|
|
|
pie.Current.Value = progress;
|
2022-07-27 00:51:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|