1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 12:37:47 +08:00
osu-lazer/osu.Game/Performance/HighPerformanceSession.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2023-06-23 00:37:25 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2021-06-16 19:53:48 +08:00
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Screens.Play;
2021-06-16 19:53:48 +08:00
namespace osu.Game.Performance
{
2022-11-24 13:32:20 +08:00
public partial class HighPerformanceSession : Component
2021-06-16 19:53:48 +08:00
{
private readonly IBindable<bool> localUserPlaying = new Bindable<bool>();
[BackgroundDependencyLoader]
private void load(ILocalUserPlayInfo localUserInfo)
2021-06-16 19:53:48 +08:00
{
localUserPlaying.BindTo(localUserInfo.IsPlaying);
2021-06-16 19:53:48 +08: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()
{
}
}
}