2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-12-26 21:15:49 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using osu.Framework.Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
2022-01-17 01:56:21 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2019-12-26 21:15:49 +08:00
|
|
|
|
using osu.Game.Rulesets.Judgements;
|
2020-06-12 23:06:19 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Scoring;
|
2022-01-17 01:56:21 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.Skinning.Legacy;
|
2020-03-30 22:03:36 +08:00
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2019-12-26 21:15:49 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
2020-03-30 22:03:36 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
2019-12-26 21:15:49 +08:00
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class TestSceneDrawableJudgement : ManiaSkinnableTestScene
|
2019-12-26 21:15:49 +08:00
|
|
|
|
{
|
|
|
|
|
public TestSceneDrawableJudgement()
|
|
|
|
|
{
|
2020-06-13 11:31:34 +08:00
|
|
|
|
var hitWindows = new ManiaHitWindows();
|
2020-06-12 23:06:19 +08:00
|
|
|
|
|
2019-12-26 21:15:49 +08:00
|
|
|
|
foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Skip(1))
|
|
|
|
|
{
|
2020-06-13 11:31:34 +08:00
|
|
|
|
if (hitWindows.IsHitResultAllowed(result))
|
|
|
|
|
{
|
2022-01-17 01:56:21 +08:00
|
|
|
|
AddStep("Show " + result.GetDescription(), () =>
|
|
|
|
|
{
|
|
|
|
|
SetContents(_ =>
|
|
|
|
|
new DrawableManiaJudgement(new JudgementResult(new HitObject { StartTime = Time.Current }, new Judgement())
|
|
|
|
|
{
|
|
|
|
|
Type = result
|
|
|
|
|
}, null)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// for test purposes, undo the Y adjustment related to the `ScorePosition` legacy positioning config value
|
|
|
|
|
// (see `LegacyManiaJudgementPiece.load()`).
|
|
|
|
|
// this prevents the judgements showing somewhere below or above the bounding box of the judgement.
|
|
|
|
|
foreach (var legacyPiece in this.ChildrenOfType<LegacyManiaJudgementPiece>())
|
|
|
|
|
legacyPiece.Y = 0;
|
|
|
|
|
});
|
2020-06-13 11:31:34 +08:00
|
|
|
|
}
|
2019-12-26 21:15:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|