mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 20:33:09 +08:00
Add TestSceneGradedCircles
This commit is contained in:
parent
9c411ad48d
commit
809ca81b9c
44
osu.Game.Tests/Visual/Ranking/TestSceneGradedCircles.cs
Normal file
44
osu.Game.Tests/Visual/Ranking/TestSceneGradedCircles.cs
Normal file
@ -0,0 +1,44 @@
|
||||
// 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.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Ranking
|
||||
{
|
||||
public partial class TestSceneGradedCircles : OsuTestScene
|
||||
{
|
||||
private readonly GradedCircles ring;
|
||||
|
||||
public TestSceneGradedCircles()
|
||||
{
|
||||
ScoreProcessor scoreProcessor = new OsuRuleset().CreateScoreProcessor();
|
||||
double accuracyX = scoreProcessor.AccuracyCutoffFromRank(ScoreRank.X);
|
||||
double accuracyS = scoreProcessor.AccuracyCutoffFromRank(ScoreRank.S);
|
||||
|
||||
double accuracyA = scoreProcessor.AccuracyCutoffFromRank(ScoreRank.A);
|
||||
double accuracyB = scoreProcessor.AccuracyCutoffFromRank(ScoreRank.B);
|
||||
double accuracyC = scoreProcessor.AccuracyCutoffFromRank(ScoreRank.C);
|
||||
|
||||
Add(new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(400),
|
||||
Child = ring = new GradedCircles(accuracyC, accuracyB, accuracyA, accuracyS, accuracyX)
|
||||
});
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
AddSliderStep("Progress", 0.0, 1.0, 1.0, p => ring.Progress = p);
|
||||
}
|
||||
}
|
||||
}
|
@ -12,6 +12,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
{
|
||||
public partial class GradedCircles : BufferedContainer
|
||||
{
|
||||
public double Progress
|
||||
{
|
||||
get => innerMask.Current.Value;
|
||||
set => innerMask.Current.Value = value;
|
||||
}
|
||||
|
||||
private readonly CircularProgress innerMask;
|
||||
|
||||
public GradedCircles(double accuracyC, double accuracyB, double accuracyA, double accuracyS, double accuracyX)
|
||||
|
Loading…
Reference in New Issue
Block a user