Skip to content

Commit 8866250

Browse files
committed
Fix seasonal background not being unloaded when changing setting to "Never"
Closes #20065.
1 parent db9970b commit 8866250

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

osu.Game/Graphics/Backgrounds/SeasonalBackgroundLoader.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,19 @@ public class SeasonalBackgroundLoader : Component
3838
private void load(OsuConfigManager config, SessionStatics sessionStatics)
3939
{
4040
seasonalBackgroundMode = config.GetBindable<SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode);
41-
seasonalBackgroundMode.BindValueChanged(_ => triggerSeasonalBackgroundChanged());
41+
seasonalBackgroundMode.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
4242

4343
seasonalBackgrounds = sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds);
44-
seasonalBackgrounds.BindValueChanged(_ => triggerSeasonalBackgroundChanged());
44+
seasonalBackgrounds.BindValueChanged(_ =>
45+
{
46+
if (shouldShowSeasonal)
47+
SeasonalBackgroundChanged?.Invoke();
48+
});
4549

4650
apiState.BindTo(api.State);
4751
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);
4852
}
4953

50-
private void triggerSeasonalBackgroundChanged()
51-
{
52-
if (shouldShowSeasonal)
53-
SeasonalBackgroundChanged?.Invoke();
54-
}
55-
5654
private void fetchSeasonalBackgrounds(ValueChangedEvent<APIState> stateChanged)
5755
{
5856
if (seasonalBackgrounds.Value != null || stateChanged.NewValue != APIState.Online)

0 commit comments

Comments
 (0)