1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:02:57 +08:00

Load seasonal backgrounds without requiring being logged in

This commit is contained in:
Dean Herbert 2024-12-20 00:38:46 +09:00
parent 1057aa867f
commit df607ac3ea
No known key found for this signature in database

View File

@ -28,7 +28,6 @@ namespace osu.Game.Graphics.Backgrounds
[Resolved]
private IAPIProvider api { get; set; }
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
private Bindable<SeasonalBackgroundMode> seasonalBackgroundMode;
private Bindable<APISeasonalBackgrounds> seasonalBackgrounds;
@ -47,13 +46,12 @@ namespace osu.Game.Graphics.Backgrounds
SeasonalBackgroundChanged?.Invoke();
});
apiState.BindTo(api.State);
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);
fetchSeasonalBackgrounds();
}
private void fetchSeasonalBackgrounds(ValueChangedEvent<APIState> stateChanged)
private void fetchSeasonalBackgrounds()
{
if (seasonalBackgrounds.Value != null || stateChanged.NewValue != APIState.Online)
if (seasonalBackgrounds.Value != null)
return;
var request = new GetSeasonalBackgroundsRequest();