revert additions to SessionStatics

This commit is contained in:
integer
2023-01-13 23:07:21 +00:00
parent a0690e7ffb
commit 0b5c89d01f
3 changed files with 0 additions and 25 deletions

View File

@ -24,16 +24,12 @@ namespace osu.Game.Tests.NonVisual
sessionStatics.SetValue(Static.MutedAudioNotificationShownOnce, true);
sessionStatics.SetValue(Static.LowBatteryNotificationShownOnce, true);
sessionStatics.SetValue(Static.LastHoverSoundPlaybackTime, (double?)1d);
sessionStatics.SetValue(Static.ReplayPlaybackSettingExpanded, false);
sessionStatics.SetValue(Static.ReplayVisualSettingsExpanded, true);
sessionStatics.SetValue(Static.SeasonalBackgrounds, new APISeasonalBackgrounds { EndDate = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero) });
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.LoginOverlayDisplayed).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<double?>(Static.LastHoverSoundPlaybackTime).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.ReplayPlaybackSettingExpanded).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.ReplayVisualSettingsExpanded).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds).IsDefault);
sessionStatics.ResetAfterInactivity();
@ -43,8 +39,6 @@ namespace osu.Game.Tests.NonVisual
Assert.IsTrue(sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce).IsDefault);
// some statics should not reset despite inactivity.
Assert.IsFalse(sessionStatics.GetBindable<double?>(Static.LastHoverSoundPlaybackTime).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.ReplayPlaybackSettingExpanded).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.ReplayVisualSettingsExpanded).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds).IsDefault);
}
}

View File

@ -20,8 +20,6 @@ namespace osu.Game.Configuration
SetDefault(Static.MutedAudioNotificationShownOnce, false);
SetDefault(Static.LowBatteryNotificationShownOnce, false);
SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null);
SetDefault(Static.ReplayPlaybackSettingExpanded, true);
SetDefault(Static.ReplayVisualSettingsExpanded, false);
SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
}
@ -44,8 +42,6 @@ namespace osu.Game.Configuration
LoginOverlayDisplayed,
MutedAudioNotificationShownOnce,
LowBatteryNotificationShownOnce,
ReplayPlaybackSettingExpanded,
ReplayVisualSettingsExpanded,
/// <summary>
/// Info about seasonal backgrounds available fetched from API - see <see cref="APISeasonalBackgrounds"/>.

View File

@ -3,15 +3,12 @@
#nullable disable
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
using osuTK;
using osu.Game.Screens.Play.PlayerSettings;
using osuTK.Input;
using osu.Game.Configuration;
using osu.Framework.Allocation;
namespace osu.Game.Screens.Play.HUD
{
@ -19,9 +16,6 @@ namespace osu.Game.Screens.Play.HUD
{
private const int fade_duration = 200;
private Bindable<bool> playbackMenuExpanded;
private Bindable<bool> visualMenuExpanded;
public bool ReplayLoaded;
@ -54,15 +48,6 @@ namespace osu.Game.Screens.Play.HUD
};
}
[BackgroundDependencyLoader]
private void load(SessionStatics statics)
{
playbackMenuExpanded = statics.GetBindable<bool>(Static.ReplayPlaybackSettingExpanded);
visualMenuExpanded = statics.GetBindable<bool>(Static.ReplayVisualSettingsExpanded);
PlaybackSettings.Expanded.BindTo(playbackMenuExpanded);
VisualSettings.Expanded.BindTo(visualMenuExpanded);
}
protected override void PopIn() => this.FadeIn(fade_duration);
protected override void PopOut() => this.FadeOut(fade_duration);