Enable NRT

This commit is contained in:
Dan Balasescu 2022-09-07 19:05:53 +09:00
parent f8e37af2e0
commit cb9bae1f5c
2 changed files with 28 additions and 30 deletions

View File

@ -1,12 +1,10 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using JetBrains.Annotations; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;
@ -15,6 +13,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -30,12 +29,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
public class MultiplayerMatchSettingsOverlay : RoomSettingsOverlay public class MultiplayerMatchSettingsOverlay : RoomSettingsOverlay
{ {
private MatchSettings settings; private MatchSettings settings = null!;
protected override OsuButton SubmitButton => settings.ApplyButton; protected override OsuButton SubmitButton => settings.ApplyButton;
[Resolved] [Resolved]
private OngoingOperationTracker ongoingOperationTracker { get; set; } private OngoingOperationTracker ongoingOperationTracker { get; set; } = null!;
protected override bool IsLoading => ongoingOperationTracker.InProgress.Value; protected override bool IsLoading => ongoingOperationTracker.InProgress.Value;
@ -57,20 +56,24 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
{ {
private const float disabled_alpha = 0.2f; private const float disabled_alpha = 0.2f;
public Action SettingsApplied; public Action? SettingsApplied;
public OsuTextBox NameField, MaxParticipantsField; public OsuTextBox NameField = null!;
public MatchTypePicker TypePicker; public OsuTextBox MaxParticipantsField = null!;
public OsuEnumDropdown<QueueMode> QueueModeDropdown; public MatchTypePicker TypePicker = null!;
public OsuTextBox PasswordTextBox; public OsuEnumDropdown<QueueMode> QueueModeDropdown = null!;
public OsuCheckbox AutoSkipCheckbox; public OsuTextBox PasswordTextBox = null!;
public TriangleButton ApplyButton; public OsuCheckbox AutoSkipCheckbox = null!;
public TriangleButton ApplyButton = null!;
public OsuSpriteText ErrorText; public OsuSpriteText ErrorText = null!;
private OsuEnumDropdown<StartMode> startModeDropdown; private OsuEnumDropdown<StartMode> startModeDropdown = null!;
private OsuSpriteText typeLabel; private OsuSpriteText typeLabel = null!;
private LoadingLayer loadingLayer; private LoadingLayer loadingLayer = null!;
[Resolved]
private BeatmapManager beatmapManager { get; set; } = null!;
public void SelectBeatmap() public void SelectBeatmap()
{ {
@ -79,26 +82,23 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
} }
[Resolved] [Resolved]
private MultiplayerMatchSubScreen matchSubScreen { get; set; } private MultiplayerMatchSubScreen matchSubScreen { get; set; } = null!;
[Resolved] [Resolved]
private IRoomManager manager { get; set; } private IRoomManager manager { get; set; } = null!;
[Resolved] [Resolved]
private MultiplayerClient client { get; set; } private MultiplayerClient client { get; set; } = null!;
[Resolved] [Resolved]
private OngoingOperationTracker ongoingOperationTracker { get; set; } private OngoingOperationTracker ongoingOperationTracker { get; set; } = null!;
private readonly IBindable<bool> operationInProgress = new BindableBool(); private readonly IBindable<bool> operationInProgress = new BindableBool();
[CanBeNull]
private IDisposable applyingSettingsOperation;
private readonly Room room; private readonly Room room;
private Drawable playlistContainer; private IDisposable? applyingSettingsOperation;
private DrawableRoomPlaylist drawablePlaylist; private Drawable playlistContainer = null!;
private DrawableRoomPlaylist drawablePlaylist = null!;
public MatchSettings(Room room) public MatchSettings(Room room)
{ {
@ -423,7 +423,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
else else
room.MaxParticipants.Value = null; room.MaxParticipants.Value = null;
manager?.CreateRoom(room, onSuccess, onError); manager.CreateRoom(room, onSuccess, onError);
} }
} }
@ -466,7 +466,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
public class CreateOrUpdateButton : TriangleButton public class CreateOrUpdateButton : TriangleButton
{ {
[Resolved(typeof(Room), nameof(Room.RoomID))] [Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<long?> roomId { get; set; } private Bindable<long?> roomId { get; set; } = null!;
protected override void LoadComplete() protected override void LoadComplete()
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Online.API; using osu.Game.Online.API;