2021-06-16 11:53:48 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-06-16 11:53:48 +00:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
2021-08-17 07:13:45 +00:00
|
|
|
using osu.Game.Screens.Play;
|
2021-06-16 11:53:48 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Performance
|
|
|
|
{
|
|
|
|
public class HighPerformanceSession : Component
|
|
|
|
{
|
|
|
|
private readonly IBindable<bool> localUserPlaying = new Bindable<bool>();
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2021-08-17 07:13:45 +00:00
|
|
|
private void load(ILocalUserPlayInfo localUserInfo)
|
2021-06-16 11:53:48 +00:00
|
|
|
{
|
2021-08-17 07:13:45 +00:00
|
|
|
localUserPlaying.BindTo(localUserInfo.IsPlaying);
|
2021-06-16 11:53:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
localUserPlaying.BindValueChanged(playing =>
|
|
|
|
{
|
|
|
|
if (playing.NewValue)
|
|
|
|
EnableHighPerformanceSession();
|
|
|
|
else
|
|
|
|
DisableHighPerformanceSession();
|
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void EnableHighPerformanceSession()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void DisableHighPerformanceSession()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|