mirror of
https://github.com/ppy/osu.git
synced 2025-03-10 22:17:20 +08:00
Inline some methods
This commit is contained in:
parent
47ca5c90a5
commit
a659936c57
@ -444,7 +444,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
if (!ApplyButton.Enabled.Value)
|
||||
return;
|
||||
|
||||
hideError();
|
||||
ErrorText.FadeOut(50);
|
||||
|
||||
Debug.Assert(applyingSettingsOperation == null);
|
||||
applyingSettingsOperation = ongoingOperationTracker.BeginOperation();
|
||||
@ -480,8 +480,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
}
|
||||
}
|
||||
|
||||
private void hideError() => ErrorText.FadeOut(50);
|
||||
|
||||
private void onSuccess() => Schedule(() =>
|
||||
{
|
||||
Debug.Assert(applyingSettingsOperation != null);
|
||||
|
@ -437,7 +437,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
if (!ApplyButton.Enabled.Value)
|
||||
return;
|
||||
|
||||
hideError();
|
||||
ErrorText.FadeOut(50);
|
||||
|
||||
room.Name = NameField.Text;
|
||||
room.Availability = AvailabilityPicker.Current.Value;
|
||||
@ -448,15 +448,11 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
loadingLayer.Show();
|
||||
|
||||
var req = new CreateRoomRequest(room);
|
||||
req.Success += onSuccess;
|
||||
req.Success += _ => loadingLayer.Hide();
|
||||
req.Failure += e => onError(req.Response?.Error ?? e.Message);
|
||||
api.Queue(req);
|
||||
}
|
||||
|
||||
private void hideError() => ErrorText.FadeOut(50);
|
||||
|
||||
private void onSuccess(Room room) => loadingLayer.Hide();
|
||||
|
||||
private void onError(string text)
|
||||
{
|
||||
// see https://github.com/ppy/osu-web/blob/2c97aaeb64fb4ed97c747d8383a35b30f57428c7/app/Models/Multiplayer/PlaylistItem.php#L48.
|
||||
|
Loading…
x
Reference in New Issue
Block a user