mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 06:52:55 +08:00
Merge pull request #20072 from peppy/fix-seasonal-background-sticking
Fix seasonal background not being unloaded when changing setting to "Never"
This commit is contained in:
commit
8b2652702a
@ -38,19 +38,17 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
private void load(OsuConfigManager config, SessionStatics sessionStatics)
|
private void load(OsuConfigManager config, SessionStatics sessionStatics)
|
||||||
{
|
{
|
||||||
seasonalBackgroundMode = config.GetBindable<SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode);
|
seasonalBackgroundMode = config.GetBindable<SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode);
|
||||||
seasonalBackgroundMode.BindValueChanged(_ => triggerSeasonalBackgroundChanged());
|
seasonalBackgroundMode.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
|
||||||
|
|
||||||
seasonalBackgrounds = sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds);
|
seasonalBackgrounds = sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds);
|
||||||
seasonalBackgrounds.BindValueChanged(_ => triggerSeasonalBackgroundChanged());
|
seasonalBackgrounds.BindValueChanged(_ =>
|
||||||
|
|
||||||
apiState.BindTo(api.State);
|
|
||||||
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void triggerSeasonalBackgroundChanged()
|
|
||||||
{
|
{
|
||||||
if (shouldShowSeasonal)
|
if (shouldShowSeasonal)
|
||||||
SeasonalBackgroundChanged?.Invoke();
|
SeasonalBackgroundChanged?.Invoke();
|
||||||
|
});
|
||||||
|
|
||||||
|
apiState.BindTo(api.State);
|
||||||
|
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchSeasonalBackgrounds(ValueChangedEvent<APIState> stateChanged)
|
private void fetchSeasonalBackgrounds(ValueChangedEvent<APIState> stateChanged)
|
||||||
|
Loading…
Reference in New Issue
Block a user