Avoid MatchSettingsOverlay base class potentially accessing an uninitialised field

This commit is contained in:
Dean Herbert 2021-07-07 16:12:28 +09:00
parent 0db316d644
commit 24f330e5c1
3 changed files with 8 additions and 10 deletions

View File

@ -25,8 +25,12 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
private void load() private void load()
{ {
Masking = true; Masking = true;
Add(Settings = CreateSettings());
} }
protected abstract OnlinePlayComposite CreateSettings();
protected override void PopIn() protected override void PopIn()
{ {
Settings.MoveToY(0, TRANSITION_DURATION, Easing.OutQuint); Settings.MoveToY(0, TRANSITION_DURATION, Easing.OutQuint);

View File

@ -27,16 +27,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerMatchSettingsOverlay : MatchSettingsOverlay public class MultiplayerMatchSettingsOverlay : MatchSettingsOverlay
{ {
[BackgroundDependencyLoader] protected override OnlinePlayComposite CreateSettings()
private void load() => new MatchSettings
{
Child = Settings = new MatchSettings
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Y, RelativePositionAxes = Axes.Y,
SettingsApplied = Hide SettingsApplied = Hide
}; };
}
protected class MatchSettings : OnlinePlayComposite protected class MatchSettings : OnlinePlayComposite
{ {

View File

@ -26,16 +26,13 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
{ {
public Action EditPlaylist; public Action EditPlaylist;
[BackgroundDependencyLoader] protected override OnlinePlayComposite CreateSettings()
private void load() => new MatchSettings
{
Child = Settings = new MatchSettings
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Y, RelativePositionAxes = Axes.Y,
EditPlaylist = () => EditPlaylist?.Invoke() EditPlaylist = () => EditPlaylist?.Invoke()
}; };
}
protected class MatchSettings : OnlinePlayComposite protected class MatchSettings : OnlinePlayComposite
{ {