Skip to content

Commit

Permalink
Fix tournament tests not fitting to lower resolutions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jul 24, 2023
1 parent 2658161 commit f837c0a
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneDrawingsScreen : TournamentTestScene
public partial class TestSceneDrawingsScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load(Storage storage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

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 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneLadderEditorScreen : TournamentTestScene
public partial class TestSceneLadderEditorScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tournament.Tests/Screens/TestSceneLadderScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneLadderScreen : TournamentTestScene
public partial class TestSceneLadderScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneMapPoolScreen : TournamentTestScene
public partial class TestSceneMapPoolScreen : TournamentScreenTestScene
{
private MapPoolScreen screen;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneRoundEditorScreen : TournamentTestScene
public partial class TestSceneRoundEditorScreen : TournamentScreenTestScene
{
public TestSceneRoundEditorScreen()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneScheduleScreen : TournamentTestScene
public partial class TestSceneScheduleScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSeedingEditorScreen : TournamentTestScene
public partial class TestSceneSeedingEditorScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSeedingScreen : TournamentTestScene
public partial class TestSceneSeedingScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tournament.Tests/Screens/TestSceneSetupScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneSetupScreen : TournamentTestScene
public partial class TestSceneSetupScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneShowcaseScreen : TournamentTestScene
public partial class TestSceneShowcaseScreen : TournamentScreenTestScene
{
[BackgroundDependencyLoader]
private void load()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneStablePathSelectScreen : TournamentTestScene
public partial class TestSceneStablePathSelectScreen : TournamentScreenTestScene
{
public TestSceneStablePathSelectScreen()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamEditorScreen : TournamentTestScene
public partial class TestSceneTeamEditorScreen : TournamentScreenTestScene
{
public TestSceneTeamEditorScreen()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamIntroScreen : TournamentTestScene
public partial class TestSceneTeamIntroScreen : TournamentScreenTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace osu.Game.Tournament.Tests.Screens
{
public partial class TestSceneTeamWinScreen : TournamentTestScene
public partial class TestSceneTeamWinScreen : TournamentScreenTestScene
{
[Test]
public void TestBasic()
Expand Down
19 changes: 19 additions & 0 deletions osu.Game.Tournament.Tests/TournamentScreenTestScene.cs
Original file line number Diff line number Diff line change
@@ -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
};
}
}
16 changes: 8 additions & 8 deletions osu.Game.Tournament.Tests/TournamentTestScene.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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)
{
Expand All @@ -45,6 +43,8 @@ private void load(TournamentStorage storage)

Ruleset.BindTo(Ladder.Ruleset);
Dependencies.CacheAs(new StableInfo(storage));

base.Content.Add(Content);
}

[SetUpSteps]
Expand Down Expand Up @@ -167,7 +167,7 @@ public static TournamentBeatmap CreateSampleBeatmap() =>

public partial class TournamentTestSceneTestRunner : TournamentGameBase, ITestSceneTestRunner
{
private TestSceneTestRunner.TestRunner runner;
private TestSceneTestRunner.TestRunner runner = null!;

protected override void LoadAsyncComplete()
{
Expand Down

0 comments on commit f837c0a

Please sign in to comment.