1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 04:41:24 +08:00

Fix everything crashing

This commit is contained in:
Dean Herbert
2025-11-21 13:55:01 +09:00
Unverified
parent edf7a126c8
commit 1dd026c0f0
4 changed files with 26 additions and 49 deletions
@@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays;
using osu.Game.Screens;
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
using osu.Game.Tests.Visual.Multiplayer;
@@ -19,14 +20,15 @@ namespace osu.Game.Tests.Visual.Matchmaking
protected MatchmakingTestScene()
{
BackgroundScreenStack backgroundStack;
base.Content.AddRange(new Drawable[]
{
new MatchmakingBackgroundScreen.Content
{
RelativeSizeAxes = Axes.Both,
},
backgroundStack = new BackgroundScreenStack(),
Content = new Container { RelativeSizeAxes = Axes.Both }
});
backgroundStack.Push(new MatchmakingBackgroundScreen(colourProvider));
}
}
}
@@ -5,7 +5,6 @@ using System;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@@ -13,7 +12,7 @@ using osu.Framework.Screens;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Screens.OnlinePlay.Matchmaking.Match;
using osu.Game.Screens.OnlinePlay.Matchmaking.Queue;
namespace osu.Game.Screens.OnlinePlay.Matchmaking.Intro
@@ -53,7 +52,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Intro
private IDisposable? duckOperation;
protected override BackgroundScreen CreateBackground() => new MatchmakingIntroBackgroundScreen(colourProvider);
protected override BackgroundScreen CreateBackground() => new MatchmakingBackgroundScreen(colourProvider);
public ScreenIntro()
{
@@ -240,27 +239,5 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Intro
beatmapImpactChannel?.Stop();
duckOperation?.Dispose();
}
private partial class MatchmakingIntroBackgroundScreen : RoomBackgroundScreen
{
private readonly OverlayColourProvider colourProvider;
public MatchmakingIntroBackgroundScreen(OverlayColourProvider colourProvider)
: base(null)
{
this.colourProvider = colourProvider;
}
[BackgroundDependencyLoader]
private void load()
{
AddInternal(new Box
{
Depth = float.MinValue,
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5.Opacity(0.6f),
});
}
}
}
}
@@ -3,7 +3,6 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Overlays;
@@ -12,29 +11,25 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
{
public partial class MatchmakingBackgroundScreen : BackgroundScreen
{
public MatchmakingBackgroundScreen()
private readonly OverlayColourProvider colourProvider;
public MatchmakingBackgroundScreen(OverlayColourProvider colourProvider)
{
InternalChild = new Content
{
RelativeSizeAxes = Axes.Both
};
this.colourProvider = colourProvider;
}
public partial class Content : CompositeDrawable
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
[BackgroundDependencyLoader]
private void load(TextureStore textures, OverlayColourProvider colourProvider)
InternalChild = new Sprite
{
InternalChild = new Sprite
{
RelativeSizeAxes = Axes.Both,
Texture = textures.Get("Backgrounds/bg1"),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
Colour = colourProvider.Dark2
};
}
RelativeSizeAxes = Axes.Both,
Texture = textures.Get("Backgrounds/bg1"),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
Colour = colourProvider.Dark2
};
}
}
}
@@ -57,7 +57,10 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
public override bool ShowFooter => true;
protected override BackgroundScreen CreateBackground() => new MatchmakingBackgroundScreen();
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
protected override BackgroundScreen CreateBackground() => new MatchmakingBackgroundScreen(colourProvider);
[Cached(typeof(OnlinePlayBeatmapAvailabilityTracker))]
private readonly OnlinePlayBeatmapAvailabilityTracker beatmapAvailabilityTracker = new MultiplayerBeatmapAvailabilityTracker();