2020-11-30 10:56:32 +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-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-05-15 15:02:38 +00:00
|
|
|
using System.Linq;
|
2020-11-30 10:56:32 +00:00
|
|
|
using NUnit.Framework;
|
2021-05-15 15:02:38 +00:00
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
2021-05-18 06:08:56 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-05-15 15:02:38 +00:00
|
|
|
using osu.Framework.Screens;
|
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Skinning;
|
2020-11-30 10:56:32 +00:00
|
|
|
using osu.Game.Tests.Visual;
|
2021-05-15 15:02:38 +00:00
|
|
|
using osuTK;
|
2020-11-30 10:56:32 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Tests
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2020-12-01 00:49:04 +00:00
|
|
|
public partial class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
|
2020-11-30 10:56:32 +00:00
|
|
|
{
|
|
|
|
protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();
|
2021-05-15 15:02:38 +00:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestLegacyHUDComboCounterHidden([Values] bool withModifiedSkin)
|
|
|
|
{
|
|
|
|
if (withModifiedSkin)
|
|
|
|
{
|
|
|
|
AddStep("change component scale", () => Player.ChildrenOfType<LegacyScoreCounter>().First().Scale = new Vector2(2f));
|
2023-02-15 09:31:55 +00:00
|
|
|
AddStep("update target", () => Player.ChildrenOfType<SkinComponentsContainer>().ForEach(LegacySkin.UpdateDrawableTarget));
|
2021-05-15 15:02:38 +00:00
|
|
|
AddStep("exit player", () => Player.Exit());
|
2022-06-28 06:19:02 +00:00
|
|
|
CreateTest();
|
2021-05-15 15:02:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AddAssert("legacy HUD combo counter hidden", () =>
|
|
|
|
{
|
2021-05-19 20:32:16 +00:00
|
|
|
return Player.ChildrenOfType<LegacyComboCounter>().All(c => c.ChildrenOfType<Container>().Single().Alpha == 0f);
|
2021-05-15 15:02:38 +00:00
|
|
|
});
|
|
|
|
}
|
2020-11-30 10:56:32 +00:00
|
|
|
}
|
|
|
|
}
|