mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Revert "Allow OverlayView fetching with no API requests required"
This reverts commit 449b9a21ae
.
This commit is contained in:
parent
5d180753fa
commit
5e4f667cff
@ -42,29 +42,25 @@ namespace osu.Game.Overlays
|
||||
/// <summary>
|
||||
/// Create the API request for fetching data.
|
||||
/// </summary>
|
||||
protected virtual APIRequest<T> CreateRequest() => null;
|
||||
protected abstract APIRequest<T> CreateRequest();
|
||||
|
||||
/// <summary>
|
||||
/// Fired when results arrive from the main API request.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
protected virtual void OnSuccess(T response)
|
||||
{
|
||||
}
|
||||
protected abstract void OnSuccess(T response);
|
||||
|
||||
/// <summary>
|
||||
/// Force a re-request for data from the API.
|
||||
/// </summary>
|
||||
protected virtual void PerformFetch()
|
||||
protected void PerformFetch()
|
||||
{
|
||||
request?.Cancel();
|
||||
request = CreateRequest();
|
||||
|
||||
if (request != null)
|
||||
{
|
||||
request.Success += response => Schedule(() => OnSuccess(response));
|
||||
API.Queue(request);
|
||||
}
|
||||
request = CreateRequest();
|
||||
request.Success += response => Schedule(() => OnSuccess(response));
|
||||
|
||||
API.Queue(request);
|
||||
}
|
||||
|
||||
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
|
||||
|
Loading…
Reference in New Issue
Block a user