1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:02:55 +08:00

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()
{
Masking = true;
Add(Settings = CreateSettings());
}
protected abstract OnlinePlayComposite CreateSettings();
protected override void PopIn()
{
Settings.MoveToY(0, TRANSITION_DURATION, Easing.OutQuint);

View File

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

View File

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