From aba567d258734e6ce058f2248ebcd16dfa066f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20Sch=C3=BCrz?= Date: Thu, 20 Nov 2025 11:16:05 +0100 Subject: [PATCH] Add background screen --- .../Match/MatchmakingBackgroundScreen.cs | 56 +++++++++++++++++++ .../Matchmaking/Match/ScreenMatchmaking.cs | 2 + 2 files changed, 58 insertions(+) create mode 100644 osu.Game/Screens/OnlinePlay/Matchmaking/Match/MatchmakingBackgroundScreen.cs diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/MatchmakingBackgroundScreen.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/MatchmakingBackgroundScreen.cs new file mode 100644 index 0000000000..cfb3f2e6c4 --- /dev/null +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/MatchmakingBackgroundScreen.cs @@ -0,0 +1,56 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Overlays; +using osuTK.Graphics; + +namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match +{ + public partial class MatchmakingBackgroundScreen : BackgroundScreen + { + public MatchmakingBackgroundScreen() + { + InternalChild = new Content + { + RelativeSizeAxes = Axes.Both + }; + } + + public partial class Content : CompositeDrawable + { + [BackgroundDependencyLoader] + private void load(TextureStore textures, OverlayColourProvider colourProvider) + { + AddRangeInternal(new Drawable[] + { + new Sprite + { + RelativeSizeAxes = Axes.Both, + Texture = textures.Get("Backgrounds/bg1"), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colourProvider.Colour4, + Alpha = 0.5f, + }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.6f, + } + }); + } + } + } +} diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs index 972f0b4adb..8a48a089b4 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.cs @@ -57,6 +57,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match public override bool ShowFooter => true; + protected override BackgroundScreen CreateBackground() => new MatchmakingBackgroundScreen(); + [Cached(typeof(OnlinePlayBeatmapAvailabilityTracker))] private readonly OnlinePlayBeatmapAvailabilityTracker beatmapAvailabilityTracker = new MultiplayerBeatmapAvailabilityTracker();