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