2021-08-11 05:43:16 +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-08-11 05:43:16 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Online.Rooms;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
2021-12-13 07:50:29 +00:00
|
|
|
using osu.Game.Tests.Resources;
|
2022-05-08 13:00:07 +00:00
|
|
|
using osuTK;
|
2021-08-11 05:43:16 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
|
|
|
public partial class TestSceneMultiplayerTeamResults : ScreenTestScene
|
|
|
|
{
|
2022-05-08 13:00:07 +00:00
|
|
|
[Test]
|
|
|
|
public void TestScaling()
|
|
|
|
{
|
|
|
|
// scheduling is needed as scaling the content immediately causes the entire scene to shake badly, for some odd reason.
|
|
|
|
AddSliderStep("scale", 0.5f, 1.6f, 1f, v => Schedule(() =>
|
|
|
|
{
|
|
|
|
Stack.Scale = new Vector2(v);
|
|
|
|
Stack.Size = new Vector2(1f / v);
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
2021-08-12 18:21:53 +00:00
|
|
|
[TestCase(7483253, 1048576)]
|
|
|
|
[TestCase(1048576, 7483253)]
|
2021-08-12 18:38:24 +00:00
|
|
|
[TestCase(1048576, 1048576)]
|
2021-08-13 19:30:26 +00:00
|
|
|
public void TestDisplayTeamResults(int team1Score, int team2Score)
|
2021-08-11 05:43:16 +00:00
|
|
|
{
|
2021-08-12 17:48:57 +00:00
|
|
|
MultiplayerResultsScreen screen = null;
|
|
|
|
|
2021-08-11 05:43:16 +00:00
|
|
|
AddStep("show results screen", () =>
|
|
|
|
{
|
|
|
|
var rulesetInfo = new OsuRuleset().RulesetInfo;
|
|
|
|
var beatmapInfo = CreateBeatmap(rulesetInfo).BeatmapInfo;
|
2021-12-13 07:50:29 +00:00
|
|
|
var score = TestResources.CreateTestScoreInfo(beatmapInfo);
|
2021-08-11 05:43:16 +00:00
|
|
|
|
2022-04-12 05:13:07 +00:00
|
|
|
SortedDictionary<int, BindableLong> teamScores = new SortedDictionary<int, BindableLong>
|
2021-08-11 05:43:16 +00:00
|
|
|
{
|
2022-04-12 05:13:07 +00:00
|
|
|
{ 0, new BindableLong(team1Score) },
|
|
|
|
{ 1, new BindableLong(team2Score) }
|
2021-08-11 05:43:16 +00:00
|
|
|
};
|
|
|
|
|
2022-02-15 14:33:26 +00:00
|
|
|
Stack.Push(screen = new MultiplayerTeamResultsScreen(score, 1, new PlaylistItem(beatmapInfo), teamScores));
|
2021-08-11 05:43:16 +00:00
|
|
|
});
|
2021-08-12 17:48:57 +00:00
|
|
|
|
|
|
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
2021-08-11 05:43:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|