1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 03:42:57 +08:00

Fix tournament tests not fitting to lower resolutions correctly

This commit is contained in:
Dean Herbert 2023-07-24 18:22:32 +09:00
parent 2658161605
commit f837c0a43c
17 changed files with 42 additions and 23 deletions

View File

@ -10,7 +10,7 @@ using osu.Game.Tournament.Screens.Drawings;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneDrawingsScreen : TournamentTestScene
public partial class TestSceneDrawingsScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load(Storage storage)

View File

@ -15,7 +15,7 @@ using osu.Game.Tournament.Screens.Gameplay.Components;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneGameplayScreen : TournamentTestScene
public partial class TestSceneGameplayScreen : TournamentScreenTestScene
{
[Cached]
private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay { Width = 0.5f };

View File

@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.Editors;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneLadderEditorScreen : TournamentTestScene
public partial class TestSceneLadderEditorScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()

View File

@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.Ladder;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneLadderScreen : TournamentTestScene
public partial class TestSceneLadderScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()

View File

@ -14,7 +14,7 @@ using osu.Game.Tournament.Screens.MapPool;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneMapPoolScreen : TournamentTestScene
public partial class TestSceneMapPoolScreen : TournamentScreenTestScene
{
private MapPoolScreen screen;

View File

@ -5,7 +5,7 @@ using osu.Game.Tournament.Screens.Editors;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneRoundEditorScreen : TournamentTestScene
public partial class TestSceneRoundEditorScreen : TournamentScreenTestScene
{
public TestSceneRoundEditorScreen()
{

View File

@ -12,7 +12,7 @@ using osu.Game.Tournament.Screens.Schedule;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneScheduleScreen : TournamentTestScene
public partial class TestSceneScheduleScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()

View File

@ -7,7 +7,7 @@ using osu.Game.Tournament.Screens.Editors;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSeedingEditorScreen : TournamentTestScene
public partial class TestSceneSeedingEditorScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo();

View File

@ -12,7 +12,7 @@ using osu.Game.Tournament.Screens.TeamIntro;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSeedingScreen : TournamentTestScene
public partial class TestSceneSeedingScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo

View File

@ -6,7 +6,7 @@ using osu.Game.Tournament.Screens.Setup;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSetupScreen : TournamentTestScene
public partial class TestSceneSetupScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()

View File

@ -6,7 +6,7 @@ using osu.Game.Tournament.Screens.Showcase;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneShowcaseScreen : TournamentTestScene
public partial class TestSceneShowcaseScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()

View File

@ -5,7 +5,7 @@ using osu.Game.Tournament.Screens.Setup;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneStablePathSelectScreen : TournamentTestScene
public partial class TestSceneStablePathSelectScreen : TournamentScreenTestScene
{
public TestSceneStablePathSelectScreen()
{

View File

@ -5,7 +5,7 @@ using osu.Game.Tournament.Screens.Editors;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamEditorScreen : TournamentTestScene
public partial class TestSceneTeamEditorScreen : TournamentScreenTestScene
{
public TestSceneTeamEditorScreen()
{

View File

@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.TeamIntro;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamIntroScreen : TournamentTestScene
public partial class TestSceneTeamIntroScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo();

View File

@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.TeamWin;
namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamWinScreen : TournamentTestScene
public partial class TestSceneTeamWinScreen : TournamentScreenTestScene
{
[Test]
public void TestBasic()

View File

@ -0,0 +1,19 @@
// 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;
using osu.Framework.Graphics.Containers;
using osuTK;
namespace osu.Game.Tournament.Tests
{
public abstract partial class TournamentScreenTestScene : TournamentTestScene
{
protected override Container<Drawable> Content { get; } = new DrawSizePreservingFillContainer
{
TargetDrawSize = new Vector2(1920, 1080),
Scale = new Vector2(1920 / (float)(1920 + TournamentSceneManager.CONTROL_AREA_WIDTH)),
RelativeSizeAxes = Axes.Both
};
}
}

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using System.Linq;
using System.Threading;
using osu.Framework.Allocation;
@ -20,17 +18,17 @@ namespace osu.Game.Tournament.Tests
{
public abstract partial class TournamentTestScene : OsuTestScene
{
private TournamentMatch match;
[Cached]
protected LadderInfo Ladder { get; private set; } = new LadderInfo();
[Resolved]
private RulesetStore rulesetStore { get; set; }
[Cached]
protected MatchIPCInfo IPCInfo { get; private set; } = new MatchIPCInfo();
[Resolved]
private RulesetStore rulesetStore { get; set; } = null!;
private TournamentMatch match = null!;
[BackgroundDependencyLoader]
private void load(TournamentStorage storage)
{
@ -45,6 +43,8 @@ namespace osu.Game.Tournament.Tests
Ruleset.BindTo(Ladder.Ruleset);
Dependencies.CacheAs(new StableInfo(storage));
base.Content.Add(Content);
}
[SetUpSteps]
@ -167,7 +167,7 @@ namespace osu.Game.Tournament.Tests
public partial class TournamentTestSceneTestRunner : TournamentGameBase, ITestSceneTestRunner
{
private TestSceneTestRunner.TestRunner runner;
private TestSceneTestRunner.TestRunner runner = null!;
protected override void LoadAsyncComplete()
{