2022-02-20 22:48:33 +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 NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
2023-09-13 19:00:06 +08:00
|
|
|
using osu.Framework.Extensions.ObjectExtensions;
|
2022-02-20 22:48:33 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
using osu.Game.Overlays.Mods;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2024-01-31 22:50:43 +08:00
|
|
|
public partial class TestSceneRankingInformationDisplay : OsuTestScene
|
2022-02-20 22:48:33 +08:00
|
|
|
{
|
|
|
|
[Cached]
|
|
|
|
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green);
|
|
|
|
|
|
|
|
[Test]
|
2023-09-13 19:00:06 +08:00
|
|
|
public void TestBasic()
|
2022-02-20 22:48:33 +08:00
|
|
|
{
|
2024-01-31 22:50:43 +08:00
|
|
|
RankingInformationDisplay onlinePropertiesDisplay = null!;
|
2022-02-20 22:48:33 +08:00
|
|
|
|
2024-01-31 22:50:43 +08:00
|
|
|
AddStep("create content", () => Child = onlinePropertiesDisplay = new RankingInformationDisplay
|
2022-02-20 22:48:33 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre
|
|
|
|
});
|
|
|
|
|
2024-01-31 22:50:43 +08:00
|
|
|
AddToggleStep("toggle ranked", ranked => onlinePropertiesDisplay.Ranked.Value = ranked);
|
|
|
|
|
|
|
|
AddStep("set multiplier below 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 0.5);
|
|
|
|
AddStep("set multiplier to 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 1);
|
|
|
|
AddStep("set multiplier above 1", () => onlinePropertiesDisplay.ModMultiplier.Value = 1.5);
|
2022-02-20 22:48:33 +08:00
|
|
|
|
|
|
|
AddSliderStep("set multiplier", 0, 2, 1d, multiplier =>
|
|
|
|
{
|
2024-01-31 22:50:43 +08:00
|
|
|
if (onlinePropertiesDisplay.IsNotNull())
|
|
|
|
onlinePropertiesDisplay.ModMultiplier.Value = multiplier;
|
2022-02-20 22:48:33 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|