mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Split session statics reset method to prevent unloading seasonal backgrounds while idle
This commit is contained in:
@ -13,9 +13,7 @@ namespace osu.Game.Configuration
|
||||
/// </summary>
|
||||
public class SessionStatics : InMemoryConfigManager<Static>
|
||||
{
|
||||
protected override void InitialiseDefaults() => ResetValues();
|
||||
|
||||
public void ResetValues()
|
||||
protected override void InitialiseDefaults()
|
||||
{
|
||||
ensureDefault(SetDefault(Static.LoginOverlayDisplayed, false));
|
||||
ensureDefault(SetDefault(Static.MutedAudioNotificationShownOnce, false));
|
||||
@ -24,6 +22,18 @@ namespace osu.Game.Configuration
|
||||
ensureDefault(SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to revert statics to their defaults after being idle for appropiate amount of time.
|
||||
/// Does not affect loaded seasonal backgrounds.
|
||||
/// </summary>
|
||||
public void ResetValues()
|
||||
{
|
||||
ensureDefault(GetBindable<bool>(Static.LoginOverlayDisplayed));
|
||||
ensureDefault(GetBindable<bool>(Static.MutedAudioNotificationShownOnce));
|
||||
ensureDefault(GetBindable<bool>(Static.LowBatteryNotificationShownOnce));
|
||||
ensureDefault(GetBindable<double?>(Static.LastHoverSoundPlaybackTime));
|
||||
}
|
||||
|
||||
private void ensureDefault<T>(Bindable<T> bindable) => bindable.SetDefault();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user